This is the mail archive of the gdb-testers@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[binutils-gdb] Add psymbols for nested types


*** TEST RESULTS FOR COMMIT b7fee5a3268c340975a1dddb131733abfd153d5e ***

Author: Keith Seitz <keiths@redhat.com>
Branch: master
Commit: b7fee5a3268c340975a1dddb131733abfd153d5e

Add psymbols for nested types

c++/22968 involves the inability of ptype to find a type definition for
a type defined inside another type.  I recently added some additional
support for nested type definitions, but I apparently overlooked psymbols.

The user reports that using -readnow fixes the problem:

$ gdb 22968 -ex "ptype Outer::Inner"
There is no field named Inner

$ gdb -readnow 22968 -ex "ptype Outer::Inner"
type = struct Outer::Inner {
  <no data field>
}

We clearly did not find a psymbol for Outer::Inner because it was located
in another CU.  This patch addresses this problem by scanning structs
for additional psymbols.  Rust is already doing this.

With this patch, the identical result to "-readnow" is given (without
using `-readnow', of course).

gdb/ChangeLog:

	PR c++/22968
	* dwarf2read.c (scan_partial_symbols): Scan structs/classes for
	nested type definitions for C++, too.

gdb/testsuite/ChangeLog:

	PR c++/22968
	* gdb.cp/subtypes.exp: New file.
	* gdb.cp/subtypes.h: New file.
	* gdb.cp/subtypes.cc: New file.
	* gdb.cp/subtypes-2.cc: New file.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]