summaryrefslogtreecommitdiff
path: root/libdwfl/frame_unwind.c
diff options
context:
space:
mode:
authorJose E. Marchesi <jose.marchesi@oracle.com>2015-12-08 19:10:41 +0100
committerMark Wielaard <mjw@redhat.com>2016-01-03 10:31:41 +0100
commit73be3d2d1a5dbdb6aa954b244524d21346af27d8 (patch)
tree384f0300c08062cee789c5e63d2ad0220eef309c /libdwfl/frame_unwind.c
parent42f0df13d7c0b3ec1a547eca84eca694f6d42310 (diff)
downloadelfutils-73be3d2d1a5dbdb6aa954b244524d21346af27d8.tar.gz
libdwfl: make the unwinder aware of the backend defined ra_offset.
Ebl backends can define an offset that must be applied to the value of the "return address register" defined in the CFI ABI information. This patch makes the unwinder to use that offset when reading the RA CFI register. Signed-off-by: Jose E. Marchesi <jose.marchesi@oracle.com>
Diffstat (limited to 'libdwfl/frame_unwind.c')
-rw-r--r--libdwfl/frame_unwind.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/libdwfl/frame_unwind.c b/libdwfl/frame_unwind.c
index 39509b70..0e470b97 100644
--- a/libdwfl/frame_unwind.c
+++ b/libdwfl/frame_unwind.c
@@ -637,7 +637,14 @@ handle_cfi (Dwfl_Frame *state, Dwarf_Addr pc, Dwarf_CFI *cfi, Dwarf_Addr bias)
if (unwound->pc == 0)
unwound->pc_state = DWFL_FRAME_STATE_PC_UNDEFINED;
else
- unwound->pc_state = DWFL_FRAME_STATE_PC_SET;
+ {
+ unwound->pc_state = DWFL_FRAME_STATE_PC_SET;
+ /* In SPARC the return address register actually contains
+ the address of the call instruction instead of the return
+ address. Therefore we add here an offset defined by the
+ backend. Most likely 0. */
+ unwound->pc += ebl_ra_offset (ebl);
+ }
}
free (frame);
}