[6/7] gdb/testsuite: use -inferior-args in gdb.base/gcore-buffer-overflow.exp

Message ID 20260506202804.1681886-7-simon.marchi@polymtl.ca
State New
Headers
Series gdb/testsuite: allow passing inferior arguments with native-gdbserver board |

Commit Message

Simon Marchi May 6, 2026, 8:27 p.m. UTC
  From: Simon Marchi <simon.marchi@polymtl.ca>

This test passes arguments to the inferior using "set args".  This
doesn't work under the native-gdbserver board.  It doesn't appear to
cause a failure though, because the test only verifies that a core dump
is successfully saved, which happens even if the test fails to pass the
argument to the test program.

Nevertheless, use the new -inferior-args option, that feels more
correct.

Change-Id: I8ef5b57d84b1b0c5b35d2636c4331a37bc159661
---
 gdb/testsuite/gdb.base/gcore-buffer-overflow.exp | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
  

Patch

diff --git a/gdb/testsuite/gdb.base/gcore-buffer-overflow.exp b/gdb/testsuite/gdb.base/gcore-buffer-overflow.exp
index 3dcc4f00d0a6..f922cc5a4a61 100644
--- a/gdb/testsuite/gdb.base/gcore-buffer-overflow.exp
+++ b/gdb/testsuite/gdb.base/gcore-buffer-overflow.exp
@@ -28,10 +28,7 @@  if { [prepare_for_testing "prepare" $filename $srcfile] != 0 } {
     return
 }
 
-gdb_test_no_output "set args ${pattern}"	\
-    "set buffer exceeding arguments"
-
-if {![runto_main]} {
+if {![runto_main -inferior-args $pattern]} {
     return -1
 }