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

Simon Marchi via Gdb-cvs <[email protected]> Fri, 19 Jun 2026 20:09:28 +0000 (GMT)
Newsgroups gmane.comp.gdb.cvs
Message-ID <[email protected]>
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=28bf846ca77b1d6529e8771115963dc9878a8b82

commit 28bf846ca77b1d6529e8771115963dc9878a8b82
Author: Simon Marchi <[email protected]>
Date:   Wed May 6 16:27:54 2026 -0400

    gdb/testsuite: use -inferior-args in gdb.base/gcore-buffer-overflow.exp
    
    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
    Reviewed-By: Tankut Baris Aktemur <[email protected]>

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

diff --git a/gdb/testsuite/gdb.base/gcore-buffer-overflow.exp b/gdb/testsuite/gdb.base/gcore-buffer-overflow.exp
index ad9bd89226d..f5e35e5d5f7 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
 }