diff options
author | Andrew Cagney <cagney@redhat.com> | 2003-01-06 21:50:25 +0000 |
---|---|---|
committer | Andrew Cagney <cagney@redhat.com> | 2003-01-06 21:50:25 +0000 |
commit | f6c609c4c2bb326e580c9f533bd2aa0e9d583556 (patch) | |
tree | 7f5974da7d3a38c4ed7430a947fd61c165eec113 /gdb/arm-tdep.c | |
parent | 84dc46cbdb5a9c4ca576b8768a2876e9551199a5 (diff) | |
download | gdb-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/arm-tdep.c')
-rw-r--r-- | gdb/arm-tdep.c | 22 |
1 files changed, 7 insertions, 15 deletions
diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c index dba7dad..52729a2 100644 --- a/gdb/arm-tdep.c +++ b/gdb/arm-tdep.c @@ -1041,23 +1041,15 @@ arm_frame_chain (struct frame_info *fi) caller_fi. */ if (arm_pc_is_thumb (caller_pc) != arm_pc_is_thumb (get_frame_pc (fi))) { - struct frame_info caller_fi; - struct cleanup *old_chain; - - /* Create a temporary frame suitable for scanning the caller's - prologue. (Ugh.) */ - memset (&caller_fi, 0, sizeof (caller_fi)); - caller_fi.extra_info = (struct frame_extra_info *) - xcalloc (1, sizeof (struct frame_extra_info)); - old_chain = make_cleanup (xfree, caller_fi.extra_info); - caller_fi.saved_regs = (CORE_ADDR *) - xcalloc (1, SIZEOF_FRAME_SAVED_REGS); - make_cleanup (xfree, caller_fi.saved_regs); + struct cleanup *old_chain = make_cleanup (null_cleanup, NULL); + struct frame_info *caller_fi = + deprecated_frame_xmalloc_with_cleanup (SIZEOF_FRAME_SAVED_REGS, + sizeof (struct frame_extra_info)); /* Now, scan the prologue and obtain the frame register. */ - deprecated_update_frame_pc_hack (&caller_fi, caller_pc); - arm_scan_prologue (&caller_fi); - framereg = caller_fi.extra_info->framereg; + deprecated_update_frame_pc_hack (caller_fi, caller_pc); + arm_scan_prologue (caller_fi); + framereg = caller_fi->extra_info->framereg; /* Deallocate the storage associated with the temporary frame created above. */ |