aboutsummaryrefslogtreecommitdiff
path: root/gdb/frame.c
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>2004-08-02 03:36:24 +0000
committerAndrew Cagney <cagney@redhat.com>2004-08-02 03:36:24 +0000
commita81dcb0537c784568efe7448b9d04b1d6b2673dd (patch)
treed3afdcda3543632589d8fde913ef8d4bf88f808c /gdb/frame.c
parent8d394f983f6278244b32a2e224c55d521f61ae9f (diff)
downloadgdb-a81dcb0537c784568efe7448b9d04b1d6b2673dd.zip
gdb-a81dcb0537c784568efe7448b9d04b1d6b2673dd.tar.gz
gdb-a81dcb0537c784568efe7448b9d04b1d6b2673dd.tar.bz2
2004-08-01 Andrew Cagney <cagney@gnu.org>
* frame.h (frame_save_as_regcache): Declare. * frame.c (frame_save_as_regcache): New function. (do_frame_read_register): Replace do_frame_unwind_register. (frame_pop): Use frame_save_as_regcache. * dummy-frame.c (generic_push_dummy_frame): Use frame_save_as_regcache.
Diffstat (limited to 'gdb/frame.c')
-rw-r--r--gdb/frame.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/gdb/frame.c b/gdb/frame.c
index 6df8b87..a723b32 100644
--- a/gdb/frame.c
+++ b/gdb/frame.c
@@ -456,12 +456,22 @@ get_frame_func (struct frame_info *fi)
}
static int
-do_frame_unwind_register (void *src, int regnum, void *buf)
+do_frame_register_read (void *src, int regnum, void *buf)
{
- frame_unwind_register (src, regnum, buf);
+ frame_register_read (src, regnum, buf);
return 1;
}
+struct regcache *
+frame_save_as_regcache (struct frame_info *this_frame)
+{
+ struct regcache *regcache = regcache_xmalloc (current_gdbarch);
+ struct cleanup *cleanups = make_cleanup_regcache_xfree (regcache);
+ regcache_save (regcache, do_frame_register_read, this_frame);
+ discard_cleanups (cleanups);
+ return regcache;
+}
+
void
frame_pop (struct frame_info *this_frame)
{
@@ -469,9 +479,9 @@ frame_pop (struct frame_info *this_frame)
Save them in a scratch buffer so that there isn't a race between
trying to extract the old values from the current_regcache while
at the same time writing new values into that same cache. */
- struct regcache *scratch = regcache_xmalloc (current_gdbarch);
+ struct regcache *scratch
+ = frame_save_as_regcache (get_prev_frame_1 (this_frame));
struct cleanup *cleanups = make_cleanup_regcache_xfree (scratch);
- regcache_save (scratch, do_frame_unwind_register, this_frame);
/* FIXME: cagney/2003-03-16: It should be possible to tell the
target's register cache that it is about to be hit with a burst