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: Will Cohen <wcohen at redhat dot com>
- Subject: Re: Patch to generate correct dwarf2 debugging info
- From: Graham Stott <grahams at redhat dot com>
- Date: Thu, 14 Sep 2000 16:43:01 +0100
- CC: gcc-patches at gcc dot gnu dot org
- References: <39C0ECB7.3A5A64A2@redhat.com>
Will
Will Cohen wrote:
>
> 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.
>
> -Will Cohen
>
> ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
> Index: dwarf2out.c
> ===================================================================
> RCS file: /cvs/gcc/egcs/gcc/dwarf2out.c,v
> retrieving revision 1.203
> diff -c -2 -p -r1.203 dwarf2out.c
> *** dwarf2out.c 2000/09/11 01:50:45 1.203
> --- dwarf2out.c 2000/09/14 15:13:01
> *************** add_const_value_attribute (die, rtl)
> *** 7671,7675 ****
> {
> register unsigned length = GET_MODE_SIZE (mode) / sizeof (long);
> ! long array[4];
> REAL_VALUE_TYPE rv;
>
> --- 7671,7675 ----
> {
> register unsigned length = GET_MODE_SIZE (mode) / sizeof (long);
> ! long *array = xmalloc(sizeof(long) * 4);
> REAL_VALUE_TYPE rv;
>
A couple of comments.
1) I think you need a (long *) cast on the return value from xmalloc. This
is because some compilers used for bootstraps need it.
2) I think you also need to reclaim the memory in free_AT by adding a
"case dw_val_class_float:" to the switch statement.
Graham