From 5c78aef60cb49014bdc4881a6b7e3d1d4525aa26 Mon Sep 17 00:00:00 2001 From: Tom de Vries Date: Mon, 3 Aug 2026 10:20:04 +0200 Subject: [PATCH] [gdb/testsuite] Fix gdb.base/msym-lang.exp on ppc64-linux 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 --- 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.47.3