aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite
diff options
context:
space:
mode:
authorGary Benson <gbenson@redhat.com>2020-10-27 17:02:39 +0000
committerGary Benson <gbenson@redhat.com>2020-10-27 17:02:39 +0000
commit934a1764071ebe9d6e148e741b55bafb036a7cc6 (patch)
tree045b137cc07e905b8fa76eb4c79cfc7da3cbe5f6 /gdb/testsuite
parent0bf21fbd79477304e7fd99869b823da19289e5ba (diff)
downloadgdb-934a1764071ebe9d6e148e741b55bafb036a7cc6.zip
gdb-934a1764071ebe9d6e148e741b55bafb036a7cc6.tar.gz
gdb-934a1764071ebe9d6e148e741b55bafb036a7cc6.tar.bz2
Fix gdb.python/py-format-string.exp with Clang
GDB includes the virtual table pointer when formatting polymorphic C++ objects for printing, but GCC and Clang name these differently: GCC emits a DW_AT_name of "_vptr.Base" when describing the virtual table pointer of a type derived from type "Base", whereas Clang will emit "_vptr$Base" in this situation. This commit fixes a testcase which failed because of this. gdb/testsuite/ChangeLog: * gdb.python/py-format-string.exp (test_deref_refs): Treat "_vptr$Base" as correct, in addition to "_vptr.Base". (test_mixed): Likewise.
Diffstat (limited to 'gdb/testsuite')
-rw-r--r--gdb/testsuite/ChangeLog6
-rw-r--r--gdb/testsuite/gdb.python/py-format-string.exp4
2 files changed, 8 insertions, 2 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 6f92df8..a260377 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,9 @@
+2020-10-14 Gary Benson <gbenson@redhat.com>
+
+ * gdb.python/py-format-string.exp (test_deref_refs): Treat
+ "_vptr$Base" as correct, in addition to "_vptr.Base".
+ (test_mixed): Likewise.
+
2020-10-27 Gary Benson <gbenson@redhat.com>
* gdb.mi/mi-fortran-modules.exp: Check skip_fortran_tests.
diff --git a/gdb/testsuite/gdb.python/py-format-string.exp b/gdb/testsuite/gdb.python/py-format-string.exp
index 792d60c..b7acc24 100644
--- a/gdb/testsuite/gdb.python/py-format-string.exp
+++ b/gdb/testsuite/gdb.python/py-format-string.exp
@@ -509,7 +509,7 @@ proc test_deref_refs {} {
if { $current_lang == "c++" } {
check_var_with_bool_opt "deref_refs" "a_point_t_ref"
check_var_with_bool_opt "deref_refs" "a_base_ref" \
- "${default_ref_regexp}: \\{_vptr\\.Base = ${default_pointer_regexp} <vtable for Deriv\\+16>, a = 42, static a_static_member = 2019\\}"
+ "${default_ref_regexp}: \\{_vptr\[.\$\]Base = ${default_pointer_regexp} <vtable for Deriv\\+16>, a = 42, static a_static_member = 2019\\}"
}
}
@@ -905,7 +905,7 @@ proc test_mixed {} {
check_format_string "a_base_ref" \
"deref_refs=True, static_members=False" \
- "${default_ref_regexp}: \\{_vptr\\.Base = ${default_pointer_regexp} <vtable for Deriv\\+16>, a = 42\\}"
+ "${default_ref_regexp}: \\{_vptr\[.\$\]Base = ${default_pointer_regexp} <vtable for Deriv\\+16>, a = 42\\}"
}
}