[PATCH] ARM: Eliminate EXTRA_FRAME_INFO & FRAME_FIND_SAVED_REGS

Andrew Cagney ac131313@cygnus.com
Sun Jan 13 11:08:00 GMT 2002


> +      caller_fi.saved_regs = (CORE_ADDR *) xcalloc (1, SIZEOF_FRAME_SAVED_REGS);
> +      old_chain = make_cleanup (xfree, caller_fi.saved_regs);
> +      caller_fi.extra_info = xcalloc (1, sizeof (struct frame_extra_info));
> +      make_cleanup (xfree, caller_fi.extra_info);
> 
> 
> That calloc() call caught my attention.
> 
> Just call frame_saved_regs_zalloc() and frame_obstack_alloc().  Since all is on the frame obstack, worrying about cleanups is unnecessary.


Hmm, no, sorry.  That code is up to something wierd so it can't put the 
stuff on the obstack.  However, I would just use xmalloc().


> I'll A.R.I. SIZEOF_FRAME_SAVED_REGS.


I'll put a watch on it.  Many of the uses shouldn't be there.

Andrew



More information about the Gdb-patches mailing list