[PATCH] Introduce dw2_linkage_name and dw2_linkage_name_attr.

Pedro Alves palves@redhat.com
Wed Sep 6 15:06:00 GMT 2017


On 08/25/2017 09:55 PM, Keith Seitz wrote:
> The DWARF reader is littered with the following idiom to read a linkage name
> from the debug info:
> 
>   mangled = dwarf2_string_attr (die, DW_AT_linkage_name, cu);
>   if (mangled == NULL)
>     mangled = dwarf2_string_attr (die, DW_AT_MIPS_linkage_name, cu);
> 
> This patch introduces functions to simplify this to:
> 
>   mangled = dw2_linkage_name (die, cu);
> 
> or
> 
>   attr = dw2_linakge_name_attr (die, cu);

typo: "linakge" -> "linkage"

> 
> gdb/ChangeLog
> 
> 	* dwarf2read.c (dw2_linkage_name_attr): New function.
> 	(dw2_linkage_name): New function.
> 	(dwarf2_compute_name, dwarf2_physname, read_call_site_scope)
> 	(guess_full_die_structure_name, dwarf2_name): Use dw2_linkage_name.
> 	(anonymous_struct_prefix, dwarf2_name): Use dw2_linkage_name_attr.

Nice.  OK.

Thanks,
Pedro Alves



More information about the Gdb-patches mailing list