This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [PATCH] ARM: Eliminate EXTRA_FRAME_INFO & FRAME_FIND_SAVED_REGS
On Jan 13, 2:08pm, Andrew Cagney wrote:
> Subject: Re: [PATCH] ARM: Eliminate EXTRA_FRAME_INFO & FRAME_FIND_SAVED_RE
> > + 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().
With an explicit memset following the allocation? (Otherwise, they're
not initialized.)
Kevin