[PATCH 2/2] [gdb/testsuite] Fix gdb.base/msym-lang.exp on ppc64-linux
Tom de Vries <[email protected]> Sun, 2 Aug 2026 11:34:21 +0200
| Newsgroups | gmane.comp.gdb.patches |
|---|---|
| Message-ID | <[email protected]> |
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.
---
gdb/testsuite/gdb.base/msym-lang.exp | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/gdb/testsuite/gdb.base/msym-lang.exp b/gdb/testsuite/gdb.base/msym-lang.exp
index d0beddea417..38521e4ebf7 100644
--- a/gdb/testsuite/gdb.base/msym-lang.exp
+++ b/gdb/testsuite/gdb.base/msym-lang.exp
@@ -20,4 +20,11 @@ if {[prepare_for_testing "failed to prepare" $testfile [list $srcfile $srcfile2]
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"]
--
2.51.0