binutils-gdb/gdb/testsuite/gdb.cp
Bruno Larsen 2820f08f23 Improve GDB's baseclass detection with typedefs
When a class inherits from a typedef'd baseclass, GDB may be unable to
find the baseclass if the user is not using the typedef'd name, as is
tested on gdb.cp/virtbase2.exp; the reason that test case is working
under gcc is that the dwarf generated by gcc links the class to the
original definition of the baseclass, not to the typedef.  If the
inheritance is linked to the typedef, such as how clang does it,
gdb.cp/virtbase2.exp starts failing.

This can also be seen in gdb.cp/impl-this.exp, when attempting to print
D::Bint::i, and GDB not being able to find the baseclass Bint.

This happens because searching for baseclasses only uses the macro
TYPE_BASECLASS_NAME, which returns the typedef'd name. However, we can't
switch that macro to checking for typedefs, otherwise we wouldn't be
able to find the typedef'd name anymore. This is fixed by searching for
members or baseclasses by name, we check both the saved name and the
name after checking for typedefs.

This also fixes said long-standing bug in gdb.cp/impl-this.exp when the
compiler adds information about typedefs in the debuginfo.
2022-10-03 10:09:30 +02:00
..
abstract-origin.cc
abstract-origin.exp
align.exp [gdb/testsuite] Fix gdb.cp/align.exp with gcc 12.1 / 11.3 2022-05-02 22:27:03 +02:00
ambiguous.cc
ambiguous.exp gdb/testsuite: remove unneeded calls to get_compiler_info 2022-06-24 15:07:29 +01:00
annota2.cc
annota2.exp
annota3.cc
annota3.exp
anon-ns.cc
anon-ns.exp gdb/testsuite: fix "continue outside of loop" TCL errors 2022-05-16 10:07:43 -03:00
anon-ns2.cc
anon-struct.cc
anon-struct.exp
anon-union.cc
anon-union.exp
arg-reference.cc
arg-reference.exp
array-indices.exp
array-repeat.exp
baseenum.cc
baseenum.exp
bool.cc
bool.exp
break-f-std-string.cc [gdb/testsuite] Fix gdb.cp/break-f-std-string.cc with older gcc 2022-05-12 14:52:41 +02:00
break-f-std-string.exp Fix "b f(std::string)" when current language is C 2022-05-10 14:16:21 +01:00
breakpoint-locs-2.cc
breakpoint-locs.cc
breakpoint-locs.exp
breakpoint-locs.h
breakpoint.cc
breakpoint.exp gdb/testsuite: remove unneeded calls to get_compiler_info 2022-06-24 15:07:29 +01:00
bs15503.cc
bs15503.exp gdb/testsuite: remove unneeded calls to get_compiler_info 2022-06-24 15:07:29 +01:00
call-c-1.c
call-c.cc
call-c.exp
call-method-register.cc Add PowerPC support to gdb.cp/call-method-register.cc 2022-07-13 15:24:17 +00:00
call-method-register.exp
casts.cc [gdb/testsuite] Fix gdb.cp/casts.exp with -m32 2022-05-08 19:38:13 +02:00
casts.exp gdb/testsuite: remove unneeded calls to get_compiler_info 2022-06-24 15:07:29 +01:00
casts03.cc
chained-calls.cc
chained-calls.exp
class2.cc
class2.exp gdb/testsuite: remove unneeded calls to get_compiler_info 2022-06-24 15:07:29 +01:00
classes.cc
classes.exp
cmpd-minsyms.cc
cmpd-minsyms.exp
cold-clone.cc
cold-clone.exp
constexpr-field.cc
constexpr-field.exp gdb/testsuite: fix "continue outside of loop" TCL errors 2022-05-16 10:07:43 -03:00
converts.cc
converts.exp gdb/testsuite: fix "continue outside of loop" TCL errors 2022-05-16 10:07:43 -03:00
cp-relocate.cc
cp-relocate.exp
cpcompletion.exp
cpexprs-debug-types.exp
cpexprs.cc
cpexprs.exp
cpexprs.exp.tcl gdb/testsuite: remove unneeded calls to get_compiler_info 2022-06-24 15:07:29 +01:00
cplabel.cc
cplabel.exp
cplusfuncs.cc
cplusfuncs.exp gdb/testsuite: remove unneeded calls to get_compiler_info 2022-06-24 15:07:29 +01:00
cpsizeof.cc
cpsizeof.exp gdb/testsuite: fix "continue outside of loop" TCL errors 2022-05-16 10:07:43 -03:00
ctti.exp gdb/testsuite: remove unneeded calls to get_compiler_info 2022-06-24 15:07:29 +01:00
cttiadd.cc
cttiadd1.cc
cttiadd2.cc
cttiadd3.cc
debug-expr.exp
demangle.exp
derivation.cc
derivation.exp gdb/testsuite: fix "continue outside of loop" TCL errors 2022-05-16 10:07:43 -03:00
derivation2.cc
destrprint.cc
destrprint.exp
disasm-func-name.cc
disasm-func-name.exp gdb/testsuite: remove unneeded calls to get_compiler_info 2022-06-24 15:07:29 +01:00
dispcxx.cc
dispcxx.exp gdb/testsuite: remove unneeded calls to get_compiler_info 2022-06-24 15:07:29 +01:00
ena-dis-br-range.cc
ena-dis-br-range.exp Show enabled locations with disabled breakpoint parent as "y-" 2022-05-25 19:51:46 +01:00
enum-class.cc
enum-class.exp
except-multi-location-lib.cc
except-multi-location-main.cc
except-multi-location.exp
exception.cc
exception.exp gdb/testsuite: fix "continue outside of loop" TCL errors 2022-05-16 10:07:43 -03:00
exceptprint.cc
exceptprint.exp
expand-psymtabs-cxx.cc
expand-psymtabs-cxx.exp
expand-sals.cc
expand-sals.exp
extern-c.cc
extern-c.exp
filename.cc
filename.exp gdb/testsuite: fix "continue outside of loop" TCL errors 2022-05-16 10:07:43 -03:00
formatted-ref.cc
formatted-ref.exp
fpointer.cc
fpointer.exp gdb/testsuite: fix "continue outside of loop" TCL errors 2022-05-16 10:07:43 -03:00
gdb1355.cc
gdb1355.exp gdb/testsuite: remove unneeded calls to get_compiler_info 2022-06-24 15:07:29 +01:00
gdb2384-base.cc
gdb2384-base.h
gdb2384.cc
gdb2384.exp gdb/testsuite: remove unneeded calls to get_compiler_info 2022-06-24 15:07:29 +01:00
gdb2495.cc
gdb2495.exp gdb/testsuite: remove unneeded calls to get_compiler_info 2022-06-24 15:07:29 +01:00
hang.exp
hang.H
hang1.cc
hang2.cc
hang3.cc
impl-this.cc
impl-this.exp Improve GDB's baseclass detection with typedefs 2022-10-03 10:09:30 +02:00
includefile
infcall-dlopen-lib.cc
infcall-dlopen.cc
infcall-dlopen.exp gdb/testsuite: remove unneeded calls to get_compiler_info 2022-06-24 15:07:29 +01:00
infcall-nodebug-c++-d0.exp gdb/testsuite: remove unneeded calls to get_compiler_info 2022-06-24 15:07:29 +01:00
infcall-nodebug-c++-d1.exp gdb/testsuite: remove unneeded calls to get_compiler_info 2022-06-24 15:07:29 +01:00
infcall-nodebug-c-d0.exp
infcall-nodebug-c-d1.exp
infcall-nodebug-lib.c
infcall-nodebug-main.c
infcall-nodebug.exp.tcl
inherit.exp
iostream.cc
iostream.exp gdb/testsuite: fix "continue outside of loop" TCL errors 2022-05-16 10:07:43 -03:00
koenig.cc
koenig.exp gdb/testsuite: fix "continue outside of loop" TCL errors 2022-05-16 10:07:43 -03:00
local-static.c
local-static.cc
local-static.exp
local.cc
local.exp gdb/testsuite: remove unneeded calls to get_compiler_info 2022-06-24 15:07:29 +01:00
m-data.cc
m-data.exp gdb/testsuite: remove unneeded calls to get_compiler_info 2022-06-24 15:07:29 +01:00
m-static.cc
m-static.exp gdb/testsuite: remove unneeded calls to get_compiler_info 2022-06-24 15:07:29 +01:00
m-static.h
m-static1.cc
maint.exp
many-args.cc
many-args.exp gdb/testsuite: fix "continue outside of loop" TCL errors 2022-05-16 10:07:43 -03:00
mb-ctor.cc gdb/testsuite: Expand gdb.cp/mb-ctor.exp to test dynamic allocation 2022-06-30 14:13:08 -03:00
mb-ctor.exp gdb/testsuite: Expand gdb.cp/mb-ctor.exp to test dynamic allocation 2022-06-30 14:13:08 -03:00
mb-inline.exp gdb/testsuite: remove unneeded calls to get_compiler_info 2022-06-24 15:07:29 +01:00
mb-inline.h
mb-inline1.cc
mb-inline2.cc
mb-templates.cc
mb-templates.exp gdb/testsuite: remove unneeded calls to get_compiler_info 2022-06-24 15:07:29 +01:00
member-name.cc
member-name.exp
member-ptr.cc
member-ptr.exp gdb/testsuite: remove unneeded calls to get_compiler_info 2022-06-24 15:07:29 +01:00
meth-typedefs.cc
meth-typedefs.exp gdb/testsuite: fix "continue outside of loop" TCL errors 2022-05-16 10:07:43 -03:00
method-call-in-c.cc
method-call-in-c.exp
method.cc
method.exp gdb/testsuite: remove unneeded calls to get_compiler_info 2022-06-24 15:07:29 +01:00
method2.cc
method2.exp gdb/testsuite: fix "continue outside of loop" TCL errors 2022-05-16 10:07:43 -03:00
minsym-fallback-main.cc
minsym-fallback.cc
minsym-fallback.exp
minsym-fallback.h
misc.cc
misc.exp
namelessclass.cc
namelessclass.exp gdb/testsuite: fix "continue outside of loop" TCL errors 2022-05-16 10:07:43 -03:00
namelessclass.S
namespace-enum-main.cc
namespace-enum.cc
namespace-enum.exp
namespace-nested-import.cc
namespace-nested-import.exp gdb/testsuite: fix "continue outside of loop" TCL errors 2022-05-16 10:07:43 -03:00
namespace.cc
namespace.exp gdb/testsuite: remove unneeded calls to get_compiler_info 2022-06-24 15:07:29 +01:00
namespace1.cc
nested-class-func-class.cc
nested-class-func-class.exp
nested-types.cc
nested-types.exp
nextoverthrow.cc
nextoverthrow.exp gdb/testsuite: remove unneeded calls to get_compiler_info 2022-06-24 15:07:29 +01:00
no-libstdcxx-probe.exp
non-trivial-retval.cc
non-trivial-retval.exp
noparam.cc
noparam.exp
nsalias.cc
nsalias.exp gdb/testsuite: fix "continue outside of loop" TCL errors 2022-05-16 10:07:43 -03:00
nsdecl.cc
nsdecl.exp gdb/testsuite: remove unneeded calls to get_compiler_info 2022-06-24 15:07:29 +01:00
nsimport.cc
nsimport.exp gdb/testsuite: fix "continue outside of loop" TCL errors 2022-05-16 10:07:43 -03:00
nsnested.cc
nsnested.exp gdb/testsuite: fix "continue outside of loop" TCL errors 2022-05-16 10:07:43 -03:00
nsnoimports.cc
nsnoimports.exp gdb/testsuite: fix "continue outside of loop" TCL errors 2022-05-16 10:07:43 -03:00
nsrecurs.cc
nsrecurs.exp gdb/testsuite: remove unneeded calls to get_compiler_info 2022-06-24 15:07:29 +01:00
nsstress.cc
nsstress.exp gdb/testsuite: remove unneeded calls to get_compiler_info 2022-06-24 15:07:29 +01:00
nsusing.cc
nsusing.exp gdb/testsuite: remove unneeded calls to get_compiler_info 2022-06-24 15:07:29 +01:00
operator.cc
operator.exp gdb/testsuite: fix "continue outside of loop" TCL errors 2022-05-16 10:07:43 -03:00
oranking.cc
oranking.exp gdb/testsuite: fix "continue outside of loop" TCL errors 2022-05-16 10:07:43 -03:00
overload-const.cc
overload-const.exp
overload.cc
overload.exp
ovldbreak.cc
ovldbreak.exp Test "set multiple-symbols on" creating multiple breakpoints 2022-05-20 20:41:02 +01:00
ovsrch.exp gdb/testsuite: fix "continue outside of loop" TCL errors 2022-05-16 10:07:43 -03:00
ovsrch.h
ovsrch1.cc
ovsrch2.cc
ovsrch3.cc
ovsrch4.cc
paren-type.cc
paren-type.exp
parse-lang.cc
parse-lang.exp
pass-by-ref-2.cc
pass-by-ref-2.exp gdb/testsuite: fix "continue outside of loop" TCL errors 2022-05-16 10:07:43 -03:00
pass-by-ref.exp gdb/testsuite: fix "continue outside of loop" TCL errors 2022-05-16 10:07:43 -03:00
pointer-to-member.cc [gdb/exp] Fix internal error when printing C++ pointer-to-member 2022-07-05 22:41:25 +02:00
pointer-to-member.exp [gdb/exp] Fix internal error when printing C++ pointer-to-member 2022-07-05 22:41:25 +02:00
pr-574.cc
pr-574.exp gdb/testsuite: remove unneeded calls to get_compiler_info 2022-06-24 15:07:29 +01:00
pr-1023.cc
pr-1023.exp gdb/testsuite: remove unneeded calls to get_compiler_info 2022-06-24 15:07:29 +01:00
pr-1210.cc
pr-1210.exp gdb/testsuite: remove unneeded calls to get_compiler_info 2022-06-24 15:07:29 +01:00
pr9067.cc
pr9067.exp gdb/testsuite: fix "continue outside of loop" TCL errors 2022-05-16 10:07:43 -03:00
pr9167.cc
pr9167.exp
pr9594.cc
pr9631.cc
pr9631.exp gdb/testsuite: remove unneeded calls to get_compiler_info 2022-06-24 15:07:29 +01:00
pr10687.cc
pr10687.exp
pr10728-x.cc
pr10728-x.h
pr10728-y.cc
pr10728.exp gdb/testsuite: fix "continue outside of loop" TCL errors 2022-05-16 10:07:43 -03:00
pr12028.cc
pr12028.exp
pr17132.cc
pr17132.exp
pr17494.cc
pr17494.exp
print-demangle.exp
print-method-args.cc [gdb/c++] Print destructor the same for gcc and clang 2022-09-30 05:47:54 +02:00
print-method-args.exp [gdb/c++] Print destructor the same for gcc and clang 2022-09-30 05:47:54 +02:00
printmethod.cc
printmethod.exp gdb/testsuite: remove unneeded calls to get_compiler_info 2022-06-24 15:07:29 +01:00
psmang.exp gdb/testsuite: remove unneeded calls to get_compiler_info 2022-06-24 15:07:29 +01:00
psmang1.cc
psmang2.cc
psymtab-parameter.cc
psymtab-parameter.exp
ptype-cv-cp.cc
ptype-cv-cp.exp
ptype-flags.cc gdb: Use a typedef's scoped type name to identify local typedefs 2022-03-04 16:42:30 +01:00
ptype-flags.exp gdb: Use a typedef's scoped type name to identify local typedefs 2022-03-04 16:42:30 +01:00
punctuator.exp
re-set-overloaded.cc
re-set-overloaded.exp gdb/testsuite: remove unneeded calls to get_compiler_info 2022-06-24 15:07:29 +01:00
readnow-language.cc
readnow-language.exp
ref-params.cc
ref-params.exp
ref-types.cc
ref-types.exp gdb/testsuite: fix "continue outside of loop" TCL errors 2022-05-16 10:07:43 -03:00
rtti.exp gdb/testsuite: remove unneeded calls to get_compiler_info 2022-06-24 15:07:29 +01:00
rtti.h
rtti1.cc
rtti2.cc
rvalue-ref-casts.cc
rvalue-ref-casts.exp gdb/testsuite: remove unneeded calls to get_compiler_info 2022-06-24 15:07:29 +01:00
rvalue-ref-overload.cc
rvalue-ref-overload.exp
rvalue-ref-params.cc
rvalue-ref-params.exp
rvalue-ref-sizeof.cc
rvalue-ref-sizeof.exp gdb/testsuite: fix "continue outside of loop" TCL errors 2022-05-16 10:07:43 -03:00
rvalue-ref-types.cc
rvalue-ref-types.exp gdb/testsuite: fix "continue outside of loop" TCL errors 2022-05-16 10:07:43 -03:00
save-bp-qualified.cc
save-bp-qualified.exp
scope-err.cc
scope-err.exp gdb/testsuite: fix "continue outside of loop" TCL errors 2022-05-16 10:07:43 -03:00
shadow.cc
shadow.exp gdb/testsuite: remove unneeded calls to get_compiler_info 2022-06-24 15:07:29 +01:00
smartp.cc
smartp.exp gdb/testsuite: fix "continue outside of loop" TCL errors 2022-05-16 10:07:43 -03:00
static-method.cc
static-method.exp gdb: Fix DUPLICATE and PATH regressions throughout 2022-05-25 13:44:12 +01:00
static-print-quit.cc
static-print-quit.exp
static-typedef-print.cc
static-typedef-print.exp gdb/testsuite: remove unneeded calls to get_compiler_info 2022-06-24 15:07:29 +01:00
step-and-next-inline.cc
step-and-next-inline.exp gdb/testsuite: remove unneeded calls to get_compiler_info 2022-06-24 15:07:29 +01:00
step-and-next-inline.h
stub-array-size.cc
stub-array-size.exp
stub-array-size.h
stub-array-size2.cc
subtypes-2.cc
subtypes.cc
subtypes.exp
subtypes.h
temargs.cc
temargs.exp gdb/testsuite: remove unneeded calls to get_compiler_info 2022-06-24 15:07:29 +01:00
templates.cc Support template lookups in strncmp_iw_with_mode 2022-02-24 16:42:22 -08:00
templates.exp [gdb/c++] Print destructor the same for gcc and clang 2022-09-30 05:47:54 +02:00
try_catch.cc
try_catch.exp gdb/testsuite: remove unneeded calls to get_compiler_info 2022-06-24 15:07:29 +01:00
typed-enum.cc
typed-enum.exp gdb/testsuite: remove unneeded calls to get_compiler_info 2022-06-24 15:07:29 +01:00
typedef-base.cc
typedef-base.exp gdb/testsuite: remove unneeded calls to get_compiler_info 2022-06-24 15:07:29 +01:00
typedef-operator.cc
typedef-operator.exp
typeid.cc
typeid.exp
userdef.cc
userdef.exp gdb/testsuite: fix "continue outside of loop" TCL errors 2022-05-16 10:07:43 -03:00
using-crash.cc
using-crash.exp
var-tag-2.cc
var-tag-3.cc
var-tag-4.cc
var-tag.cc
var-tag.exp gdb/testsuite: fix "continue outside of loop" TCL errors 2022-05-16 10:07:43 -03:00
virtbase.cc
virtbase.exp gdb/testsuite: fix "continue outside of loop" TCL errors 2022-05-16 10:07:43 -03:00
virtbase2.cc
virtbase2.exp gdb/testsuite: fix "continue outside of loop" TCL errors 2022-05-16 10:07:43 -03:00
virtfunc.cc
virtfunc.exp
virtfunc2.cc
virtfunc2.exp gdb/testsuite: fix "continue outside of loop" TCL errors 2022-05-16 10:07:43 -03:00
vla-cxx.cc
vla-cxx.exp
watch-cp.cc
watch-cp.exp gdb/testsuite: fix "continue outside of loop" TCL errors 2022-05-16 10:07:43 -03:00
wide_char_types.c
wide_char_types.exp