aboutsummaryrefslogtreecommitdiff
path: root/gdb/frame.c
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>2003-02-02 20:31:43 +0000
committerAndrew Cagney <cagney@redhat.com>2003-02-02 20:31:43 +0000
commit5b181d62776936b5547a8d25db77b07517bfddea (patch)
tree265dd5003ea4f7e3775aa5c168eafb2687862e16 /gdb/frame.c
parent5e0116d519c197dbd989e07c5e011e7a0dfd73c7 (diff)
downloadgdb-5b181d62776936b5547a8d25db77b07517bfddea.zip
gdb-5b181d62776936b5547a8d25db77b07517bfddea.tar.gz
gdb-5b181d62776936b5547a8d25db77b07517bfddea.tar.bz2
2003-02-02 Andrew Cagney <ac131313@redhat.com>
* frame.c (frame_unwind_register): New function. (frame_unwind_unsigned_register): Use. (frame_unwind_signed_register): Use. (frame_read_register): New function. * frame.h (frame_unwind_register): Declare. (frame_read_register): Declare. * d10v-tdep.c (d10v_frame_pop): Rewrite. Use regcache_cooked_write and frame_unwind_register instead of read_memory, write_register and deprecated_write_register_bytes.
Diffstat (limited to 'gdb/frame.c')
-rw-r--r--gdb/frame.c26
1 files changed, 17 insertions, 9 deletions
diff --git a/gdb/frame.c b/gdb/frame.c
index f5d40bd..0c3009c 100644
--- a/gdb/frame.c
+++ b/gdb/frame.c
@@ -238,16 +238,22 @@ frame_register (struct frame_info *frame, int regnum,
}
void
-frame_unwind_signed_register (struct frame_info *frame, int regnum,
- LONGEST *val)
+frame_unwind_register (struct frame_info *frame, int regnum, void *buf)
{
int optimized;
CORE_ADDR addr;
int realnum;
enum lval_type lval;
- void *buf = alloca (MAX_REGISTER_RAW_SIZE);
frame_register_unwind (frame, regnum, &optimized, &lval, &addr,
&realnum, buf);
+}
+
+void
+frame_unwind_signed_register (struct frame_info *frame, int regnum,
+ LONGEST *val)
+{
+ void *buf = alloca (MAX_REGISTER_RAW_SIZE);
+ frame_unwind_register (frame, regnum, buf);
(*val) = extract_signed_integer (buf, REGISTER_VIRTUAL_SIZE (regnum));
}
@@ -255,17 +261,19 @@ void
frame_unwind_unsigned_register (struct frame_info *frame, int regnum,
ULONGEST *val)
{
- int optimized;
- CORE_ADDR addr;
- int realnum;
- enum lval_type lval;
void *buf = alloca (MAX_REGISTER_RAW_SIZE);
- frame_register_unwind (frame, regnum, &optimized, &lval, &addr,
- &realnum, buf);
+ frame_unwind_register (frame, regnum, buf);
(*val) = extract_unsigned_integer (buf, REGISTER_VIRTUAL_SIZE (regnum));
}
void
+frame_read_register (struct frame_info *frame, int regnum, void *buf)
+{
+ gdb_assert (frame != NULL && frame->next != NULL);
+ frame_unwind_register (frame->next, regnum, buf);
+}
+
+void
frame_read_unsigned_register (struct frame_info *frame, int regnum,
ULONGEST *val)
{