Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Luis Machado <luis.machado@linaro.org>
To: Tom de Vries <tdevries@suse.de>, gdb-patches@sourceware.org
Subject: Re: [PING][PATCH][gdb/testsuite] Fix UNRESOLVED in gdb.server/server-kill-python.exp
Date: Mon, 10 Feb 2020 22:14:00 -0000	[thread overview]
Message-ID: <7ee6712a-8ce4-098a-c9f9-a9f241ce3673@linaro.org> (raw)
In-Reply-To: <20200210122802.GA19962@delia>

On 2/10/20 9:28 AM, Tom de Vries wrote:
> Hi,
> 
> [ Ping and ml resubmission of gerrit review item
> https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/760 . ]
> 
> The test-case gdb.server/server-kill-python.exp runs fine by itself:
> ...
> Running src/gdb/testsuite/gdb.server/server-kill-python.exp ...
> 
>                  === gdb Summary ===
> 
> nr of expected passes            3
> ...
> 
> But if we run f.i. gdb.server/file-transfer.exp before it, we get instead:
> ...
> Running src/gdb/testsuite/gdb.server/server-kill-python.exp ...
> ERROR: GDB process no longer exists
> 
>                  === gdb Summary ===
> 
> nr of expected passes            13
> nr of unresolved testcases       1
> ...
> 
> We can see the origin of the problem here:
> ...
> spawn gdbserver --once localhost:2347 \
>    build/gdb/testsuite/outputs/gdb.server/file-transfer/file-transfer \
>    build/gdb/testsuite/outputs/gdb.server/server-kill-python/server-kill-python^M
> Process build/gdb/testsuite/outputs/gdb.server/file-transfer/file-transfer
>    \ created; pid = 9464^M
> Listening on port 2347^M
> ...
> 
> The spawn of the gdbserver for the server-kill-python test-case gets as
> executable argument the file-transfer binary.
> 
> This is caused by proc gdbserver_spawn attempting to load the exec file in
> $file_last_loaded.  This is something that is meant to load the same exec in
> the gdbserver that was earlier loaded into gdb.
> 
> In this test-case however, nothing has been loaded into gdb by the test-case,
> and consequently we load the file that was loaded into gdb in the previous
> test-case.
> 
> Fix this by unsetting $file_last_loaded in gdb_init.
> 
> Build and reg-tested on x86_64-linux.
> 
> OK for trunk?
> 
> Thanks,
> - Tom
> 
> [gdb/testsuite] Fix UNRESOLVED in gdb.server/server-kill-python.exp
> 
> gdb/testsuite/ChangeLog:
> 
> 2020-01-31  Tom de Vries  <tdevries@suse.de>
> 
> 	PR testsuite/25488
> 	* lib/gdb.exp (gdb_init): Unset $file_last_loaded.
> 
> ---
>   gdb/testsuite/lib/gdb.exp | 4 ++++
>   1 file changed, 4 insertions(+)
> 
> diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
> index 2d230b791e..0a1080c34a 100644
> --- a/gdb/testsuite/lib/gdb.exp
> +++ b/gdb/testsuite/lib/gdb.exp
> @@ -5053,6 +5053,10 @@ proc gdb_init { test_file_name } {
>       set gdbserver_reconnect_p 1
>       unset gdbserver_reconnect_p
>   
> +    # Clear $last_loaded_file
> +    global last_loaded_file
> +    unset -nocomplain last_loaded_file
> +
>       # Reset GDB number of instances
>       global gdb_instances
>       set gdb_instances 0
> 

Thanks for fixing this. I ran into this a few times.

The patch LGTM.


  reply	other threads:[~2020-02-10 22:14 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-10 12:28 Tom de Vries
2020-02-10 22:14 ` Luis Machado [this message]
2020-02-11 15:00   ` Tom Tromey

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=7ee6712a-8ce4-098a-c9f9-a9f241ce3673@linaro.org \
    --to=luis.machado@linaro.org \
    --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