summaryrefslogtreecommitdiff
path: root/gdb/trad-frame.c
diff options
context:
space:
mode:
authorAndrew Burgess <andrew.burgess@embecosm.com>2018-08-17 08:54:26 +0100
committerAndrew Burgess <andrew.burgess@embecosm.com>2018-09-03 15:48:41 +0100
commit23e60e7a4ea772eabb6ae4788913e228763755cf (patch)
treead718250e5ee1563a221b542739735d73b48dab4 /gdb/trad-frame.c
parent20a4d0bd98969ddbfead7288e6027639dcbd9a21 (diff)
downloadbinutils-gdb-23e60e7a4ea772eabb6ae4788913e228763755cf.tar.gz
gdb: Extend the trad-frame API
Adds two new functions to the trad-frame API and update the internals of trad-frame to use the new functions. These functions will be used in later commits. gdb/ChangeLog: * trad-frame.h (trad_frame_set_realreg): Declare. (trad_frame_set_addr): Declare. * trad-frame.c (trad_frame_set_realreg): Define new function. (trad_frame_set_addr): Define new function. (trad_frame_set_reg_realreg): Use new function. (trad_frame_set_reg_addr): Use new function.
Diffstat (limited to 'gdb/trad-frame.c')
-rw-r--r--gdb/trad-frame.c25
1 files changed, 22 insertions, 3 deletions
diff --git a/gdb/trad-frame.c b/gdb/trad-frame.c
index a6e24158279..fd9f24084dc 100644
--- a/gdb/trad-frame.c
+++ b/gdb/trad-frame.c
@@ -105,6 +105,26 @@ trad_frame_set_value (struct trad_frame_saved_reg this_saved_regs[],
this_saved_regs[regnum].addr = val;
}
+/* See trad-frame.h. */
+
+void
+trad_frame_set_realreg (struct trad_frame_saved_reg this_saved_regs[],
+ int regnum, int realreg)
+{
+ this_saved_regs[regnum].realreg = realreg;
+ this_saved_regs[regnum].addr = -1;
+}
+
+/* See trad-frame.h. */
+
+void
+trad_frame_set_addr (struct trad_frame_saved_reg this_saved_regs[],
+ int regnum, CORE_ADDR addr)
+{
+ this_saved_regs[regnum].realreg = regnum;
+ this_saved_regs[regnum].addr = addr;
+}
+
void
trad_frame_set_reg_value (struct trad_frame_cache *this_trad_cache,
int regnum, LONGEST val)
@@ -118,15 +138,14 @@ void
trad_frame_set_reg_realreg (struct trad_frame_cache *this_trad_cache,
int regnum, int realreg)
{
- this_trad_cache->prev_regs[regnum].realreg = realreg;
- this_trad_cache->prev_regs[regnum].addr = -1;
+ trad_frame_set_realreg (this_trad_cache->prev_regs, regnum, realreg);
}
void
trad_frame_set_reg_addr (struct trad_frame_cache *this_trad_cache,
int regnum, CORE_ADDR addr)
{
- this_trad_cache->prev_regs[regnum].addr = addr;
+ trad_frame_set_addr (this_trad_cache->prev_regs, regnum, addr);
}
void