diff --git a/src/dwarf/Gparser.c b/src/dwarf/Gparser.c index 698dd49a..3fdd8c83 100644 --- a/src/dwarf/Gparser.c +++ b/src/dwarf/Gparser.c @@ -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 diff --git a/src/x86_64/Gstep.c b/src/x86_64/Gstep.c index de666a73..b95adfa7 100644 --- a/src/x86_64/Gstep.c +++ b/src/x86_64/Gstep.c @@ -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;