| 3483 | add_ranges. Returns 1 on success, 0 on error. */ |
| 3484 | |
| 3485 | static int |
| 3486 | add_function_range (struct backtrace_state *state, void *rdata, |
| 3487 | uint64_t lowpc, uint64_t highpc, |
| 3488 | backtrace_error_callback error_callback, void *data, |
| 3489 | void *pvec) |
| 3490 | { |
| 3491 | struct function *function = (struct function *) rdata; |
| 3492 | struct function_vector *vec = (struct function_vector *) pvec; |
| 3493 | struct function_addrs *p; |
| 3494 | |
| 3495 | if (vec->count > 0) |
| 3496 | { |
| 3497 | p = (struct function_addrs *) vec->vec.base + (vec->count - 1); |
| 3498 | if ((lowpc == p->high || lowpc == p->high + 1) |
| 3499 | && function == p->function) |
| 3500 | { |
| 3501 | if (highpc > p->high) |
| 3502 | p->high = highpc; |
| 3503 | return 1; |
| 3504 | } |
| 3505 | } |
| 3506 | |
| 3507 | p = ((struct function_addrs *) |
| 3508 | backtrace_vector_grow (state, sizeof (struct function_addrs), |
| 3509 | error_callback, data, &vec->vec)); |
| 3510 | if (p == NULL) |
| 3511 | return 0; |
| 3512 | |
| 3513 | p->low = lowpc; |
| 3514 | p->high = highpc; |
| 3515 | p->function = function; |
| 3516 | |
| 3517 | ++vec->count; |
| 3518 | |
| 3519 | return 1; |
| 3520 | } |
| 3521 | |
| 3522 | /* Read one entry plus all its children. Add function addresses to |
| 3523 | VEC. Returns 1 on success, 0 on error. */ |
nothing calls this directly
no test coverage detected