This is the mail archive of the gcc-patches@gcc.gnu.org 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


The automatic declaration of array caused the original problem.  The
array has to be around after exiting the function.  The automatic
array wasn't didn't exist after function exit and caused bogus
debugging information to be generated (pointer to random place
on stack).

The older version of GCC which the problem was reported on didn't
have free up the allocated memory.  However, Graham pointed
out the function on the current version of GCC that frees
up the arrays.  I have revised my patch.

-Will

Nick Clifton wrote:
> 
> Hi Will,
> 
> : --- 7671,7675 ----
> :         {
> :           register unsigned length = GET_MODE_SIZE (mode) / sizeof (long);
> : !         long *array = xmalloc(sizeof(long) * 4);
> :           REAL_VALUE_TYPE rv;
> 
> As an alternative to xmalloc'ing why not just use a normal automatic
> declaration, ie:
> 
>              long array [4 * sizeof (long)];
> 
> Cheers
>         Nick

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