SHA256
8
0
forked from pool/gdb
Files
gdb/gdb-testsuite-fix-gdb.python-py-objfile.exp-with-gcc.patch
Tom de Vries 0e155d6874 - Simplify outdated comment in gdb.spec.
- Update to fedora rawhide @ 0481d32.
  Maintenance script import-fedora.sh:
  * Skip gdb-fix-bg-execution-repeat.patch.
- Add MIT in License tag due to gdbsupport/unordered_dense.h.
- Update to fedora rawhide @ 89e3933.
  Maintenance script import-fedora.sh:
  * Drop gdb-6.8-bz466901-backtrace-full-prelinked.patch from
    skip_patches.
- Update to fedora rawhide @ 660c52f.
  Drop patches:
  * gdb-rhbz1149205-catch-syscall-after-fork-test.patch
- Update to fedora rawhide @ 885cdf8.
  Update patches:
  * gdb-add-rpm-suggestion-script.patch
  Drop patches:
  * fixup-gdb-add-rpm-suggestion-script.patch
- Update to fedora rawhide @ 9c718a5.
  Drop patches:
  * gdb-6.3-mapping-zero-inode-test.patch
- Update to fedora rawhide @ 15778f3.
  Drop patches:
  * gdb-archer-next-over-throw-cxx-exec.patch
- Update to fedora rawhide @ 152468c.
  Maintenance script import-fedora.sh:
  * Rename gdb-6.3-rh-testversion-20041202.patch to
    gdb-test-show-version.patch in skip_patches.
  Patches dropped (Renamed to ...):
  * gdb-add-rpm-suggestion-script.patch
  Patches added (... this):
  * gdb-rpm-suggestion-script.patch
- Move some patches from "Backport from gdb-patches" to
  "Backports from master, available in GDB 17".
- Add patches (swo#33000):
  * gdb-tdep-fix-gdb.ada-finish-var-size.exp-on-ppc64le-.patch
- Add patches (swo#32409):
  * gdb-ada-fix-gdb.ada-overloads.exp-on-s390x.patch
- Add patches:
  * gdb-testsuite-make-gdb.reverse-time-reverse.exp-more.patch
  * gdb-testsuite-fix-gdb.reverse-time-reverse.exp-timeo.patch
  * gdb-testsuite-handle-asm-frame-in-gdb.python-py-miss.patch
  * gdb-testsuite-fix-gdb.base-ptype.exp-with-gcc-15.patch
  * gdb-testsuite-fix-gdb.python-py-objfile.exp-with-gcc.patch
  * gdb-testsuite-fix-gdb.ada-scalar_storage.exp-on-s390.patch
  * gdb-testsuite-fix-gdb.base-bp-permanent.exp-with-gcc.patch
  * gdb-testsuite-don-t-run-to-main-in-gdb.cp-cplusfuncs.patch

OBS-URL: https://build.opensuse.org/package/show/devel:gcc/gdb?expand=0&rev=465
2025-06-05 13:03:19 +00:00

102 lines
3.5 KiB
Diff

From bb86ddf7c6827ec9b467cc0107395f91b9cbc5d2 Mon Sep 17 00:00:00 2001
From: Tom de Vries <tdevries@suse.de>
Date: Tue, 29 Apr 2025 17:30:07 +0200
Subject: [PATCH 6/6] [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 | 6 ++++--
gdb/testsuite/gdb.base/jit-elf-solib.c | 2 +-
gdb/testsuite/gdb.python/py-objfile.c | 2 +-
gdb/testsuite/gdb.python/py-objfile.exp | 3 ++-
4 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/gdb/testsuite/gdb.base/jit-bfd-name.exp b/gdb/testsuite/gdb.base/jit-bfd-name.exp
index 36c82a10d41..cd6fa046f0d 100644
--- a/gdb/testsuite/gdb.base/jit-bfd-name.exp
+++ b/gdb/testsuite/gdb.base/jit-bfd-name.exp
@@ -67,11 +67,13 @@ gdb_breakpoint [gdb_get_line_number "break here 1" $::main_srcfile]
gdb_continue_to_breakpoint "break here 1"
# Confirm that the two expected functions are available.
+set re_f1 [string_to_regexp "int jit_function_0001(void)"]
+set re_f2 [string_to_regexp "int jit_function_0002(void)"]
gdb_test "info function ^jit_function" \
[multi_line \
"File \[^\r\n\]+jit-elf-solib.c:" \
- "${decimal}:\\s+int jit_function_0001\\(\\);" \
- "${decimal}:\\s+int jit_function_0002\\(\\);"]
+ "${decimal}:\\s+$re_f1;" \
+ "${decimal}:\\s+$re_f2;"]
# Capture the addresses of each JIT symfile.
set symfile_addrs {}
diff --git a/gdb/testsuite/gdb.base/jit-elf-solib.c b/gdb/testsuite/gdb.base/jit-elf-solib.c
index f98d1d1f740..5cf960688ae 100644
--- a/gdb/testsuite/gdb.base/jit-elf-solib.c
+++ b/gdb/testsuite/gdb.base/jit-elf-solib.c
@@ -22,4 +22,4 @@
#error "Must define the FUNCTION_NAME macro to set a jited function name"
#endif
-int FUNCTION_NAME() { return 42; }
+int FUNCTION_NAME(void) { return 42; }
diff --git a/gdb/testsuite/gdb.python/py-objfile.c b/gdb/testsuite/gdb.python/py-objfile.c
index 1c38ff9bc0b..1bf776fb809 100644
--- a/gdb/testsuite/gdb.python/py-objfile.c
+++ b/gdb/testsuite/gdb.python/py-objfile.c
@@ -19,7 +19,7 @@ int global_var = 42;
static int __attribute__ ((used)) static_var = 50;
int
-main ()
+main (void)
{
int some_var = 0;
return 0;
diff --git a/gdb/testsuite/gdb.python/py-objfile.exp b/gdb/testsuite/gdb.python/py-objfile.exp
index 2f5b7752b43..4fcad2666df 100644
--- a/gdb/testsuite/gdb.python/py-objfile.exp
+++ b/gdb/testsuite/gdb.python/py-objfile.exp
@@ -144,7 +144,8 @@ gdb_test "python print (sep_objfile.owner.filename)" "${testfile}2" \
gdb_test "python print (sep_objfile.owner.username)" "${testfile}2" \
"Test user-name of owner of separate debug file"
-gdb_test "p main" "= {int \\(\\)} $hex <main>" \
+set re_prototype [string_to_regexp "int (void)"]
+gdb_test "p main" "= {$re_prototype} $hex <main>" \
"print main with debug info"
# Separate debug files are not findable.
--
2.43.0