1
0
Fork 0
mirror of https://github.com/tobast/libunwind-eh_elf.git synced 2024-11-22 15:47:37 +01:00

Identify end-of-stack by undefined return address location.

This commit is contained in:
Lassi Tuura 2010-04-20 23:13:11 +02:00 committed by Arun Sharma
parent dac2d001af
commit 4c553ceb2c

View file

@ -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",