diff --git a/frysk-imports/libunwind/include/dwarf.h b/frysk-imports/libunwind/include/dwarf.h index cf8a74a..3a17c87 100644 --- a/frysk-imports/libunwind/include/dwarf.h +++ b/frysk-imports/libunwind/include/dwarf.h @@ -252,6 +252,10 @@ dwarf_reg_state_t; typedef struct dwarf_cie_info { +#ifndef UNW_LOCAL_ONLY + unw_addr_space_t as; /* reference to frame address-space */ + void *as_arg; /* argument to address-space callbacks */ +#endif unw_word_t cie_instr_start; /* start addr. of CIE "initial_instructions" */ unw_word_t cie_instr_end; /* end addr. of CIE "initial_instructions" */ unw_word_t fde_instr_start; /* start addr. of FDE "instructions" */ diff --git a/frysk-imports/libunwind/src/dwarf/Gfde.c b/frysk-imports/libunwind/src/dwarf/Gfde.c index de2b193..a9c36f4 100644 --- a/frysk-imports/libunwind/src/dwarf/Gfde.c +++ b/frysk-imports/libunwind/src/dwarf/Gfde.c @@ -351,7 +351,10 @@ dwarf_extract_proc_info_from_fde (unw_addr_space_t as, unw_accessors_t *a, else dci.fde_instr_start = addr; dci.fde_instr_end = fde_end_addr; - +#ifndef UNW_LOCAL_ONLY + dci.as = as; + dci.as_arg = arg; +#endif memcpy (pi->unwind_info, &dci, sizeof (dci)); } return 0; diff --git a/frysk-imports/libunwind/src/dwarf/Gparser.c b/frysk-imports/libunwind/src/dwarf/Gparser.c index ada82d9..441cf9b 100644 --- a/frysk-imports/libunwind/src/dwarf/Gparser.c +++ b/frysk-imports/libunwind/src/dwarf/Gparser.c @@ -71,8 +71,13 @@ run_cfi_program (struct dwarf_cursor *c, dwarf_state_record_t *sr, void *arg; int ret; +#ifndef UNW_LOCAL_ONLY + as = dci->as; + arg = dci->as_arg; +#else as = c->as; arg = c->as_arg; +#endif a = unw_get_accessors (as); curr_ip = c->pi.start_ip; diff --git a/frysk-sys/lib/unwind/cni/UnwindH.hxx b/frysk-sys/lib/unwind/cni/UnwindH.hxx index 08c8ce1..f56d16b 100644 --- a/frysk-sys/lib/unwind/cni/UnwindH.hxx +++ b/frysk-sys/lib/unwind/cni/UnwindH.hxx @@ -567,11 +567,7 @@ get_eh_frame_hdr_addr(unw_proc_info_t *pi, char *image, size_t size, *peh_vaddr = peh_hdr.p_vaddr; char *hdr; - // FIXME. Currently we prefer eh_frame, but we should switch to - // prefer debug_frame when all bugs have been squashed out of that - // in libunwind. - if (peh_hdr_ndx == -1 - && debug_frame_data != NULL && debug_frame_data->d_buf != NULL + if (debug_frame_data != NULL && debug_frame_data->d_buf != NULL && debug_frame_data->d_size != 0) { pi->format = UNW_INFO_FORMAT_TABLE;