mirror of
https://github.com/tobast/libunwind-eh_elf.git
synced 2024-11-25 00:27:39 +01:00
Correct name returned by get_proc_name() for some frames.
Fix returning the name of the function containing the frame PC, for the non-interrupted frames. The symbol lookup code should take use_prev_instr value into account, otherwise it could return the name of the function adjacent to the caller.
This commit is contained in:
parent
3723511003
commit
dbce594d33
1 changed files with 10 additions and 2 deletions
|
@ -100,7 +100,15 @@ unw_get_proc_name (unw_cursor_t *cursor, char *buf, size_t buf_len,
|
|||
unw_word_t *offp)
|
||||
{
|
||||
struct cursor *c = (struct cursor *) cursor;
|
||||
unw_word_t ip;
|
||||
int error;
|
||||
|
||||
return get_proc_name (tdep_get_as (c), tdep_get_ip (c), buf, buf_len, offp,
|
||||
ip = tdep_get_ip (c);
|
||||
if (c->dwarf.use_prev_instr)
|
||||
--ip;
|
||||
error = get_proc_name (tdep_get_as (c), ip, buf, buf_len, offp,
|
||||
tdep_get_as_arg (c));
|
||||
if (c->dwarf.use_prev_instr && offp != NULL && error == 0)
|
||||
*offp += 1;
|
||||
return error;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue