From: Tom de Vries <tdevries@suse.de>
To: Simon Marchi <simon.marchi@efficios.com>, gdb-patches@sourceware.org
Cc: Simon Marchi <simon.marchi@polymtl.ca>
Subject: Re: [PATCH 1/2] gdb/testsuite: make gdb_test_multiple return immediately if send_gdb fails
Date: Tue, 29 Nov 2022 17:21:27 +0100 [thread overview]
Message-ID: <31f19abf-7924-48da-e4ac-49f5c12ccccb@suse.de> (raw)
In-Reply-To: <20221122155546.599061-1-simon.marchi@efficios.com>
On 11/22/22 16:55, Simon Marchi via Gdb-patches wrote:
> From: Simon Marchi <simon.marchi@polymtl.ca>
>
> In the failure seen by Philippe here:
>
> https://inbox.sourceware.org/gdb-patches/20221120173024.3647464-1-philippe.waroquiers@skynet.be/
>
> ... the testsuite only outputs PASSes, and an ERROR, resulting from an
> uncaught exception. This is a bit sneaky, because ERRORs are not
> reported in the test summary. In certain circumstances, it can be easy
> to miss.
>
> Normally, gdb_test_multiple outputs an UNRESOLVED when GDB crashes. But > this is only if it manages to send the command, and it's that command
> that crashes GDB. Here, the ERROR is due to the fact that GDB had
> already crashed by the time we entered gdb_test_multiple and tried to
> send a command. GDB was crashed by the previous "file" command, sent by
> gdb_unload. Because gdb_unload uses bare expect, it didn't record a
> test failure when crashing GDB (this will be addressed separately).
>
> In this patch, I propose to make gdb_test_multiple call unresolved
> directly and return -1 send_gdb fails. This way, if GDB is already
> crashed by the time we enter gdb_test_multiple, it will leave a trace in
> the test results in the form of an UNRESOLVED. It will also spare us of
spare us of the -> spare us the ?
> the not-so-useful-in-my-opinion TCL backtrace.
>
Agreed.
> Before, it looks like:
>
> ERROR: Couldn't send python print(objfile.filename) to GDB.
> ERROR: : spawn id exp9 not open
> while executing
> "expect {
> -i exp9 -timeout 10
> -re ".*A problem internal to GDB has been detected" {
> fail "$message (GDB internal error)"
> gdb_internal_error..."
> ("uplevel" body line 1)
> invoked from within
> "uplevel $body" NONE : spawn id exp9 not open
>
> And after:
>
> Couldn't send python print(objfile.filename) to GDB.
> UNRESOLVED: gdb.python/py-objfile.exp: objfile.filename after objfile is unloaded
>
LGTM, thanks for doing this.
Thanks,
- Tom
> Change-Id: I72af8dc0d687826fc3f76911c27a9e5f91b677ba
> ---
> gdb/testsuite/lib/gdb.exp | 8 ++++++--
> 1 file changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
> index 7d05fbe557bb..fcd54c88f251 100644
> --- a/gdb/testsuite/lib/gdb.exp
> +++ b/gdb/testsuite/lib/gdb.exp
> @@ -1161,7 +1161,9 @@ proc gdb_test_multiple { command message args } {
> if { $foo < [expr $len - 1] } {
> set str [string range "$string" 0 $foo]
> if { [send_gdb "$str"] != "" } {
> - perror "Couldn't send $command to GDB."
> + verbose -log "Couldn't send $command to GDB."
> + unresolved $message
> + return -1
> }
> # since we're checking if each line of the multi-line
> # command are 'accepted' by GDB here,
> @@ -1180,7 +1182,9 @@ proc gdb_test_multiple { command message args } {
> }
> if { "$string" != "" } {
> if { [send_gdb "$string"] != "" } {
> - perror "Couldn't send $command to GDB."
> + verbose -log "Couldn't send $command to GDB."
> + unresolved $message
> + return -1
> }
> }
> }
next prev parent reply other threads:[~2022-11-29 16:21 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-22 15:55 Simon Marchi
2022-11-22 15:55 ` [PATCH 2/2] gdb/testsuite: make gdb_unload use gdb_test_multiple Simon Marchi
2022-11-29 16:28 ` Tom de Vries
2022-11-29 16:43 ` Simon Marchi
2022-11-23 10:59 ` [PATCH 1/2] gdb/testsuite: make gdb_test_multiple return immediately if send_gdb fails Philippe Waroquiers
2022-11-23 14:12 ` Simon Marchi
2022-11-29 16:21 ` Tom de Vries [this message]
2022-11-29 16:41 ` 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=31f19abf-7924-48da-e4ac-49f5c12ccccb@suse.de \
--to=tdevries@suse.de \
--cc=gdb-patches@sourceware.org \
--cc=simon.marchi@efficios.com \
--cc=simon.marchi@polymtl.ca \
/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).