mirror of
https://github.com/tobast/libunwind-eh_elf.git
synced 2024-06-30 21:21:45 +02:00
Change _UPTi_find_unwind_table to return an integer.
This keeps the definition on IA64 and all the other architectures in sync with the declaration of _UPTi_find_unwind_table. This also mimics the behaviour of what's done for local unwinding and allows the function to provide more than one way to undwind. Signed-off-by: Ken Werner <ken.werner@linaro.org>
This commit is contained in:
parent
c4133e879b
commit
197571915c
|
@ -95,7 +95,7 @@ find_gp (struct UPT_info *ui, Elf64_Phdr *pdyn, Elf64_Addr load_base)
|
||||||
return gp;
|
return gp;
|
||||||
}
|
}
|
||||||
|
|
||||||
HIDDEN unw_dyn_info_t *
|
HIDDEN int
|
||||||
_UPTi_find_unwind_table (struct UPT_info *ui, unw_addr_space_t as,
|
_UPTi_find_unwind_table (struct UPT_info *ui, unw_addr_space_t as,
|
||||||
char *path, unw_word_t segbase, unw_word_t mapoff,
|
char *path, unw_word_t segbase, unw_word_t mapoff,
|
||||||
unw_word_t ip)
|
unw_word_t ip)
|
||||||
|
@ -105,7 +105,7 @@ _UPTi_find_unwind_table (struct UPT_info *ui, unw_addr_space_t as,
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if (!_Uelf64_valid_object (&ui->ei))
|
if (!_Uelf64_valid_object (&ui->ei))
|
||||||
return NULL;
|
return -UNW_ENOINFO;
|
||||||
|
|
||||||
ehdr = ui->ei.image;
|
ehdr = ui->ei.image;
|
||||||
phdr = (Elf64_Phdr *) ((char *) ui->ei.image + ehdr->e_phoff);
|
phdr = (Elf64_Phdr *) ((char *) ui->ei.image + ehdr->e_phoff);
|
||||||
|
@ -132,7 +132,7 @@ _UPTi_find_unwind_table (struct UPT_info *ui, unw_addr_space_t as,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!ptxt || !punw)
|
if (!ptxt || !punw)
|
||||||
return NULL;
|
return 0;
|
||||||
|
|
||||||
ui->di_cache.start_ip = segbase;
|
ui->di_cache.start_ip = segbase;
|
||||||
ui->di_cache.end_ip = ui->di_cache.start_ip + ptxt->p_memsz;
|
ui->di_cache.end_ip = ui->di_cache.start_ip + ptxt->p_memsz;
|
||||||
|
@ -143,7 +143,7 @@ _UPTi_find_unwind_table (struct UPT_info *ui, unw_addr_space_t as,
|
||||||
ui->di_cache.u.ti.table_len = punw->p_memsz / sizeof (unw_word_t);
|
ui->di_cache.u.ti.table_len = punw->p_memsz / sizeof (unw_word_t);
|
||||||
ui->di_cache.u.ti.table_data = (unw_word_t *)
|
ui->di_cache.u.ti.table_data = (unw_word_t *)
|
||||||
((char *) ui->ei.image + (punw->p_vaddr - ptxt->p_vaddr));
|
((char *) ui->ei.image + (punw->p_vaddr - ptxt->p_vaddr));
|
||||||
return &ui->di_cache;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
#elif UNW_TARGET_X86 || UNW_TARGET_X86_64 || UNW_TARGET_HPPA \
|
#elif UNW_TARGET_X86 || UNW_TARGET_X86_64 || UNW_TARGET_HPPA \
|
||||||
|
|
|
@ -37,7 +37,6 @@ get_list_addr (unw_addr_space_t as, unw_word_t *dil_addr, void *arg,
|
||||||
struct UPT_info *ui = arg;
|
struct UPT_info *ui = arg;
|
||||||
struct map_iterator mi;
|
struct map_iterator mi;
|
||||||
char path[PATH_MAX];
|
char path[PATH_MAX];
|
||||||
unw_dyn_info_t *di;
|
|
||||||
unw_word_t res;
|
unw_word_t res;
|
||||||
int count = 0;
|
int count = 0;
|
||||||
|
|
||||||
|
@ -62,10 +61,9 @@ get_list_addr (unw_addr_space_t as, unw_word_t *dil_addr, void *arg,
|
||||||
|
|
||||||
Debug (16, "checking object %s\n", path);
|
Debug (16, "checking object %s\n", path);
|
||||||
|
|
||||||
di = _UPTi_find_unwind_table (ui, as, path, lo, off, 0);
|
if (_UPTi_find_unwind_table (ui, as, path, lo, off, 0) > 0)
|
||||||
if (di)
|
|
||||||
{
|
{
|
||||||
res = _Uia64_find_dyn_list (as, di, arg);
|
res = _Uia64_find_dyn_list (as, &ui->di_cache, arg);
|
||||||
if (res && count++ == 0)
|
if (res && count++ == 0)
|
||||||
{
|
{
|
||||||
Debug (12, "dyn_info_list_addr = 0x%lx\n", (long) res);
|
Debug (12, "dyn_info_list_addr = 0x%lx\n", (long) res);
|
||||||
|
|
|
@ -64,7 +64,7 @@ struct UPT_info
|
||||||
|
|
||||||
extern int _UPT_reg_offset[UNW_REG_LAST + 1];
|
extern int _UPT_reg_offset[UNW_REG_LAST + 1];
|
||||||
|
|
||||||
extern unw_dyn_info_t *UPTi_find_unwind_table (struct UPT_info *ui,
|
extern int _UPTi_find_unwind_table (struct UPT_info *ui,
|
||||||
unw_addr_space_t as,
|
unw_addr_space_t as,
|
||||||
char *path,
|
char *path,
|
||||||
unw_word_t segbase,
|
unw_word_t segbase,
|
||||||
|
|
Loading…
Reference in a new issue