aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@polymtl.ca>2021-12-02 10:28:40 -0500
committerSimon Marchi <simon.marchi@polymtl.ca>2021-12-02 11:54:51 -0500
commitd184a3c16a0f1c3c235713337ffb61b730e4a940 (patch)
tree4a2f02ad49403385b446723832ed21f3964fec15 /gdb/testsuite
parent9a73e1cafedc2e3a466b6193a460cb8062fa0a59 (diff)
downloadgdb-d184a3c16a0f1c3c235713337ffb61b730e4a940.zip
gdb-d184a3c16a0f1c3c235713337ffb61b730e4a940.tar.gz
gdb-d184a3c16a0f1c3c235713337ffb61b730e4a940.tar.bz2
gdb/testsuite: update tests looking for "DWARF 2" debug format
Commit ab557072b8ec ("gdb: use actual DWARF version in compunit's debugformat field") changes the debug format string in "info source" to show the actual DWARF version, rather than always show "DWARF 2". However, it failed to consider that some tests checked for the "DWARF 2" string to see if the test program is compiled with DWARF debug information. Since everything is compiled with DWARF 4 or 5 nowadays, that changed the behavior of those tests. Notably, it prevent the tests using skip_inline_var_tests to run. Grep through the testsuite for "DWARF 2" and change all occurrences I could find to use "DWARF [0-9]" instead (that string is passed to TCL's string match). Change-Id: Ic7fb0217fb9623880c6f155da6becba0f567a885
Diffstat (limited to 'gdb/testsuite')
-rw-r--r--gdb/testsuite/gdb.base/complex.exp2
-rw-r--r--gdb/testsuite/gdb.base/constvars.exp2
-rw-r--r--gdb/testsuite/gdb.base/included.exp2
-rw-r--r--gdb/testsuite/gdb.base/structs.exp8
-rw-r--r--gdb/testsuite/gdb.base/volatile.exp2
-rw-r--r--gdb/testsuite/gdb.cp/class2.exp2
-rw-r--r--gdb/testsuite/gdb.cp/m-static.exp2
-rw-r--r--gdb/testsuite/gdb.dwarf2/pr10770.exp4
-rw-r--r--gdb/testsuite/lib/gdb.exp8
9 files changed, 16 insertions, 16 deletions
diff --git a/gdb/testsuite/gdb.base/complex.exp b/gdb/testsuite/gdb.base/complex.exp
index bcea6ad..776a69f 100644
--- a/gdb/testsuite/gdb.base/complex.exp
+++ b/gdb/testsuite/gdb.base/complex.exp
@@ -26,7 +26,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
if [runto f2] then {
get_debug_format
- if { [test_compiler_info gcc-2-*] && [test_debug_format "DWARF 2"] } then {
+ if { [test_compiler_info gcc-2-*] && [test_debug_format "DWARF \[0-9\]"] } then {
setup_xfail "*-*-*"
}
gdb_test "p *y" "\\\$\[0-9\]* = \{c = 42 '\\*', f = 1 \\+ 0i\}" \
diff --git a/gdb/testsuite/gdb.base/constvars.exp b/gdb/testsuite/gdb.base/constvars.exp
index 1f99595..8d7bf60 100644
--- a/gdb/testsuite/gdb.base/constvars.exp
+++ b/gdb/testsuite/gdb.base/constvars.exp
@@ -59,7 +59,7 @@ get_debug_format
proc local_compiler_xfail_check { } {
if { [test_compiler_info gcc-2-*] } then {
if { ![test_debug_format "HP"] \
- && ![test_debug_format "DWARF 2"] } then {
+ && ![test_debug_format "DWARF \[0-9\]"] } then {
setup_xfail "*-*-*"
}
}
diff --git a/gdb/testsuite/gdb.base/included.exp b/gdb/testsuite/gdb.base/included.exp
index 85b39a6..0c04362 100644
--- a/gdb/testsuite/gdb.base/included.exp
+++ b/gdb/testsuite/gdb.base/included.exp
@@ -22,7 +22,7 @@ gdb_test_no_output "set listsize 1"
gdb_test "list -q main" ".*"
get_debug_format
-set non_dwarf [expr ! [test_debug_format "DWARF 2"]]
+set non_dwarf [expr ! [test_debug_format "DWARF \[0-9\]"]]
# We should be able to find the source file containing the definition,
# even though it was an included header.
diff --git a/gdb/testsuite/gdb.base/structs.exp b/gdb/testsuite/gdb.base/structs.exp
index ae847f8..0e4a7ec 100644
--- a/gdb/testsuite/gdb.base/structs.exp
+++ b/gdb/testsuite/gdb.base/structs.exp
@@ -232,8 +232,8 @@ proc test_struct_calls { n } {
set tests "call $n ${testfile}"
# Call fun${n}, checking the printed return-value.
- setup_compiler_kfails structs-tc-tll gcc-3-3-* "DWARF 2" i*86-*-* gdb/1455
- setup_compiler_kfails structs-tc-td gcc-3-3-* "DWARF 2" i*86-*-* gdb/1455
+ setup_compiler_kfails structs-tc-tll gcc-3-3-* "DWARF \[0-9\]" i*86-*-* gdb/1455
+ setup_compiler_kfails structs-tc-td gcc-3-3-* "DWARF \[0-9\]" i*86-*-* gdb/1455
gdb_test "p/c fun${n}()" "[foo ${n}]" "p/c fun<n>(); ${tests}"
# Check that GDB can always pass a structure to an inferior function.
@@ -244,8 +244,8 @@ proc test_struct_calls { n } {
# examining that global to confirm that the value is as expected.
gdb_test_no_output "call Fun${n}(foo${n})" "call Fun<n>(foo<n>); ${tests}"
- setup_compiler_kfails structs-tc-tll gcc-3-3-* "DWARF 2" i*86-*-* gdb/1455
- setup_compiler_kfails structs-tc-td gcc-3-3-* "DWARF 2" i*86-*-* gdb/1455
+ setup_compiler_kfails structs-tc-tll gcc-3-3-* "DWARF \[0-9\]" i*86-*-* gdb/1455
+ setup_compiler_kfails structs-tc-td gcc-3-3-* "DWARF \[0-9\]" i*86-*-* gdb/1455
gdb_test "p/c L${n}" [foo ${n}] "p/c L<n>; ${tests}"
}
diff --git a/gdb/testsuite/gdb.base/volatile.exp b/gdb/testsuite/gdb.base/volatile.exp
index ae70134..212ceaf 100644
--- a/gdb/testsuite/gdb.base/volatile.exp
+++ b/gdb/testsuite/gdb.base/volatile.exp
@@ -60,7 +60,7 @@ get_debug_format
proc local_compiler_xfail_check { } {
if { [test_compiler_info gcc-2-*] } then {
if { ![test_debug_format "HP"] \
- && ![test_debug_format "DWARF 2"] } then {
+ && ![test_debug_format "DWARF \[0-9\]"] } then {
setup_xfail "*-*-*"
}
}
diff --git a/gdb/testsuite/gdb.cp/class2.exp b/gdb/testsuite/gdb.cp/class2.exp
index 9dae917..92715dd 100644
--- a/gdb/testsuite/gdb.cp/class2.exp
+++ b/gdb/testsuite/gdb.cp/class2.exp
@@ -67,7 +67,7 @@ gdb_test_multiple "print * aap" "print * aap at marker return 0" {
pass "print * aap at marker return 0"
}
-re "= {.*a1 = .*}\r\n$gdb_prompt $" {
- if { [test_compiler_info gcc-2-*] && [test_debug_format "DWARF 2"] } {
+ if { [test_compiler_info gcc-2-*] && [test_debug_format "DWARF \[0-9\]"] } {
# gcc 2.95.3 -gdwarf-2
setup_kfail "gdb/1465" "*-*-*"
}
diff --git a/gdb/testsuite/gdb.cp/m-static.exp b/gdb/testsuite/gdb.cp/m-static.exp
index 1593203..98df116 100644
--- a/gdb/testsuite/gdb.cp/m-static.exp
+++ b/gdb/testsuite/gdb.cp/m-static.exp
@@ -48,7 +48,7 @@ if ![runto_main] then {
}
get_debug_format
-set non_dwarf [expr ! [test_debug_format "DWARF 2"]]
+set non_dwarf [expr ! [test_debug_format "DWARF \[0-9\]"]]
# First, run to after we've constructed all the objects:
diff --git a/gdb/testsuite/gdb.dwarf2/pr10770.exp b/gdb/testsuite/gdb.dwarf2/pr10770.exp
index 89542ff..26644a5 100644
--- a/gdb/testsuite/gdb.dwarf2/pr10770.exp
+++ b/gdb/testsuite/gdb.dwarf2/pr10770.exp
@@ -25,9 +25,9 @@ if {![runto_main]} {
return -1
}
-# This test also requires DWARF 2.
+# This test also requires DWARF.
get_debug_format
-if {![test_debug_format "DWARF 2"]} {
+if {![test_debug_format "DWARF \[0-9\]"]} {
return -1
}
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
index b145fe8..70fa2b3 100644
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -3683,8 +3683,8 @@ gdb_caching_proc skip_ifunc_tests {
# backtraces. Requires get_compiler_info and get_debug_format.
proc skip_inline_frame_tests {} {
- # GDB only recognizes inlining information in DWARF 2 (DWARF 3).
- if { ! [test_debug_format "DWARF 2"] } {
+ # GDB only recognizes inlining information in DWARF.
+ if { ! [test_debug_format "DWARF \[0-9\]"] } {
return 1
}
@@ -3702,8 +3702,8 @@ proc skip_inline_frame_tests {} {
# inlined functions. Requires get_compiler_info and get_debug_format.
proc skip_inline_var_tests {} {
- # GDB only recognizes inlining information in DWARF 2 (DWARF 3).
- if { ! [test_debug_format "DWARF 2"] } {
+ # GDB only recognizes inlining information in DWARF.
+ if { ! [test_debug_format "DWARF \[0-9\]"] } {
return 1
}