aboutsummaryrefslogtreecommitdiff
path: root/gdb/cris-tdep.c
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>2003-01-06 21:50:25 +0000
committerAndrew Cagney <cagney@redhat.com>2003-01-06 21:50:25 +0000
commitf6c609c4c2bb326e580c9f533bd2aa0e9d583556 (patch)
tree7f5974da7d3a38c4ed7430a947fd61c165eec113 /gdb/cris-tdep.c
parent84dc46cbdb5a9c4ca576b8768a2876e9551199a5 (diff)
downloadgdb-f6c609c4c2bb326e580c9f533bd2aa0e9d583556.zip
gdb-f6c609c4c2bb326e580c9f533bd2aa0e9d583556.tar.gz
gdb-f6c609c4c2bb326e580c9f533bd2aa0e9d583556.tar.bz2
2003-01-06 Andrew Cagney <ac131313@redhat.com>
* frame.h (deprecated_frame_xmalloc_with_cleanup): Declare. * frame.c (deprecated_frame_xmalloc_with_cleanup): New function. * arm-tdep.c (arm_frame_chain): Allocate caller_fi using deprecated_frame_xmalloc_with_cleanup. * m32r-tdep.c (m32r_virtual_frame_pointer): Allocate `fi' using deprecated_frame_xmalloc. * mcore-tdep.c (analyze_dummy_frame): Ditto for dummy. * mn10200-tdep.c (mn10200_frame_chain): Ditto for dummy_frame.
Diffstat (limited to 'gdb/cris-tdep.c')
-rw-r--r--gdb/cris-tdep.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/gdb/cris-tdep.c b/gdb/cris-tdep.c
index eb7256b..fdc3afb 100644
--- a/gdb/cris-tdep.c
+++ b/gdb/cris-tdep.c
@@ -734,17 +734,15 @@ cris_skip_prologue_frameless_p (CORE_ADDR pc)
CORE_ADDR
cris_skip_prologue_main (CORE_ADDR pc, int frameless_p)
{
- struct frame_info fi;
- static struct frame_extra_info fei;
+ struct cleanup *old_chain = make_cleanup (null_cleanup, NULL);
+ struct frame_info *fi;
struct symtab_and_line sal = find_pc_line (pc, 0);
int best_limit;
CORE_ADDR pc_after_prologue;
- /* frame_info now contains dynamic memory. Since fi is a dummy here,
- I use static memory for extra_info, and don't bother allocating
- memory for saved_regs. */
- memset (&fi, 0, sizeof (fi));
- fi.extra_info = &fei;
+ /* frame_info now contains dynamic memory. Since fi is a dummy
+ here, I don't bother allocating memory for saved_regs. */
+ fi = deprecated_frame_xmalloc_with_cleanup (0, sizeof (struct frame_extra_info));
/* If there is no symbol information then sal.end == 0, and we end up
examining only the first instruction in the function prologue.
@@ -754,7 +752,8 @@ cris_skip_prologue_main (CORE_ADDR pc, int frameless_p)
else
best_limit = pc + 100;
- pc_after_prologue = cris_examine (pc, best_limit, &fi, frameless_p);
+ pc_after_prologue = cris_examine (pc, best_limit, fi, frameless_p);
+ do_cleanups (old_chain);
return pc_after_prologue;
}