MCPcopy Create free account
hub / github.com/crossuo/crossuo / read_function_entry

Function read_function_entry

external/tracy/libbacktrace/dwarf.cpp:3525–3762  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3523 VEC. Returns 1 on success, 0 on error. */
3524
3525static int
3526read_function_entry (struct backtrace_state *state, struct dwarf_data *ddata,
3527 struct unit *u, uint64_t base, struct dwarf_buf *unit_buf,
3528 const struct line_header *lhdr,
3529 backtrace_error_callback error_callback, void *data,
3530 struct function_vector *vec_function,
3531 struct function_vector *vec_inlined)
3532{
3533 while (unit_buf->left > 0)
3534 {
3535 uint64_t code;
3536 const struct abbrev *abbrev;
3537 int is_function;
3538 struct function *function;
3539 struct function_vector *vec;
3540 size_t i;
3541 struct pcrange pcrange;
3542 int have_linkage_name;
3543
3544 code = read_uleb128 (unit_buf);
3545 if (code == 0)
3546 return 1;
3547
3548 abbrev = lookup_abbrev (&u->abbrevs, code, error_callback, data);
3549 if (abbrev == NULL)
3550 return 0;
3551
3552 is_function = (abbrev->tag == DW_TAG_subprogram
3553 || abbrev->tag == DW_TAG_entry_point
3554 || abbrev->tag == DW_TAG_inlined_subroutine);
3555
3556 if (abbrev->tag == DW_TAG_inlined_subroutine)
3557 vec = vec_inlined;
3558 else
3559 vec = vec_function;
3560
3561 function = NULL;
3562 if (is_function)
3563 {
3564 function = ((struct function *)
3565 backtrace_alloc (state, sizeof *function,
3566 error_callback, data));
3567 if (function == NULL)
3568 return 0;
3569 memset (function, 0, sizeof *function);
3570 }
3571
3572 memset (&pcrange, 0, sizeof pcrange);
3573 have_linkage_name = 0;
3574 for (i = 0; i < abbrev->num_attrs; ++i)
3575 {
3576 struct attr_val val;
3577
3578 if (!read_attribute (abbrev->attrs[i].form, abbrev->attrs[i].val,
3579 unit_buf, u->is_dwarf64, u->version,
3580 u->addrsize, &ddata->dwarf_sections,
3581 ddata->altlink, &val))
3582 return 0;

Callers 1

read_function_infoFunction · 0.85

Calls 13

read_uleb128Function · 0.85
lookup_abbrevFunction · 0.85
backtrace_allocFunction · 0.85
read_attributeFunction · 0.85
resolve_addr_indexFunction · 0.85
dwarf_buf_errorFunction · 0.85
resolve_stringFunction · 0.85
update_pcrangeFunction · 0.85
backtrace_freeFunction · 0.85
add_rangesFunction · 0.85
backtrace_vector_releaseFunction · 0.85

Tested by

no test coverage detected