[gdb/testsuite] Fix unset of DEBUGINFOD_URLS in default_gdb_init
authorTom de Vries <tdevries@suse.de>
Thu, 1 Apr 2021 06:24:13 +0000 (08:24 +0200)
committerTom de Vries <tdevries@suse.de>
Thu, 1 Apr 2021 06:24:13 +0000 (08:24 +0200)
In commit cfcbd506fb0 "[gdb/testsuite] Ignore DEBUGINFOD_URLS" I added
unsetting of env(DEBUGINFOD_URLS), but it doesn't work because I forgot to
add :: in front.

Fix this, and rewrite using "unset -nocomplain" instead of unsetenv, which
allows us to drop the "info exists" test.

2021-04-01  Tom de Vries  <tdevries@suse.de>

* lib/gdb.exp (default_gdb_init): Use ::env.  Use unset
-nocomplain ::env(V) instead of unsetenv V.

gdb/testsuite/lib/gdb.exp

index 3cdc39dc81979646419de8f5c9e5779004530702..943112fcc808eebaf5fc511265bf58692357fea2 100644 (file)
@@ -5272,9 +5272,7 @@ proc default_gdb_init { test_file_name } {
 
     # If DEBUGINFOD_URLS is set, gdb will try to download sources and
     # debug info for f.i. system libraries.  Prevent this.
-    if { [info exists env(DEBUGINFOD_URLS)] } {
-       unsetenv DEBUGINFOD_URLS
-    }
+    unset -nocomplain ::env(DEBUGINFOD_URLS)
 
     # Ensure that GDBHISTFILE and GDBHISTSIZE are removed from the
     # environment, we don't want these modifications to the history
This page took 0.031212 seconds and 4 git commands to generate.