mirror of
https://github.com/tobast/libunwind-eh_elf.git
synced 2024-11-22 23:47:39 +01:00
Identify end-of-stack by undefined return address location.
This commit is contained in:
parent
dac2d001af
commit
4c553ceb2c
1 changed files with 13 additions and 6 deletions
|
@ -750,13 +750,20 @@ apply_reg_state (struct dwarf_cursor *c, struct dwarf_reg_state *rs)
|
|||
break;
|
||||
}
|
||||
}
|
||||
c->cfa = cfa;
|
||||
ret = dwarf_get (c, c->loc[c->ret_addr_column], &ip);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
c->ip = ip;
|
||||
/* XXX: check for ip to be code_aligned */
|
||||
|
||||
c->cfa = cfa;
|
||||
/* DWARF spec says undefined return address location means end of stack. */
|
||||
if (DWARF_IS_NULL_LOC (c->loc[c->ret_addr_column]))
|
||||
c->ip = 0;
|
||||
else
|
||||
{
|
||||
ret = dwarf_get (c, c->loc[c->ret_addr_column], &ip);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
c->ip = ip;
|
||||
}
|
||||
|
||||
/* XXX: check for ip to be code_aligned */
|
||||
if (c->ip == prev_ip && c->cfa == prev_cfa)
|
||||
{
|
||||
Dprintf ("%s: ip and cfa unchanged; stopping here (ip=0x%lx)\n",
|
||||
|
|
Loading…
Reference in a new issue