mirror of
https://github.com/tobast/libunwind-eh_elf.git
synced 2024-12-31 23:23:43 +01:00
ptrace: check for NULL arg.
tdep_get_func_addr in ppc64 passes NULL for the last argument of as->access_mem. tdep_get_func_addr is called by elf_w(lookup_symbol), which in turn is called by elf_w(get_proc_name_in_image). elf_w(get_proc_name_in_image) is part of the API, and is only passed an unw_addr_space_t, not a unw_cursor_t, meaning that we cannot recover the UPT_info on the PPC64 platform. This could be fixed by giving libunwind the knowledge to perform relocations itself, thus not needing to look at the running image to determine function addresses.
This commit is contained in:
parent
10abb25af4
commit
3d6f7479b0
1 changed files with 5 additions and 0 deletions
|
@ -32,6 +32,9 @@ _UPT_access_mem (unw_addr_space_t as, unw_word_t addr, unw_word_t *val,
|
|||
int write, void *arg)
|
||||
{
|
||||
struct UPT_info *ui = arg;
|
||||
if (!ui)
|
||||
return -UNW_EINVAL;
|
||||
|
||||
pid_t pid = ui->pid;
|
||||
|
||||
errno = 0;
|
||||
|
@ -65,6 +68,8 @@ _UPT_access_mem (unw_addr_space_t as, unw_word_t addr, unw_word_t *val,
|
|||
int write, void *arg)
|
||||
{
|
||||
struct UPT_info *ui = arg;
|
||||
if (!ui)
|
||||
return -UNW_EINVAL;
|
||||
pid_t pid = ui->pid;
|
||||
struct ptrace_io_desc iod;
|
||||
|
||||
|
|
Loading…
Reference in a new issue