Fix fail in gdb.server/solib-list.exp

Message ID 86k2gn6zk4.fsf@gmail.com
State New, archived
Headers

Commit Message

Yao Qi July 15, 2016, 9:06 a.m. UTC
  Yao Qi <qiyaoltc@gmail.com> writes:

> +    # Unset last_loaded_file because we want GDBserver spawn
> +    # ${interp_system} not ${last_loaded_file}.
> +    global last_loaded_file
> +    if { [info exists last_loaded_file] } {
> +	unset last_loaded_file
> +    }

Keith told me that I can use "-nocomplain" to avoid "info exists".
Patch is updated below,
  

Comments

Yao Qi July 21, 2016, 8:19 a.m. UTC | #1
On Fri, Jul 15, 2016 at 10:06 AM, Yao Qi <qiyaoltc@gmail.com> wrote:
> Yao Qi <qiyaoltc@gmail.com> writes:
>
> gdb/testsuite:
>
> 2016-07-14  Yao Qi  <yao.qi@linaro.org>
>
>         * gdb.server/solib-list.exp: Unset last_loaded_file.

I pushed it in.
  

Patch

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)