[PATCH][gdb/symtab] Add symbol with inherited DW_AT_const_value to psymtabs

Tom de Vries tdevries@suse.de
Tue Apr 7 14:54:27 GMT 2020


On 07-04-2020 15:09, Tom Tromey wrote:
>>>>>> "Tom" == Tom de Vries <tdevries@suse.de> writes:
> 
> Tom> (gdb) p aaa^M
> Tom> No symbol "aaa" in current context.^M
> 
> Tom> Fix this by making sure that partial_die_info::has_const_value is
> Tom> inherited in partial_die_info::fixup.
> 
> It's clearly necessary to do something like this (unfortunate IMO, but
> necessary).  However, has_specification is set for many things:
> 
> 	case DW_AT_abstract_origin:
> 	case DW_AT_specification:
> 	case DW_AT_extension:
> 	  has_specification = 1;
> 
> ... but I think perhaps only DW_TAG_variable actually needs this?
>  
> Tom> +  if (!has_const_value && has_specification)
> 
> ... so maybe it would be more efficient to check for DW_TAG_variable
> here.  What do you think?
> 

I think that if we check for tag, we need to check for all tags that can
contain DW_AT_const_value. Updated patch accordingly.

> My main concern is not to make psymbol reading any slower than it
> already is.

Still faster than -readnow though, I hope :)

Cheers,
- Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-gdb-symtab-Add-symbol-with-inherited-DW_AT_const_value-to-psymtabs.patch
Type: text/x-patch
Size: 6430 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/gdb-patches/attachments/20200407/a9d4f501/attachment.bin>


More information about the Gdb-patches mailing list