1
0
Fork 0
mirror of https://github.com/tobast/libunwind-eh_elf.git synced 2024-11-14 04:18:11 +01:00

Have dwarf_step return 0 or 1 for success, according to whether the

previous stack frame was the last, just as unw_step does.  For x86_64,
drop the null check for ret_addr_column, since that check is made already
in apply_reg_state.
This commit is contained in:
Doug Moore 2017-05-19 18:57:14 -05:00
parent f3be411bc8
commit afb2491ccb
2 changed files with 8 additions and 5 deletions

View file

@ -856,13 +856,17 @@ apply_reg_state (struct dwarf_cursor *c, struct dwarf_reg_state *rs)
c->cfa = cfa;
/* DWARF spec says undefined return address location means end of stack. */
if (DWARF_IS_NULL_LOC (c->loc[rs->ret_addr_column]))
c->ip = 0;
{
c->ip = 0;
ret = 0;
}
else
{
ret = dwarf_get (c, c->loc[rs->ret_addr_column], &ip);
if (ret < 0)
return ret;
c->ip = ip;
ret = 1;
}
/* XXX: check for ip to be code_aligned */
@ -876,7 +880,7 @@ apply_reg_state (struct dwarf_cursor *c, struct dwarf_reg_state *rs)
if (c->stash_frames)
tdep_stash_frame (c, rs);
return 0;
return ret;
}
/* Find the saved locations. */
@ -943,7 +947,7 @@ dwarf_step (struct dwarf_cursor *c)
return ret;
c->ret_addr_column = sr.rs_current.ret_addr_column;
return 1;
return ret;
}
HIDDEN int

View file

@ -84,8 +84,7 @@ unw_step (unw_cursor_t *cursor)
{
/* x86_64 ABI specifies that end of call-chain is marked with a
NULL RBP or undefined return address */
if (DWARF_IS_NULL_LOC (c->dwarf.loc[RBP])
|| DWARF_IS_NULL_LOC(c->dwarf.loc[c->dwarf.ret_addr_column]))
if (DWARF_IS_NULL_LOC (c->dwarf.loc[RBP]))
{
c->dwarf.ip = 0;
ret = 0;