diff options
author | Muhammad Bilal <mbilal@sourceware.org> | 2013-07-30 12:06:04 +0000 |
---|---|---|
committer | Muhammad Bilal <mbilal@sourceware.org> | 2013-07-30 12:06:04 +0000 |
commit | 97c85fc673064bcd05bbdf1dd7a76eb7a9e6a1d2 (patch) | |
tree | 1739be27b5a132b494b7299dfe177b8c07569dc7 /gdb/testsuite/gdb.base | |
parent | ff39bb5eb2356c364713b103399fec9fb07efbeb (diff) | |
download | gdb-97c85fc673064bcd05bbdf1dd7a76eb7a9e6a1d2.zip gdb-97c85fc673064bcd05bbdf1dd7a76eb7a9e6a1d2.tar.gz gdb-97c85fc673064bcd05bbdf1dd7a76eb7a9e6a1d2.tar.bz2 |
2013-07-30 Muhammad Bilal <mbilal@codesorcery.com>
PR gdb/15715
* top.c: Include "filenames.h".
(set_history_filename): New function.
(init_main): Install it as set hook of the "set history filename"
command.
2013-07-30 Muhammad Bilal <mbilal@codesourcery.com>
PR gdb/15715
* gdb.base/setshow.exp: Test that relative paths passed to
'set history filename' are converted to absolute paths.
Diffstat (limited to 'gdb/testsuite/gdb.base')
-rw-r--r-- | gdb/testsuite/gdb.base/setshow.exp | 31 |
1 files changed, 29 insertions, 2 deletions
diff --git a/gdb/testsuite/gdb.base/setshow.exp b/gdb/testsuite/gdb.base/setshow.exp index 661431c..d9e71d3 100644 --- a/gdb/testsuite/gdb.base/setshow.exp +++ b/gdb/testsuite/gdb.base/setshow.exp @@ -165,11 +165,38 @@ gdb_test_no_output "set height unlimited" gdb_test_no_output "set history expansion on" "set history expansion on" #test show history expansion on gdb_test "show history expansion on" "History expansion on command input is on.*" "show history expansion" +#get home directory path +set HOME "" +set test "show environment HOME" +gdb_test_multiple $test $test { + -re "\nHOME = (.*).\n.*" { + set HOME $expect_out(1,string) + pass $test + } +} +#test set history filename ~/foobar.baz +gdb_test_no_output "set history filename ~/foobar.baz" \ + "set history filename ~/foobar.baz" +#test show history filename ~/foobar.baz +gdb_test "show history filename" \ + "The filename in which to record the command history is \"$HOME/foobar.baz\"..*" \ + "show history filename (~/foobar.baz)" +#get current working directory +set PWD "" +set test "show working directory" +gdb_test_multiple "pwd" $test { + -re "\nWorking directory (.*)..\n.*" { + set PWD $expect_out(1,string) + pass $test + } +} #test set history filename foobar.baz gdb_test_no_output "set history filename foobar.baz" \ - "set history filename foobar.baz" + "set history filename foobar.baz" #test show history filename foobar.baz -gdb_test "show history filename" "The filename in which to record the command history is \"foobar.baz\"..*" "show history filename (foobar.baz)" +gdb_test "show history filename" \ + "The filename in which to record the command history is \"$PWD/foobar.baz\"..*" \ + "show history filename (current_directory/foobar.baz)" #test set history save on gdb_test_no_output "set history save on" "set history save on" #test show history save on |