]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
[gdb/testsuite] Fix gdb.python/py-objfile.exp with gcc 15
authorTom de Vries <tdevries@suse.de>
Tue, 29 Apr 2025 15:30:07 +0000 (17:30 +0200)
committerTom de Vries <tdevries@suse.de>
Tue, 29 Apr 2025 15:30:07 +0000 (17:30 +0200)
commit112608984f830faab22815b69d74ad60ae2af8e9
tree71a705661a951b4d1dea7fcda210d8d9f194afc7
parenta6af579207d45bcd92c5388f9d59030b4ef9beae
[gdb/testsuite] Fix gdb.python/py-objfile.exp with gcc 15

When running test-case gdb.python/py-objfile.exp with gcc 15, we get:
...
(gdb) p main^M
$2 = {int (void)} 0x40066c <main>^M
(gdb) FAIL: $exp: print main with debug info
...

The source file declares main as "int main ()"
...
and until C23 this meant a non-prototype function declaration and we'd have:
...
(gdb) p main^M
$2 = {int ()} 0x40066c <main>^M
...

However, starting C23 "int main ()" is simply equivalent to "int main (void)".

Fix this by:
- declaring main as "int main (void)" in the test-case, and
- updating the regexp to expect an "int (void)" prototype.

Likewise in gdb.base/jit-bfd-name.exp.

Tested on aarch64-linux.

Approved-By: Tom Tromey <tom@tromey.com>
PR testsuite/32756
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=32756
gdb/testsuite/gdb.base/jit-bfd-name.exp
gdb/testsuite/gdb.base/jit-elf-solib.c
gdb/testsuite/gdb.python/py-objfile.c
gdb/testsuite/gdb.python/py-objfile.exp