[PATCH][gdb] Skip imports of c++ CUs

Tom Tromey tom@tromey.com
Thu Mar 12 18:44:35 GMT 2020


>>>>> "Tom" == Tom de Vries <tdevries@suse.de> writes:

Tom> 2020-03-02  Tom de Vries  <tdevries@suse.de>

Tom> 	PR gdb/23710
Tom> 	* dwarf2/read.h (struct dwarf2_per_cu_data): Add unit_type and lang
Tom> 	fields.
Tom> 	* dwarf2/read.c (process_psymtab_comp_unit): Initialize unit_type and lang
Tom> 	fields.
Tom> 	(process_imported_unit_die): Skip import of c++ CUs.

I guess this works out ok because dwarf2_per_cu_data and its
"subclasses" are memset to 0 just after allocation, and so we'll never
see a match by accident.

A nice cleanup for the "someday" list would be to allocate these objects
with "new" so we can have real initializers.

The patch looks good to me.  Thank you for doing this.

Tom


More information about the Gdb-patches mailing list