From f6c609c4c2bb326e580c9f533bd2aa0e9d583556 Mon Sep 17 00:00:00 2001 From: Andrew Cagney Date: Mon, 6 Jan 2003 21:50:25 +0000 Subject: 2003-01-06 Andrew Cagney * 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. --- gdb/frame.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'gdb/frame.c') diff --git a/gdb/frame.c b/gdb/frame.c index 361651e..443f067 100644 --- a/gdb/frame.c +++ b/gdb/frame.c @@ -1316,6 +1316,24 @@ deprecated_frame_xmalloc (void) return frame; } +struct frame_info * +deprecated_frame_xmalloc_with_cleanup (long sizeof_saved_regs, + long sizeof_extra_info) +{ + struct frame_info *frame = deprecated_frame_xmalloc (); + make_cleanup (xfree, frame); + if (sizeof_saved_regs > 0) + { + frame->saved_regs = xcalloc (1, sizeof_saved_regs); + make_cleanup (xfree, frame->saved_regs); + } + if (sizeof_extra_info > 0) + { + frame->extra_info = xcalloc (1, sizeof_extra_info); + make_cleanup (xfree, frame->extra_info); + } + return frame; +} void _initialize_frame (void) -- cgit v1.1