Exemplo n.º 1
0
static int
handle_address (GElf_Addr pc, Dwfl *dwfl)
{
  Dwfl_Module *mod = dwfl_addrmodule (dwfl, pc);

  struct stuff stuff;
  return (handle_cfi (dwfl, ".eh_frame",
		      dwfl_module_eh_cfi (mod, &stuff.bias), pc, &stuff)
	  & handle_cfi (dwfl, ".debug_frame",
			dwfl_module_dwarf_cfi (mod, &stuff.bias), pc, &stuff));
}
Exemplo n.º 2
0
/*
 * Get the DWARF frame from the .eh_frame section.
 */
static Dwarf_Frame *get_eh_frame(Dwfl_Module *mod, Dwarf_Addr pc)
{
	int		result;
	Dwarf_Addr	bias;
	Dwarf_CFI	*cfi;
	Dwarf_Frame	*frame;

	cfi = dwfl_module_eh_cfi(mod, &bias);
	if (!cfi) {
		pr_debug("%s(): no CFI - %s\n", __func__, dwfl_errmsg(-1));
		return NULL;
	}

	result = dwarf_cfi_addrframe(cfi, pc-bias, &frame);
	if (result) {
		pr_debug("%s(): %s\n", __func__, dwfl_errmsg(-1));
		return NULL;
	}

	return frame;
}