1
0
Fork 0
mirror of https://github.com/tobast/libunwind-eh_elf.git synced 2024-11-28 18:07:37 +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:
Konstantin Belousov 2014-06-28 23:28:10 +03:00 committed by Arun Sharma
parent 3723511003
commit dbce594d33

View file

@ -100,7 +100,15 @@ unw_get_proc_name (unw_cursor_t *cursor, char *buf, size_t buf_len,
unw_word_t *offp) unw_word_t *offp)
{ {
struct cursor *c = (struct cursor *) cursor; 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)); tdep_get_as_arg (c));
if (c->dwarf.use_prev_instr && offp != NULL && error == 0)
*offp += 1;
return error;
} }