]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
[gdb/testsuite] Fix gdb.base/infcall-nested-structs.c regression
authorTom de Vries <tdevries@suse.de>
Sat, 21 Feb 2026 21:38:30 +0000 (22:38 +0100)
committerTom de Vries <tdevries@suse.de>
Sat, 21 Feb 2026 21:38:30 +0000 (22:38 +0100)
Since commit 120072c7cdc ("gdb/testsuite: update C++ tests for volatile
changes in C++20") I see regressions in two test-cases:
...
$ ./sum.sh
   4300 gdb.base/infcall-nested-structs-c++.exp:
   2500 gdb.base/infcall-nested-structs-c.exp:
...

In more detail, in test-case gdb.base/infcall-nested-structs-c++.exp:
...
(gdb) tbreak 421^M
No compiled code for line 421 in the current file.^M
Make breakpoint pending on future shared library load? (y or [n]) n^M
(gdb) FAIL: $exp: types-tc: gdb_breakpoint: set breakpoint at 421
...

Fix this by reverting the change done by the commit, and applying the same fix
as the commit applied elsewhere:
...
-  v++;
+  v = v + 1;
...

Tested on x86_64-linux, with target boards unix and unix/-std=c++20.

Approved-By: Andrew Burgess <aburgess@redhat.com>
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=33915

gdb/testsuite/gdb.base/infcall-nested-structs.c

index 9b083f15f11c1b197c2c40b2823cafa109a8e2b8..b9512a597ab7d7cc1db71753eee27f97fbfda3e6 100644 (file)
@@ -406,10 +406,12 @@ call_all ()
   return val;
 }
 
+int volatile v = 1;
+
 void __attribute__((noinline)) ATTRIBUTE_NOCLONE
 breakpt (void)
 {
-  /* Nothing.  */
+  v = v + 1;
 }
 
 int