]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit - gdb/rx-tdep.c
Add support for backtracing through Renesas RX exception frames.
authorKevin Buettner <kevinb@redhat.com>
Thu, 2 Jul 2015 23:46:31 +0000 (16:46 -0700)
committerKevin Buettner <kevinb@redhat.com>
Fri, 3 Jul 2015 00:21:18 +0000 (17:21 -0700)
commit1b485e67784d7b4c212a936edc79f43bdd7d09cd
tree23e8d6bbfb89fe39b46e6ffb1e5b2a5b87fc3d2c
parent69ae7f4d16a0fd2548211a37aa5dc8482050bd70
Add support for backtracing through Renesas RX exception frames.

This change adds support for backtracing through Renesas RX exception
frames.

Determination about the type of frame is made by scanning the
remainder of the function for a return instruction and then looking at
which, if any, return instruction is found.  A normal RTS instruction
indicates that the frame is a normal frame.  An RTFI instruction
indicates that it's a fast interrupt, and an RTE instruction indicates
that the frame is a (normal) exception frame.  If no return instruction
is found within the scanned region - which can happen when the end of
the function cannot be found - it is assumed to be a normal frame.

I was able to test that normal prologue scanning still works by
disabling the dwarf2 sniffer.  I've tested this code for normal
interrupts.  The fast interrupt case has not been tested.

gdb/ChangeLog:

* rx-tdep.c (RX_USP_REGNUM, RX_BPC_REGNUM): New constants.
(enum rx_frame_type): New.
(struct rx_prologue): Add new field `frame_type'.
(rx_analyze_prologue): Add `frame_type' parameter. Cache this
parameter in the prologue struct.  Add code for recording
locations of PC and PSW for fast interrupt and exception frames.
(rx_skip_prologue): Adjust call to rx_analyze_prologue.
(rx_analyze_frame_prologue): Add `frame_type' parameter.
(rx_frame_type): New function.
(rx_frame_base): Fetch frame type and pass it to rx_analyze_prologue.
(rx_frame_this_id): Rename parameter `this_prologue_cache' to
`this_cache'.
(rx_frame_prev_register): Rename parameter `this_prologue_cache' to
`this_cache'.  Add cases for RX_FRAME_TYPE_EXCEPTION and
RX_FRAME_TYPE_FAST_INTERRUPT.
(normal_frame_p, exception_frame_p, rx_frame_sniffer_common)
(rx_frame_sniffer, rx_exception_sniffer): New functions.
(rx_frame_unwind): Use rx_frame_sniffer instead of
default_frame_sniffer.
(rx_frame_unwind): New unwinder.
(rx_gdbarch_init): Register new unwinder.
gdb/ChangeLog
gdb/rx-tdep.c