]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
gdb: fix gdb.opt/empty-inline-cxx.exp on ppc64le
authorAndrew Burgess <aburgess@redhat.com>
Wed, 11 Feb 2026 10:25:35 +0000 (11:25 +0100)
committerAndrew Burgess <aburgess@redhat.com>
Wed, 11 Feb 2026 10:37:58 +0000 (10:37 +0000)
Fix the gdb.opt/empty-inline-cxx.exp test for ppc64le targets.  This
test has been failing since it was introduced in commit:

  commit 196349e7e5939c2bef11fd93f098401d5b7111a5
  Date:   Fri Sep 20 13:56:27 2024 +0100

      gdb: handle empty ranges for inline subroutines

The failure looks like this:

  (gdb) bt
  #0  0x00000001000008d4 in main () at /tmp/build/gdb/testsuite/../../../src/gdb/testsuite/gdb.opt/empty-inline-cxx.cc:63
  (gdb) FAIL: gdb.opt/empty-inline-cxx.exp: opt_level=Og: backtrace in main

This is almost correct, except the test is not expecting the
"0x00000001000008d4 in" part.  This first backtrace is done
immediately after the 'runto_main' call so the fact that we're not
stopped exactly at the start of line 63 is a little strange, but isn't
a critical part of this test.  As such I've updated the test pattern
to accept an optional address within the backtrace.

This failure was brought to my attention in this mailing list post:

  https://inbox.sourceware.org/gdb-patches/7fd2cc58-33ab-420a-83ba-e98cae69b028@linux.ibm.com

The test should now pass on ppc64le, and continue to pass on other
targets.

gdb/testsuite/gdb.opt/empty-inline-cxx.exp

index 60fa4c777b8708cae81250abb5b91d264b7ad2cc..4b9eec7760e581b25e13841c76d742a750eb4a0f 100644 (file)
@@ -67,7 +67,7 @@ proc run_test { opt_level } {
        return
     }
 
-    gdb_test "bt" "#0\\s+main \\(\\) at [remote_file_re $::srcfile]:$::decimal" \
+    gdb_test "bt" "#0\\s+(?:$::hex in )?main \\(\\) at [remote_file_re $::srcfile]:$::decimal" \
        "backtrace in main"
 
     # Break at the empty inline function ptr::get_myclass.