aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.base/environ.exp
diff options
context:
space:
mode:
authorSergio Durigan Junior <sergiodj@redhat.com>2017-08-15 13:49:18 -0400
committerSergio Durigan Junior <sergiodj@redhat.com>2017-08-15 13:49:18 -0400
commit206726fbfdd521fbb184daedb71b85030453bf0b (patch)
treef9a53185e79ea333158cf97e907d824e4716565a /gdb/testsuite/gdb.base/environ.exp
parent0335ac6d12906bfb4b48410d8a7229c21c727cf2 (diff)
downloadgdb-206726fbfdd521fbb184daedb71b85030453bf0b.zip
gdb-206726fbfdd521fbb184daedb71b85030453bf0b.tar.gz
gdb-206726fbfdd521fbb184daedb71b85030453bf0b.tar.bz2
Fix PR gdb/21954: make 'unset environment' work again
When I made commit 9a6c7d9c021cfeb290d76584db7a01e57e7c3d4e, which C++-fied gdb/common/environ.[ch], I mistakenly altered the behaviour of the 'unset environment' command. This command, which should delete all environment variables, is now resetting the list of variables to the state they were when GDB was started. This commit fixes this regression, and also adds a test on gdb.base/environ.exp which really checks if 'unset environment' worked. gdb/ChangeLog: 2017-08-15 Sergio Durigan Junior <sergiodj@redhat.com> PR gdb/21954 * infcmd.c (unset_environment_command): Use the 'clear' method on the environment instead of resetting it. gdb/testsuite/ChangeLog: 2017-08-15 Sergio Durigan Junior <sergiodj@redhat.com> PR gdb/21954 * gdb.base/environ.exp: Add test to check if 'unset environment' works.
Diffstat (limited to 'gdb/testsuite/gdb.base/environ.exp')
-rw-r--r--gdb/testsuite/gdb.base/environ.exp3
1 files changed, 3 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.base/environ.exp b/gdb/testsuite/gdb.base/environ.exp
index 0b69a80..bb52063 100644
--- a/gdb/testsuite/gdb.base/environ.exp
+++ b/gdb/testsuite/gdb.base/environ.exp
@@ -46,6 +46,9 @@ gdb_test "unset environment" "" "unset all environment variables" \
"Delete all environment variables. .y or n. $" \
"y"
+gdb_test_no_output "show environment" \
+ "all environment variables have been unset"
+
# Verify that we can set a specific environment variable.
test_set_show_env_var "EDITOR" "emacs" "set environment variable"