diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 3c9f20cbbd..2ecc1e0558 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,10 @@ +2016-04-08 Pedro Alves + + * gdb.server/solib-list.exp: Don't use gdb_load. Instead pass the + interpreter filename as argument to gdbserver_spawn. + * lib/gdbserver-support.exp (gdbserver_download_current_prog): + Return empty if $last_loaded_file does not exist. + 2016-04-08 Jan Kratochvil Fix compatibility with gcc-4.8.5-4.el7.x86_64. diff --git a/gdb/testsuite/gdb.server/solib-list.exp b/gdb/testsuite/gdb.server/solib-list.exp index fcd6d25ead..9d5cdcc9d8 100644 --- a/gdb/testsuite/gdb.server/solib-list.exp +++ b/gdb/testsuite/gdb.server/solib-list.exp @@ -57,7 +57,6 @@ foreach nonstop { 0 1 } { with_test_prefix "non-stop $nonstop" { gdb_exit gdb_start gdb_reinitialize_dir $srcdir/$subdir - gdb_load ${interp_system} gdb_load_shlibs ${binfile} gdb_load_shlibs ${binlibfile} @@ -72,8 +71,12 @@ foreach nonstop { 0 1 } { with_test_prefix "non-stop $nonstop" { # But GDB having symbols from the main executable it would try to use # displaced-stepping buffer at unmapped that time address _start. gdb_test "set displaced-stepping off" - - set res [gdbserver_spawn ${binfile}] + + # 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} ${binfile}"] set gdbserver_protocol [lindex $res 0] set gdbserver_gdbport [lindex $res 1] diff --git a/gdb/testsuite/lib/gdbserver-support.exp b/gdb/testsuite/lib/gdbserver-support.exp index 67a83336f9..951afe5afb 100644 --- a/gdb/testsuite/lib/gdbserver-support.exp +++ b/gdb/testsuite/lib/gdbserver-support.exp @@ -155,6 +155,10 @@ proc gdbserver_download_current_prog { } { global gdbserver_server_exec global last_loaded_file + if { ![info exists last_loaded_file] } { + return "" + } + set host_exec $last_loaded_file # If we already downloaded a file to the target, see if we can reuse it.