public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
* [binutils-gdb] [gdb/testsuite] Fix UNRESOLVED in gdb.server/server-kill-python.exp
@ 2020-02-11  6:08 Tom de Vries
  0 siblings, 0 replies; only message in thread
From: Tom de Vries @ 2020-02-11  6:08 UTC (permalink / raw)
  To: gdb-cvs

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=b2770d5e779088c62fd107a690dbfc94b4c89a88

commit b2770d5e779088c62fd107a690dbfc94b4c89a88
Author: Tom de Vries <tdevries@suse.de>
Date:   Tue Feb 11 07:08:33 2020 +0100

    [gdb/testsuite] Fix UNRESOLVED in gdb.server/server-kill-python.exp
    
    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.
    
    gdb/testsuite/ChangeLog:
    
    2020-02-11  Tom de Vries  <tdevries@suse.de>
    
    	PR testsuite/25488
    	* lib/gdb.exp (gdb_init): Unset $file_last_loaded.
    
    Change-Id: Ic385e08cbd34cbf85518720cf5695b4ff6619f4b

Diff:
---
 gdb/testsuite/ChangeLog   | 5 +++++
 gdb/testsuite/lib/gdb.exp | 4 ++++
 2 files changed, 9 insertions(+)

diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 20c39b1..db85782 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2020-02-11  Tom de Vries  <tdevries@suse.de>
+
+	PR testsuite/25488
+	* lib/gdb.exp (gdb_init): Unset $file_last_loaded.
+
 2020-02-10  Tom de Vries  <tdevries@suse.de>
 
 	* gdb.multi/multi-target.exp: Skip if skip_gdbserver_tests.
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
index eb1d145..d5e2295 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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-02-11  6:08 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-11  6:08 [binutils-gdb] [gdb/testsuite] Fix UNRESOLVED in gdb.server/server-kill-python.exp Tom de Vries

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).