This is the mail archive of the
gdb-testers@sourceware.org
mailing list for the GDB project.
[binutils-gdb] Add psymbols for nested types
- From: sergiodj+buildbot at sergiodj dot net
- To: gdb-testers at sourceware dot org
- Date: Fri, 23 Mar 2018 15:13:54 -0400
- Subject: [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.
- Follow-Ups:
- Failures on RHEL-s390x-m64, branch master
- Failures on Ubuntu-AArch32-native-extended-gdbserver-m32, branch master
- Failures on Fedora-s390x-m64, branch master
- Failures on Ubuntu-AArch32-native-gdbserver-m32, branch master
- Failures on Fedora-i686, branch master
- Failures on Fedora-x86_64-m32, branch master
- Failures on Fedora-x86_64-native-extended-gdbserver-m32, branch master
- Failures on Fedora-x86_64-native-extended-gdbserver-m64, branch master
- *** COMPILATION FAILED *** Failures on Fedora-x86_64-w64-mingw32, branch master *** BREAKAGE ***
- Failures on Debian-s390x-native-gdbserver-m64, branch master