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_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"]