1
0
Fork 0
mirror of https://github.com/tobast/libunwind-eh_elf.git synced 2024-11-26 17:17:39 +01:00

Detect end of stack in x86-64 rbp-based walk.

This commit is contained in:
Lassi Tuura 2010-04-20 23:13:18 +02:00 committed by Arun Sharma
parent 92cc7fd78a
commit d4fbc8326a

View file

@ -116,6 +116,11 @@ unw_step (unw_cursor_t *cursor)
c->dwarf.loc[RIP] = DWARF_LOC (c->dwarf.cfa, 0);
c->dwarf.cfa += 8;
}
else if (DWARF_IS_NULL_LOC (c->dwarf.loc[RBP]))
{
for (i = 0; i < DWARF_NUM_PRESERVED_REGS; ++i)
c->dwarf.loc[i] = DWARF_NULL_LOC;
}
else
{
unw_word_t rbp;
@ -123,7 +128,8 @@ unw_step (unw_cursor_t *cursor)
ret = dwarf_get (&c->dwarf, c->dwarf.loc[RBP], &rbp);
if (ret < 0)
{
Debug (2, "returning %d\n", ret);
Debug (2, "returning %d [RBP=0x%lx]\n", ret,
DWARF_GET_LOC (c->dwarf.loc[RBP]));
return ret;
}