1
0
Fork 0
mirror of https://github.com/tobast/libunwind-eh_elf.git synced 2024-12-23 03:53:43 +01:00

dwarf: fix unw_get_proc_info

unw_get_proc_info must always load the unwind info so that unw_resume
works with GNU_args_size expressions, but must not update
use_prev_expr unless we are unw_step()ing.

blame rev: 4b63a536ee

reported-by: Doug Moore <dougm@rice.edu>
This commit is contained in:
Dave Watson 2017-04-04 11:11:21 -07:00
parent ab868ece1a
commit aee8bbe795

View file

@ -430,18 +430,15 @@ fetch_proc_info (struct dwarf_cursor *c, unw_word_t ip, int need_unwind_info)
if (c->use_prev_instr)
--ip;
if (c->pi_valid && !need_unwind_info)
return 0;
memset (&c->pi, 0, sizeof (c->pi));
/* check dynamic info first --- it overrides everything else */
ret = unwi_find_dynamic_proc_info (c->as, ip, &c->pi, need_unwind_info,
ret = unwi_find_dynamic_proc_info (c->as, ip, &c->pi, 1,
c->as_arg);
if (ret == -UNW_ENOINFO)
{
dynamic = 0;
if ((ret = tdep_find_proc_info (c, ip, need_unwind_info)) < 0)
if ((ret = tdep_find_proc_info (c, ip, 1)) < 0)
return ret;
}
@ -455,7 +452,7 @@ fetch_proc_info (struct dwarf_cursor *c, unw_word_t ip, int need_unwind_info)
/* Let system/machine-dependent code determine frame-specific attributes. */
if (ret >= 0)
tdep_fetch_frame (c, ip, need_unwind_info);
tdep_fetch_frame (c, ip, 1);
/* Update use_prev_instr for the next frame. */
if (need_unwind_info)
@ -962,7 +959,7 @@ dwarf_make_proc_info (struct dwarf_cursor *c)
int ret;
/* Lookup it up the slow way... */
if ((ret = fetch_proc_info (c, c->ip, 1)) < 0)
if ((ret = fetch_proc_info (c, c->ip, 0)) < 0)
return ret;
/* Also need to check if current frame contains
args_size, and set cursor appropriatly. Only