]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
[gdb/testsuite] Fix gdb.base/msym-lang.exp on ppc64-linux master
authorTom de Vries <tdevries@suse.de>
Mon, 3 Aug 2026 08:20:04 +0000 (10:20 +0200)
committerTom de Vries <tdevries@suse.de>
Mon, 3 Aug 2026 08:20:04 +0000 (10:20 +0200)
On x86_64-linux, with test-case gdb.base/msym-lang.exp we get:
...
(gdb) info func foo
All functions matching regular expression "foo":

Non-debugging symbols:
0x0000000000401116  foo()
0x000000000040112c  foo()
(gdb) PASS: $exp: info func foo
...

But on ppc64-linux, we get:
...
(gdb) info func foo
All functions matching regular expression "foo":

Non-debugging symbols:
0x0000000000000914  .foo()
0x0000000000000974  .foo()
(gdb) FAIL: $exp: info func foo
...

The dot prefix is due to the function descriptors used in the PPC v1 ABI.

Fix this by allowing the dot prefix.

Tested on x86_64-linux and ppc64-linux.

Approved-By: Kevin Buettner <kevinb@redhat.com>
gdb/testsuite/gdb.base/msym-lang.exp

index d0beddea417592b451127ca767b7b4ec76de77a7..38521e4ebf70644a321cbeafb198c3da545e8594 100644 (file)
@@ -20,4 +20,11 @@ if {[prepare_for_testing "failed to prepare" $testfile [list $srcfile $srcfile2]
     return
 }
 
     return
 }
 
-gdb_test "info func foo" ".* foo\\(\\).* foo\\(\\).*"
+# The optional leading dot is for ppc64 v1 ABI function descriptors.
+set re_foo [quotemeta {@/[.]?/foo()}]
+
+gdb_test "info func foo" \
+    [multi_line \
+        "Non-debugging symbols:" \
+        "$hex  $re_foo" \
+        "$hex  $re_foo"]