From: Corinna Vinschen <vinschen@redhat.com>
To: gdb-patches@sourceware.org
Subject: [RFA/testsuite]: Don't exit when `target sim' fails
Date: Wed, 25 Apr 2007 11:23:00 -0000 [thread overview]
Message-ID: <20070425101024.GG4270@calimero.vinschen.de> (raw)
Hi,
Newer GCC linkers unlink the output file before trying to open it. This
results in a sharing violation under Cygwin/Windows if the file is still
in use by GDB, as in the gdb.base/chng-syms.exp testcase. As a result,
the `target sim' command prints an error message that the executable
can't be opened by GDB.
Unfortunately, the gdb_target_sim function in config/sim.exp reacts in a
very unfriendly way when `target sim' fails: It just exits instead of
returning with an error code. In turn, the testrun exits entirely, and
one instance of GDB keeps potentially running, because the testcase has
no chance to clean up properly.
Another situation in which the exit is very annoying is, when running the
testsuite on remote harware over a not-always-reliable connection. If
`target sim' fails once, the whole testsuite exits instead of just skipping
this one testcase.
The below patch changes gdb_target_sim to return with -1 instead of
just exiting. This allows the testsuite to run further along, instead
of just exiting.
Ok to apply?
Corinna
* config/sim.exp (gdb_target_sim): Just return with -1 when setting
target sim fails. Return 0 otherwise.
(gdb_load): Return prematurely if gdb_target_sim fails.
Index: config/sim.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/config/sim.exp,v
retrieving revision 1.4
diff -u -p -r1.4 sim.exp
--- config/sim.exp 9 Jan 2007 17:59:08 -0000 1.4
+++ config/sim.exp 25 Apr 2007 10:09:18 -0000
@@ -23,7 +23,6 @@ load_lib gdb.exp
#
proc gdb_target_sim { } {
global gdb_prompt
- global exit_status
set target_sim_options "[board_info target gdb,target_sim_options]";
@@ -37,11 +36,12 @@ proc gdb_target_sim { } {
timeout {
perror "Couldn't set target for simulator."
cleanup
- exit $exit_status
+ return -1
}
}
set timeout 10
verbose "Timeout is now $timeout seconds" 2
+ return 0
}
#
@@ -59,7 +59,7 @@ proc gdb_load { arg } {
if [gdb_file_cmd $arg] then { return -1 }
}
- gdb_target_sim
+ if [gdb_target_sim] then { return -1 }
send_gdb "load\n"
set timeout 2400
--
Corinna Vinschen
Cygwin Project Co-Leader
Red Hat
next reply other threads:[~2007-04-25 10:10 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-04-25 11:23 Corinna Vinschen [this message]
2007-04-25 11:39 ` Daniel Jacobowitz
2007-04-25 16:01 ` Corinna Vinschen
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=20070425101024.GG4270@calimero.vinschen.de \
--to=vinschen@redhat.com \
--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