This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [RFC patch]: Adjust the use of 'long' type in dwarf2.h header
- From: Kai Tietz <ktietz70 at googlemail dot com>
- To: Pierre Muller <pierre dot muller at ics-cnrs dot unistra dot fr>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>, Binutils <binutils at sourceware dot org>, gdb <gdb at sourceware dot org>, Jakub Jelinek <jakub at redhat dot com>, Joel Brobecker <brobecker at adacore dot com>
- Date: Mon, 21 Feb 2011 15:30:07 +0100
- Subject: Re: [RFC patch]: Adjust the use of 'long' type in dwarf2.h header
- References: <AANLkTimPMPKd=Hfz-1e_aSw_iQsdm2SMK5hwR0sd+tga@mail.gmail.com> <-8460070221060995487@unknownmsgid> <AANLkTingRFjfLtvFFVpJXuu1L_bV-0whUZOsL8z+s2L6@mail.gmail.com> <-6930711422310680743@unknownmsgid>
2011/2/21 Pierre Muller <pierre.muller@ics-cnrs.unistra.fr>:
>> Yes, I saw this too and it is a thorn here. But the issue about a
>> transformation function (like dwarf_vma) is that we have memory leaks
>> - as this function is to be used on some printf's more then once - as
>> static buffer would be overriden. Well printfs can be splitted into
>> smaller parts, but this then would make localization even harder.
>
> ?In GDB code, this is solved in utils.c source by the use of the
> get_cell function, which rotates over 16 char arrays of size 50 each
> currently, in dwarf.c 4 arrays of 16 char (as long as longest address is
> 64-bit)
> for this dwarf_vma function would probably be enough, no?
>
>
> Pierre Muller
> GDB pascal language maintainer
Yes, this sounds ok. I think maximum here are right now 3 dwarf_vma
prints within one printf. So it should be ok. I'll add here such a
rotating function. I don't assume we need here to handle
multi-threading, so rotation code can be pretty simple.
Kai