This is the mail archive of the gdb-cvs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[binutils-gdb] Fix fail in gdb.server/solib-list.exp


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

commit b1b53fb3ef077bf4412da53f0057b9c0e9ed4f3e
Author: Yao Qi <yao.qi@linaro.org>
Date:   Thu Jul 21 09:15:21 2016 +0100

    Fix fail in gdb.server/solib-list.exp
    
    If I run single test solib-list.exp, it is OK.  If I run two, as below,
    there are fails,
    
    $ make check RUNTESTFLAGS="server-run.exp solib-list.exp"
    FAIL: gdb.server/solib-list.exp: non-stop 0: continue (the program exited)
    FAIL: gdb.server/solib-list.exp: non-stop 0: p libvar
    FAIL: gdb.server/solib-list.exp: non-stop 1: continue (the program exited)
    FAIL: gdb.server/solib-list.exp: non-stop 1: p libvar
    
    in gdb.log,
    
    /scratch/yao/gdb/build-git/x86_64/gdb/testsuite/../../gdb/gdbserver/gdbserver --once :2347 /scratch/yao/gdb/build-git/x86_64/gdb/testsuite/outputs/gdb.server/server-run/server-run /lib64/ld-linux-x86-64.so.2 /scratch/yao/gdb/build-git/x86_64/gdb/testsuite/outputs/gdb.server/solib-list/solib-list
    
    server-run is spawned, which is wrong.  If I only run solib-list.exp, ld-linux
    is spawned, which is right.
    
    /scratch/yao/gdb/build-git/x86_64/gdb/testsuite/../../gdb/gdbserver/gdbserver --once :2346 /lib64/ld-linux-x86-64.so.2 /scratch/yao/gdb/build-git/x86_64/gdb/testsuite/outputs/gdb.server/solib-list/solib-list
    
    in test, we spawn gdbserver this way,
    
        # Note we pass ${interp_system}, the program gdbserver spawns, as
        # argument here, instead of using gdb_load, because we don't want
        # to download the interpreter to the target (it's already there)
        # or to the test output directory.
        set res [gdbserver_spawn "${interp_system} ${remote_binfile}"]
    
    in gdbserver_spawn -> gdbserver_download_current_prog, if
    last_loaded_file is set (when you run multiple tests), it is
    returned.
    
    This patch is to unset last_loaded_file in solib-list.exp.
    
    gdb/testsuite:
    
    2016-07-21  Yao Qi  <yao.qi@linaro.org>
    
    	* gdb.server/solib-list.exp: Unset last_loaded_file.

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

diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index e7d935e..bc0d25a 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,7 @@
+2016-07-21  Yao Qi  <yao.qi@linaro.org>
+
+	* gdb.server/solib-list.exp: Unset last_loaded_file.
+
 2016-07-20  Jan Kratochvil  <jan.kratochvil@redhat.com>
 
 	* gdb.gdb/selftest.exp (do_steps_and_nexts): Add "next over TRY" and
diff --git a/gdb/testsuite/gdb.server/solib-list.exp b/gdb/testsuite/gdb.server/solib-list.exp
index 5347f18..57647e1 100644
--- a/gdb/testsuite/gdb.server/solib-list.exp
+++ b/gdb/testsuite/gdb.server/solib-list.exp
@@ -71,6 +71,11 @@ foreach nonstop { 0 1 } { with_test_prefix "non-stop $nonstop" {
     # displaced-stepping buffer at unmapped that time address _start.
     gdb_test "set displaced-stepping off"
 
+    # Unset last_loaded_file because we want GDBserver spawn
+    # ${interp_system} not ${last_loaded_file}.
+    global last_loaded_file
+    unset -nocomplain last_loaded_file
+
     # Note we pass ${interp_system}, the program gdbserver spawns, as
     # argument here, instead of using gdb_load, because we don't want
     # to download the interpreter to the target (it's already there)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]