[fpc-devel] DW_AT_external and other additions to FPC generated dwarf

Martin Frb lazarus at mfriebe.de
Sun Mar 26 16:50:19 CEST 2023


On 26/03/2023 15:50, Florian Klämpfl via fpc-devel wrote:
> Am 23.03.23 um 09:45 schrieb Martin Frb via fpc-devel:
>
> It's a little hard to comment all at once, but at least I start with 
> one :)
>
>> 4) "official" marker for string vs pchar vs array
>>
>
> What about using DW_TAG_string_type for this? IIRC, when I implemented 
> dwarf, it was not available/not supported, but fpdebug can do they. I 
> am not sure about the status of GDB about it though :)

That would work.
But it can't distinguish between strings of char or widechar.  I.e. it 
can only be used for short and long-string(ansi). But not WideString or 
UnicodeString.
Only DWARF 5 introduces a "DW_AT_type" for DW_TAG_string_type that can 
then define the base type for each char.
Ignoring gdb, fpc could add that for lower dwarf versions too.


It also would fall short, if ever Fpc did what Delphi did: 
{$ZEROBASEDSTRINGS }
Though, maybe that is a "wont ever happen".


  It still needs to be added to fpdebug, but that will be easy.
It is present in gdb sources, but I have no idea how well it will then work.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20230326/dee5dd58/attachment.htm>


More information about the fpc-devel mailing list