diff options
author | Andrew Cagney <cagney@redhat.com> | 2003-11-23 02:48:40 +0000 |
---|---|---|
committer | Andrew Cagney <cagney@redhat.com> | 2003-11-23 02:48:40 +0000 |
commit | 213cc0adce5744bfcc60c72833efa76338580f8c (patch) | |
tree | 215335f471fbd826ebea805b08bfb13a93ffd023 | |
parent | 436d9e46434ecc4ee860265c8f7f8c11bcb9904f (diff) | |
download | gdb-213cc0adce5744bfcc60c72833efa76338580f8c.zip gdb-213cc0adce5744bfcc60c72833efa76338580f8c.tar.gz gdb-213cc0adce5744bfcc60c72833efa76338580f8c.tar.bz2 |
2003-11-22 Andrew Cagney <cagney@redhat.com>
* frame.c (deprecated_frame_xmalloc): Delete function.
(deprecated_set_frame_extra_info_hack): Delete function.
(deprecated_set_frame_saved_regs_hack): Delete function.
* frame.h (deprecated_frame_xmalloc): Delete declaration.
(deprecated_set_frame_extra_info_hack): Delete declaration.
(deprecated_set_frame_saved_regs_hack): Delete declaration.
* mcore-tdep.c (analyze_dummy_frame): Instead of
deprecated_frame_xmalloc, deprecated_set_frame_saved_regs_hack,
and deprecated_set_frame_extra_info_hack use
deprecated_frame_xmalloc_with_cleanup.
* mn10300-tdep.c (analyze_dummy_frame): Ditto.
* mips-tdep.c (mips_init_extra_frame_info): Delete call to
deprecated_set_frame_saved_regs_hack.
-rw-r--r-- | gdb/ChangeLog | 14 | ||||
-rw-r--r-- | gdb/frame.c | 25 | ||||
-rw-r--r-- | gdb/frame.h | 19 | ||||
-rw-r--r-- | gdb/mcore-tdep.c | 19 | ||||
-rw-r--r-- | gdb/mips-tdep.c | 1 | ||||
-rw-r--r-- | gdb/mn10300-tdep.c | 17 |
6 files changed, 26 insertions, 69 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 457b405..05a6b35 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,19 @@ 2003-11-22 Andrew Cagney <cagney@redhat.com> + * frame.c (deprecated_frame_xmalloc): Delete function. + (deprecated_set_frame_extra_info_hack): Delete function. + (deprecated_set_frame_saved_regs_hack): Delete function. + * frame.h (deprecated_frame_xmalloc): Delete declaration. + (deprecated_set_frame_extra_info_hack): Delete declaration. + (deprecated_set_frame_saved_regs_hack): Delete declaration. + * mcore-tdep.c (analyze_dummy_frame): Instead of + deprecated_frame_xmalloc, deprecated_set_frame_saved_regs_hack, + and deprecated_set_frame_extra_info_hack use + deprecated_frame_xmalloc_with_cleanup. + * mn10300-tdep.c (analyze_dummy_frame): Ditto. + * mips-tdep.c (mips_init_extra_frame_info): Delete call to + deprecated_set_frame_saved_regs_hack. + * mips-tdep.c (mips_frame_chain): Delete call to deprecated_inside_entry_file. diff --git a/gdb/frame.c b/gdb/frame.c index 1b3d9bc..7f4c8aa 100644 --- a/gdb/frame.c +++ b/gdb/frame.c @@ -2223,34 +2223,13 @@ deprecated_update_frame_base_hack (struct frame_info *frame, CORE_ADDR base) frame->this_id.value.stack_addr = base; } -void -deprecated_set_frame_saved_regs_hack (struct frame_info *frame, - CORE_ADDR *saved_regs) -{ - frame->saved_regs = saved_regs; -} - -void -deprecated_set_frame_extra_info_hack (struct frame_info *frame, - struct frame_extra_info *extra_info) -{ - frame->extra_info = extra_info; -} - struct frame_info * -deprecated_frame_xmalloc (void) +deprecated_frame_xmalloc_with_cleanup (long sizeof_saved_regs, + long sizeof_extra_info) { struct frame_info *frame = XMALLOC (struct frame_info); memset (frame, 0, sizeof (*frame)); frame->this_id.p = 1; - 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) { diff --git a/gdb/frame.h b/gdb/frame.h index 3cde00b..4dc2fb1 100644 --- a/gdb/frame.h +++ b/gdb/frame.h @@ -702,25 +702,6 @@ extern void deprecated_update_frame_pc_hack (struct frame_info *frame, extern void deprecated_update_frame_base_hack (struct frame_info *frame, CORE_ADDR base); -/* FIXME: cagney/2003-01-04: Explicitly set the frame's saved_regs - and/or extra_info. Target code is allocating a fake frame and than - initializing that to get around the problem of, when creating the - inner most frame, there is no where to cache information such as - the prologue analysis. This is fixed by the new unwind mechanism - - even the inner most frame has somewhere to store things like the - prolog analysis (or at least will once the frame overhaul is - finished). */ -extern void deprecated_set_frame_saved_regs_hack (struct frame_info *frame, - CORE_ADDR *saved_regs); -extern void deprecated_set_frame_extra_info_hack (struct frame_info *frame, - struct frame_extra_info *extra_info); - -/* FIXME: cagney/2003-01-04: Allocate a frame from the heap (rather - than the frame obstack). Targets do this as a way of saving the - prologue analysis from the inner most frame before that frame has - been created. By always creating a frame, this problem goes away. */ -extern struct frame_info *deprecated_frame_xmalloc (void); - /* FIXME: cagney/2003-01-05: Allocate a frame, along with the saved_regs and extra_info. Set up cleanups for all three. Same as for deprecated_frame_xmalloc, targets are calling this when diff --git a/gdb/mcore-tdep.c b/gdb/mcore-tdep.c index af1900a..598a0ac 100644 --- a/gdb/mcore-tdep.c +++ b/gdb/mcore-tdep.c @@ -246,25 +246,16 @@ mcore_reg_struct_has_addr (int gcc_p, struct type *type) static struct frame_info * analyze_dummy_frame (CORE_ADDR pc, CORE_ADDR frame) { - static struct frame_info *dummy = NULL; - - if (dummy == NULL) - { - struct frame_extra_info *extra_info; - CORE_ADDR *saved_regs; - dummy = deprecated_frame_xmalloc (); - saved_regs = (CORE_ADDR *) xmalloc (SIZEOF_FRAME_SAVED_REGS); - deprecated_set_frame_saved_regs_hack (dummy, saved_regs); - extra_info = XMALLOC (struct frame_extra_info); - deprecated_set_frame_extra_info_hack (dummy, extra_info); - } - + struct cleanup *old_chain = make_cleanup (null_cleanup, NULL); + struct frame_info *dummy + = deprecated_frame_xmalloc_with_cleanup (SIZEOF_FRAME_SAVED_REGS, + sizeof (struct frame_extra_info)); deprecated_update_frame_pc_hack (dummy, pc); deprecated_update_frame_base_hack (dummy, frame); get_frame_extra_info (dummy)->status = 0; get_frame_extra_info (dummy)->framesize = 0; - memset (deprecated_get_frame_saved_regs (dummy), '\000', SIZEOF_FRAME_SAVED_REGS); mcore_analyze_prologue (dummy, 0, 0); + do_cleanups (old_chain); return dummy; } diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c index 0946ecf..7ee7427 100644 --- a/gdb/mips-tdep.c +++ b/gdb/mips-tdep.c @@ -2575,7 +2575,6 @@ mips_init_extra_frame_info (int fromleaf, struct frame_info *fci) frame_extra_info_zalloc (fci, sizeof (struct frame_extra_info)); - deprecated_set_frame_saved_regs_hack (fci, NULL); get_frame_extra_info (fci)->proc_desc = proc_desc == &temp_proc_desc ? 0 : proc_desc; if (proc_desc) diff --git a/gdb/mn10300-tdep.c b/gdb/mn10300-tdep.c index 9f62e8a..fdc3530 100644 --- a/gdb/mn10300-tdep.c +++ b/gdb/mn10300-tdep.c @@ -152,23 +152,16 @@ static struct frame_info *analyze_dummy_frame (CORE_ADDR, CORE_ADDR); static struct frame_info * analyze_dummy_frame (CORE_ADDR pc, CORE_ADDR frame) { - static struct frame_info *dummy = NULL; - if (dummy == NULL) - { - struct frame_extra_info *extra_info; - CORE_ADDR *saved_regs; - dummy = deprecated_frame_xmalloc (); - saved_regs = xmalloc (SIZEOF_FRAME_SAVED_REGS); - deprecated_set_frame_saved_regs_hack (dummy, saved_regs); - extra_info = XMALLOC (struct frame_extra_info); - deprecated_set_frame_extra_info_hack (dummy, extra_info); - } + struct cleanup *old_chain = make_cleanup (null_cleanup, NULL); + struct frame_info *dummy + = deprecated_frame_xmalloc_with_cleanup (SIZEOF_FRAME_SAVED_REGS, + sizeof (struct frame_extra_info)); deprecated_update_frame_pc_hack (dummy, pc); deprecated_update_frame_base_hack (dummy, frame); get_frame_extra_info (dummy)->status = 0; get_frame_extra_info (dummy)->stack_size = 0; - memset (deprecated_get_frame_saved_regs (dummy), '\000', SIZEOF_FRAME_SAVED_REGS); mn10300_analyze_prologue (dummy, pc); + do_cleanups (old_chain); return dummy; } |