public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Bernd Edlinger <bernd.edlinger@hotmail.de>
To: Tom de Vries <tdevries@suse.de>,
	"gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Subject: Re: [PATCH] Fix random dejagnu test abort with simulator target
Date: Fri, 19 Apr 2024 22:21:37 +0200	[thread overview]
Message-ID: <AS8P193MB1285A614FBDFAE2172836A20E40D2@AS8P193MB1285.EURP193.PROD.OUTLOOK.COM> (raw)
In-Reply-To: <52bbb92c-5bf1-4c1f-a89c-6de46be82dd5@suse.de>

On 4/19/24 18:30, Tom de Vries wrote:
> 
> OK, I see now.
> 
> We spawn gdb on host to spawn sleep on target.
> 
> So I get to:
> ...
> # The test-case relies on "run" from the command line, so it only works
> # with "target native", so we need host == target.
> #
> # The test-case uses "exp_pid -i $gdb_spawn_id" which doesn't work with
> # remote host, so we need build == host.
> #
> # In other words, we need build == host == target.
> require {!is_remote host} {!is_remote target}
> 
> # Check that we have "target native" as opposed to native-gdbserver etc.
> require {string equal [target_info gdb_protocol] ""}
> ...
> 
> Having said that, I'm not sure if that addresses your problem, since I don't have experience with simulator setups.
> 
> Perhaps "require isnative" is also necessary for simulators?  That proc seems to check for target triplet == build triplet, while I think we're more interested in target triplet == host triplet, but it may be a sufficient proxy.
> 

hmm...

[target_info is_simulator] is explicitly set for simulators.
see /usr/share/dejagnu/baseboards/basic-sim.exp:
set_board_info is_simulator 1

I use RUNTESTFLAGS="--target_board=multi-sim"

I tried your suggested change, and it worked for me:
--- a/gdb/testsuite/gdb.base/sigwinch-notty.exp
+++ b/gdb/testsuite/gdb.base/sigwinch-notty.exp
@@ -19,11 +19,17 @@
 
 require {!target_info exists gdb,nosignals}
 
-# The testfile relies on "run" from the command line, so only works
-# with "target native".
-if { [target_info gdb_protocol] != "" || [target_info is_simulator] != ""} {
-    return
-}
+# The test-case relies on "run" from the command line, so it only works
+# with "target native", so we need host == target.
+#
+# The test-case uses "exp_pid -i $gdb_spawn_id" which doesn't work with
+# remote host, so we need build == host.
+#
+# In other words, we need build == host == target.
+require {!is_remote host} {!is_remote target}
+
+# Check that we have "target native" as opposed to native-gdbserver etc.
+require {string equal [target_info gdb_protocol] ""}
 
 gdb_exit
 

Running /home/ed/gnu/binutils-build-riscv-1/gdb/testsuite/../../../binutils-gdb/gdb/testsuite/gdb.base/sigwinch-notty.exp ...
Executing on build: rm -rf /home/ed/gnu/binutils-build-riscv-1/gdb/testsuite/outputs/gdb.base/sigwinch-notty    (timeout = 300)
builtin_spawn -ignore SIGHUP rm -rf /home/ed/gnu/binutils-build-riscv-1/gdb/testsuite/outputs/gdb.base/sigwinch-notty^M
UNSUPPORTED: gdb.base/sigwinch-notty.exp: require failed: !is_remote target
testcase /home/ed/gnu/binutils-build-riscv-1/gdb/testsuite/../../../binutils-gdb/gdb/testsuite/gdb.base/sigwinch-notty.exp completed in 0 seconds

so that would be acceptable.


Thanks
Bernd.

      reply	other threads:[~2024-04-19 20:19 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-19 10:49 Bernd Edlinger
2024-04-19 13:26 ` Tom de Vries
2024-04-19 14:19   ` Bernd Edlinger
2024-04-19 16:30     ` Tom de Vries
2024-04-19 20:21       ` Bernd Edlinger [this message]

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=AS8P193MB1285A614FBDFAE2172836A20E40D2@AS8P193MB1285.EURP193.PROD.OUTLOOK.COM \
    --to=bernd.edlinger@hotmail.de \
    --cc=gdb-patches@sourceware.org \
    --cc=tdevries@suse.de \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).