[gdb/testsuite] Fix gdb.dwarf2/dw2-gas-workaround.exp
authorTom de Vries <tdevries@suse.de>
Mon, 6 Nov 2023 07:32:54 +0000 (08:32 +0100)
committerTom de Vries <tdevries@suse.de>
Mon, 6 Nov 2023 07:32:54 +0000 (08:32 +0100)
Recently added test-case gdb.dwarf2/dw2-gas-workaround.exp:
- passes when gdb is configured using $(cd ../src; pwd)/configure, but
- fails when using ../src/configure.

Fix this by making the matching more precise:
...
-    -re -wrap "$objdir.*" {
+    -re -wrap "name_for_id = $objdir/$srcfile\r\n.*" {
...
such that we only fail on the line:
...
[symtab-create] start_subfile: name = dw2-lines.c, name_for_id = \
  /data/vries/gdb/leap-15-4/build/gdb/testsuite/dw2-lines.c^M
...

Reported-By: Carl Love <cel@us.ibm.com>
gdb/testsuite/gdb.dwarf2/dw2-gas-workaround.exp

index ca2b10f23b3814b1cb226ac4aa6f402e88c8224a..7d5375a920a1405918e7ea19ea7ef11bc4f0b279 100644 (file)
@@ -83,7 +83,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} \
 
 gdb_test_no_output "set debug symtab-create 1"
 gdb_test_multiple "ptype bar" "" {
-    -re -wrap "$objdir.*" {
+    -re -wrap "name_for_id = $objdir/$srcfile\r\n.*" {
        fail $gdb_test_name
     }
     -re -wrap "" {