This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Patch to generate correct dwarf2 debugging info

Jeffrey A Law wrote:
>   In message <>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  <>
>   >
>   >     * 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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]