Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: simon.marchi@polymtl.ca
To: gdb-patches@sourceware.org
Cc: Simon Marchi <simon.marchi@polymtl.ca>
Subject: [PATCH 5/7] gdb/testsuite: make pie-execl.exp work with native-gdbserver
Date: Wed,  6 May 2026 16:27:53 -0400	[thread overview]
Message-ID: <20260506202804.1681886-6-simon.marchi@polymtl.ca> (raw)
In-Reply-To: <20260506202804.1681886-1-simon.marchi@polymtl.ca>

From: Simon Marchi <simon.marchi@polymtl.ca>

This test passes the path of an executable to execute as argv[1] to the
inferior.  This test is currently skipped with remote targets (e.g.
native-gdbserver), because it previously wasn't possible to pass
arguments to inferiors on such targets in the testsuite.  Remove that
check, and use the new -inferior-args runto option to pass the args to
the inferior.

Add

  require {!target_info exists noargs}

to reflect that the test relies on inferior args.

Change-Id: If3b884421b453d6ca93c19ca13314bbb7869218c
---
 gdb/testsuite/gdb.base/pie-execl.exp | 14 ++------------
 1 file changed, 2 insertions(+), 12 deletions(-)

diff --git a/gdb/testsuite/gdb.base/pie-execl.exp b/gdb/testsuite/gdb.base/pie-execl.exp
index 60d2270f8873..da75b47c23a4 100644
--- a/gdb/testsuite/gdb.base/pie-execl.exp
+++ b/gdb/testsuite/gdb.base/pie-execl.exp
@@ -20,21 +20,13 @@ global inferior_spawn_id
 global gdb_spawn_id
 
 require {istarget *-linux*}
-
-# In remote mode we cannot use the 'set args' command, and this
-# test requires it.
-if {[target_info exists gdb_protocol]} {
-    if {[target_info gdb_protocol] == "remote"} {
-	return
-    }
-}
+require {!target_info exists noargs}
 
 standard_testfile .c
 set executable1 ${testfile}1
 set executable2 ${testfile}2
 set binfile1 ${binfile}1
 set binfile2 ${binfile}2
-set binfile2_test_msg OBJDIR/${subdir}/${executable2}
 
 # Use conditional compilation according to `BIN' as GDB remembers the source
 # file name of the breakpoint.
@@ -47,9 +39,7 @@ if {[build_executable ${testfile}.exp $executable1 $srcfile [concat $opts {addit
 
 clean_restart ${executable1}
 
-gdb_test_no_output "set args ${binfile2}" "set args ${binfile2_test_msg}"
-
-if {![runto_main]} {
+if {![runto_main -inferior-args $binfile2]} {
     return -1
 }
 
-- 
2.54.0


  parent reply	other threads:[~2026-05-06 20:37 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-06 20:27 [PATCH 0/7] gdb/testsuite: allow passing inferior arguments with native-gdbserver board simon.marchi
2026-05-06 20:27 ` [PATCH 1/7] gdb/testsuite: remove unused arguments to gdb_breakpoint simon.marchi
2026-05-06 20:27 ` [PATCH 2/7] gdb/testsuite: make gdb_breakpoint, runto and runto_main use parse_args simon.marchi
2026-05-06 20:27 ` [PATCH 3/7] gdb/testsuite: add -inferior-args option to runto simon.marchi
2026-05-12 13:02   ` Aktemur, Baris
2026-06-19 19:29     ` Simon Marchi
2026-06-19 19:54       ` Simon Marchi
2026-05-06 20:27 ` [PATCH 4/7] gdb/testsuite: fix step-over-thread-exit.exp with native-gdbserver simon.marchi
2026-05-12 13:06   ` Aktemur, Baris
2026-06-19 19:31     ` Simon Marchi
2026-05-06 20:27 ` simon.marchi [this message]
2026-05-06 20:27 ` [PATCH 6/7] gdb/testsuite: use -inferior-args in gdb.base/gcore-buffer-overflow.exp simon.marchi
2026-05-06 20:27 ` [PATCH 7/7] gdb/testsuite: fix gdb.rocm/code-object-load-while-breakpoint-hit.exp with native-gdbserver simon.marchi
2026-05-12 13:18 ` [PATCH 0/7] gdb/testsuite: allow passing inferior arguments with native-gdbserver board Aktemur, Baris
2026-06-15  9:54   ` Aktemur, Baris
2026-06-19 20:09     ` Simon Marchi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260506202804.1681886-6-simon.marchi@polymtl.ca \
    --to=simon.marchi@polymtl.ca \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox