14 #include <elfutils/libdwfl.h> 37 .find_debuginfo = dwfl_standard_find_debuginfo,
38 .section_address = dwfl_offline_section_address,
50 Dwarf_Op *ops = &dummy;
54 result = dwarf_frame_register(frame, ra_regno, ops_mem, &ops, &nops);
56 pr_debug(
"dwarf_frame_register() %s\n", dwarf_errmsg(-1));
63 if (nops != 0 || ops != NULL)
70 result = dwarf_frame_cfa(frame, &ops, &nops);
72 pr_debug(
"dwarf_frame_cfa() returns %d, %s\n", result,
80 if (nops == 1 && ops[0].atom == DW_OP_bregx && ops[0].number == 1 &&
100 cfi = dwfl_module_eh_cfi(mod, &bias);
102 pr_debug(
"%s(): no CFI - %s\n", __func__, dwfl_errmsg(-1));
106 result = dwarf_cfi_addrframe(cfi, pc-bias, &frame);
108 pr_debug(
"%s(): %s\n", __func__, dwfl_errmsg(-1));
125 cfi = dwfl_module_dwarf_cfi(mod, &bias);
127 pr_debug(
"%s(): no CFI - %s\n", __func__, dwfl_errmsg(-1));
131 result = dwarf_cfi_addrframe(cfi, pc-bias, &frame);
133 pr_debug(
"%s(): %s\n", __func__, dwfl_errmsg(-1));
155 Dwarf_Addr
start = pc;
165 pr_debug(
"dwfl_begin() failed: %s\n", dwarf_errmsg(-1));
169 mod = dwfl_report_elf(dwfl, exec_file, exec_file, -1,
172 pr_debug(
"dwfl_report_elf() failed %s\n",
185 mod = dwfl_addrmodule(dwfl, pc);
187 pr_debug(
"dwfl_addrmodule() failed, %s\n", dwarf_errmsg(-1));
202 ra_regno = dwarf_frame_info(frame, &start, &end, &signalp);
204 pr_debug(
"Return address register unavailable: %s\n",
257 pr_debug(
"%" PRIx64
" dso is NULL\n", ip);
263 pr_debug(
"[DSO %s, sym %s, ip 0x%" PRIx64
"] rc %d\n",
271 }
else if (rc == 2) {
static int check_return_addr(struct dso *dso, u64 map_start, Dwarf_Addr pc)
static const Dwfl_Callbacks offline_callbacks
int arch_skip_callchain_idx(struct thread *thread, struct ip_callchain *chain)
#define pr_debug(fmt,...)
static char * debuginfo_path
static struct rb_root result
static Dwarf_Frame * get_dwarf_frame(Dwfl_Module *mod, Dwarf_Addr pc)
static Dwarf_Frame * get_eh_frame(Dwfl_Module *mod, Dwarf_Addr pc)
struct symbol * thread__find_symbol(struct thread *thread, u8 cpumode, u64 addr, struct addr_location *al)
static int check_return_reg(int ra_regno, Dwarf_Frame *frame)