1
0
Fork 0
mirror of https://github.com/tobast/libunwind-eh_elf.git synced 2024-12-03 19:57:39 +01:00

Unused members are removed from callback_data struct

This commit is contained in:
Alexander Esilevich 2010-07-29 09:34:29 +07:00
parent 35e1cb3ecb
commit 7d6f41048c

View file

@ -51,14 +51,11 @@ struct callback_data
{ {
/* in: */ /* in: */
unw_word_t ip; /* instruction-pointer we're looking for */ unw_word_t ip; /* instruction-pointer we're looking for */
unw_proc_info_t *pi; /* proc-info pointer */
int need_unwind_info; int need_unwind_info;
unw_addr_space_t as; /* address space */ unw_addr_space_t as; /* address space */
void *arg; void *arg;
/* out: */ /* out: */
int single_fde; /* did we find a single FDE? (vs. a table) */ unw_proc_info_t *pi; /* proc-info pointer */
unw_dyn_info_t di; /* table info (if single_fde is false) */
unw_dyn_info_t di_debug; /* additional table info for .debug_frame */
}; };
static int static int
@ -409,7 +406,6 @@ static int
callback (struct dl_phdr_info *info, size_t size, void *ptr) callback (struct dl_phdr_info *info, size_t size, void *ptr)
{ {
struct callback_data *cb_data = ptr; struct callback_data *cb_data = ptr;
unw_dyn_info_t *di = &cb_data->di;
const Elf_W(Phdr) *phdr, *p_eh_hdr, *p_dynamic, *p_text; const Elf_W(Phdr) *phdr, *p_eh_hdr, *p_dynamic, *p_text;
unw_word_t addr, eh_frame_start, eh_frame_end, fde_count, ip; unw_word_t addr, eh_frame_start, eh_frame_end, fde_count, ip;
Elf_W(Addr) load_base, segbase = 0, max_load_addr = 0; Elf_W(Addr) load_base, segbase = 0, max_load_addr = 0;
@ -547,7 +543,6 @@ callback (struct dl_phdr_info *info, size_t size, void *ptr)
/* XXX we know how to build a local binary search table for /* XXX we know how to build a local binary search table for
.debug_frame, so we could do that here too. */ .debug_frame, so we could do that here too. */
cb_data->single_fde = 1;
found = linear_search (unw_local_addr_space, ip, found = linear_search (unw_local_addr_space, ip,
eh_frame_start, eh_frame_end, fde_count, eh_frame_start, eh_frame_end, fde_count,
pi, need_unwind_info, NULL); pi, need_unwind_info, NULL);
@ -567,22 +562,10 @@ callback (struct dl_phdr_info *info, size_t size, void *ptr)
means relative to the start of that section... */ means relative to the start of that section... */
unw_word_t segbase = (unw_word_t) (uintptr_t) hdr; unw_word_t segbase = (unw_word_t) (uintptr_t) hdr;
di->format = UNW_INFO_FORMAT_REMOTE_TABLE;
di->start_ip = p_text->p_vaddr + load_base;
di->end_ip = p_text->p_vaddr + load_base + p_text->p_memsz;
di->u.rti.name_ptr = (unw_word_t) (uintptr_t) info->dlpi_name;
di->u.rti.table_data = addr;
assert (sizeof (struct table_entry) % sizeof (unw_word_t) == 0);
di->u.rti.table_len = (fde_count * sizeof (struct table_entry)
/ sizeof (unw_word_t));
/* For the binary-search table in the eh_frame_hdr, data-relative
means relative to the start of that section... */
di->u.rti.segbase = (unw_word_t) (uintptr_t) hdr;
Debug (15, "found table `%s': segbase=0x%lx, len=%lu, gp=0x%lx, " Debug (15, "found table `%s': segbase=0x%lx, len=%lu, gp=0x%lx, "
"table_data=0x%lx\n", (char *) (uintptr_t) di->u.rti.name_ptr, "table_data=0x%lx\n", (char *) (uintptr_t) info->dlpi_name,
(long) di->u.rti.segbase, (long) di->u.rti.table_len, (long) segbase, (long) table_len,
(long) di->gp, (long) di->u.rti.table_data); (long) pi->gp, (long) addr);
err = dwarf_search_unwind_table_ (cb_data->as, cb_data->ip, err = dwarf_search_unwind_table_ (cb_data->as, cb_data->ip,
segbase, table_len, segbase, table_len,
@ -604,7 +587,6 @@ callback (struct dl_phdr_info *info, size_t size, void *ptr)
} }
Debug (15, "Trying to find .debug_frame\n"); Debug (15, "Trying to find .debug_frame\n");
di = &cb_data->di_debug;
fdesc = locate_debug_info (unw_local_addr_space, info, ip, info->dlpi_name); fdesc = locate_debug_info (unw_local_addr_space, info, ip, info->dlpi_name);
if (!fdesc) if (!fdesc)
@ -722,19 +704,12 @@ callback (struct dl_phdr_info *info, size_t size, void *ptr)
free (tab); free (tab);
} }
di->format = UNW_INFO_FORMAT_TABLE;
di->start_ip = fdesc->start;
di->end_ip = fdesc->end;
di->u.ti.name_ptr = (unw_word_t) (uintptr_t) info->dlpi_name;
di->u.ti.table_data = (unw_word_t *) fdesc;
di->u.ti.table_len = sizeof (*fdesc) / sizeof (unw_word_t);
di->u.ti.segbase = (unw_word_t) (uintptr_t) info->dlpi_addr;
Debug (15, "found debug_frame table `%s': segbase=0x%lx, len=%lu, " Debug (15, "found debug_frame table `%s': segbase=0x%lx, len=%lu, "
"gp=0x%lx, table_data=0x%lx\n", "gp=0x%lx, table_data=0x%lx\n",
(char *) (uintptr_t) di->u.ti.name_ptr, (char *) (uintptr_t) info->dlpi_name,
(long) di->u.ti.segbase, (long) di->u.ti.table_len, (unw_word_t) (uintptr_t) info->dlpi_addr,
(long) di->gp, (long) di->u.ti.table_data); (long) sizeof (*fdesc) / sizeof (unw_word_t),
(long) pi->gp, (long) fdesc);
err = dwarf_search_unwind_table_local (cb_data->as, cb_data->ip, fdesc, err = dwarf_search_unwind_table_local (cb_data->as, cb_data->ip, fdesc,
(unw_word_t) (uintptr_t) info->dlpi_addr, (unw_word_t) (uintptr_t) info->dlpi_addr,
@ -775,8 +750,6 @@ dwarf_find_proc_info (unw_addr_space_t as, unw_word_t ip,
cb_data.ip = ip; cb_data.ip = ip;
cb_data.pi = pi; cb_data.pi = pi;
cb_data.need_unwind_info = need_unwind_info; cb_data.need_unwind_info = need_unwind_info;
cb_data.di.format = -1;
cb_data.di_debug.format = -1;
cb_data.as = as; cb_data.as = as;
cb_data.arg = arg; cb_data.arg = arg;