This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Patch to generate correct dwarf2 debugging info
- To: law at cygnus dot com
- Subject: Re: Patch to generate correct dwarf2 debugging info
- From: Will Cohen <wcohen at redhat dot com>
- Date: Thu, 14 Sep 2000 11:50:32 -0400
- CC: gcc-patches at gcc dot gnu dot org
- Organization: Red Hat, Inc.
- References: <4519.968945426@upchuck>
Jeffrey A Law wrote:
>
> In message <39C0ECB7.3A5A64A2@redhat.com>you write:
> > This is a multi-part message in MIME format.
> > --------------E7054A497D1F9D81CBD2B639
> > Content-Type: text/plain; charset=us-ascii
> > Content-Transfer-Encoding: 7bit
> >
> > The current version of gcc does not generate correct dwarf2
> > debugging information for float, long long, or double constant
> > parameters passed to inline functions. This is due to data being
> > stored in a local array. This patch corrects this problem.
> >
> > 2000-09-14 Will Cohen <wcohen@redhat.com>
> >
> > * dwarf2out.c (add_const_value_attribute): Changed array into a
> > xmalloced object, so it exists after function exit.
> Note this introduces a memory leak, which I'd like to avoid if at all
> possible.
>
> If there's no good way to get a handle on when to free the information,
> then you might consider using the garbage collector to allocate space for
> you.
I was following what I saw in other places in the dwarf2out.c file.
There are a number of other xmalloc function calls that have the
same purpose as the patch.
Where can I find information about using garbage collection?
> > ! long *array = xmalloc(sizeof(long) * 4);
> Formatting nits -- always have a space between the function name and hte
> open paren for its argument list. ie
>
> long *array = xmalloc (sizeof (long) * 4);
I have changed the line to match the coding standard.
-Will