[gdb/testsuite] Fix gdb.dwarf2/enqueued-cu-base-addr.exp with cc-with-gnu-debuglink
authorTom de Vries <tdevries@suse.de>
Thu, 10 Aug 2023 13:46:30 +0000 (15:46 +0200)
committerTom de Vries <tdevries@suse.de>
Thu, 10 Aug 2023 13:46:30 +0000 (15:46 +0200)
When running test-case gdb.dwarf2/enqueued-cu-base-addr.exp with target board
cc-with-gnu-debuglink, I run into:
...
(gdb) PASS: gdb.dwarf2/enqueued-cu-base-addr.exp: ptype foo
maint print symbols -objfile enqueued-cu-base-addr^M
(gdb) FAIL: gdb.dwarf2/enqueued-cu-base-addr.exp: CU addr found
...

The problem is that the CU we're trying to print is in objfile
enqueued-cu-base-addr.debug instead of enqueued-cu-base-addr.

Fix this by replacing "-objfile enqueued-cu-base-addr" with "-source cu2".

Tested on x86_64-linux.

gdb/testsuite/gdb.dwarf2/enqueued-cu-base-addr.exp

index 9b2d1d87362a8dcb26a89b51626fa05ecf23d6b9..c44cfd1a81be0c574324b755de1997e16294920c 100644 (file)
@@ -97,7 +97,7 @@ set cu2_blockvector_re \
         "" \
         "block #000, \[^\r\n\]* in ($hex)..$hex" \
         ".*"]
-gdb_test_multiple "maint print symbols -objfile $testfile" "CU addr found" {
+gdb_test_multiple "maint print symbols -source cu2" "CU addr found" {
     -re -wrap $cu2_blockvector_re {
        set addr $expect_out(1,string)
        if { $addr eq "0x0" } {