From: Simon Marchi <simark@simark.ca>
To: Tom Tromey <tromey@adacore.com>, gdb-patches@sourceware.org
Subject: Re: [PATCH] Fix test suite failure in file-then-restart.exp
Date: Wed, 11 Oct 2023 14:48:33 -0400 [thread overview]
Message-ID: <215fcfeb-3e93-4eec-baa0-0a2b0b326ce5@simark.ca> (raw)
In-Reply-To: <69137e71-b2d6-4505-a563-599c6eeead91@simark.ca>
On 10/11/23 14:19, Simon Marchi wrote:
> On 10/11/23 12:21, Tom Tromey wrote:
>> Simon pointed out that the new file-then-restart.exp test fails with
>> the extended-remote target board.
>>
>> The problem is that the test suite doesn't use gdb_file_cmd -- which
>> handles things like "set remote exec-file". This patch changes
>> gdb_file_cmd to make the "kill" command optional, and then switches
>> the test case to use it.
>>
>> Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=30933
>
> Thanks, I will give the patch a try.
>
>> diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
>> index 0a908e0af0f..63885860795 100644
>> --- a/gdb/testsuite/lib/gdb.exp
>> +++ b/gdb/testsuite/lib/gdb.exp
>> @@ -2146,6 +2146,9 @@ proc default_gdb_exit {} {
>> # Load a file into the debugger.
>> # The return value is 0 for success, -1 for failure.
>> #
>> +# ARG is the file name.
>> +# KILL_FLAG, if given, indicates whether a "kill" command should be used.
>> +#
>> # This procedure also set the global variable GDB_FILE_CMD_DEBUG_INFO
>> # to one of these values:
>> #
>> @@ -2165,7 +2168,7 @@ proc default_gdb_exit {} {
>> # TODO: gdb.base/sepdebug.exp and gdb.stabs/weird.exp might be able to use
>> # this if they can get more information set.
>>
>> -proc gdb_file_cmd { arg } {
>> +proc gdb_file_cmd { arg {kill_flag 1} } {
>> global gdb_prompt
>> global GDB
>> global last_loaded_file
>> @@ -2194,15 +2197,17 @@ proc gdb_file_cmd { arg } {
>> # The file command used to kill the remote target. For the benefit
>> # of the testsuite, preserve this behavior. Mark as optional so it doesn't
>> # get written to the stdin log.
>
> Wow, I didn't know about (or forgot) this behavior of gdb_file_cmd.
> This seems like a relic of the past. I wonder how important that kill
> is, if we can get rid of it. I would expect gdb_file_cmd to more or
> less just issue the "file" command.
I confirm that your patch fixes the fail I see on my CI. If we want to
get rid of the kill behavior in gdb_file_cmd, your patch is a good step
towards that, as it adds a knob for it. So it LGTM:
Approved-By: Simon Marchi <simon.marchi@efficios.com>
Simon
prev parent reply other threads:[~2023-10-11 18:48 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-11 16:21 Tom Tromey
2023-10-11 18:19 ` Simon Marchi
2023-10-11 18:48 ` Simon Marchi [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=215fcfeb-3e93-4eec-baa0-0a2b0b326ce5@simark.ca \
--to=simark@simark.ca \
--cc=gdb-patches@sourceware.org \
--cc=tromey@adacore.com \
/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