[PATCH][debug] Add -gdescriptive-dies

Tom de Vries tdevries@suse.de
Wed Aug 22 13:23:00 GMT 2018


[ was: Re: [PATCH][debug] Add -gforce-named-dies ]

On 08/22/2018 11:46 AM, Tom de Vries wrote:
> On 08/22/2018 08:56 AM, Tom de Vries wrote:
>> This is an undocumented developer-only option, because using this option may
>> change behaviour of dwarf consumers, f.i., gdb shows the artificial variables:
>> ...
>> (gdb) info locals
>> a = 0x7fffffffda90 "\005"
>> D.4278 = <optimized out>
>> ...
> I just found in the dwarf 5 spec the attribute DW_AT_description
> (present since version 3):
> ...
> 2.20 Entity Descriptions
> Some debugging information entries may describe entities in the program
> that are artificial, or which otherwise have a “name” that is not a
> valid identifier in the programming language.
> 
> This attribute provides a means for the producer to indicate the purpose
> or usage of the containing debugging infor
> 
> Generally, any debugging information entry that has, or may have, a
> DW_AT_name attribute, may also have a DW_AT_description attribute whose
> value is a null-terminated string providing a description of the entity.
> 
> It is expected that a debugger will display these descriptions as part
> of displaying other properties of an entity.
> ...
> 
> AFAICT, gdb currently does not explicitly handle this attribute, which I
> think means it's ignored.
> 
> It seems applicable to use DW_AT_description at least for the artificial
> decls.
> 
> Perhaps even for all cases that are added by the patch?
> 

I've chosen for this option. Using DW_AT_desciption instead of
DW_AT_name should minimize difference in gdb behaviour with and without
-gdescriptive-dies.

> I'll rewrite the patch.

OK for trunk?

Thanks,
- Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-debug-Add-gdescriptive-dies.patch
Type: text/x-patch
Size: 7174 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20180822/6aeefc11/attachment.bin>


More information about the Gcc-patches mailing list