"info source after setting directory search list"
}
+proc test_change_search_directory_with_empty_dirname {} {
+ gdb_start
+
+ # Add 3 entries to the source directories list:
+ # - ""
+ # - "/foo"
+ # - "/bar"
+ # Since /foo and /bar probably do not exist, ignore the warnings printed by
+ # GDB.
+ if { [ishost *-*-mingw*] } {
+ gdb_test "set directories ;/foo;/bar" ".*"
+ } else {
+ gdb_test "set directories :/foo:/bar" ".*"
+ }
+
+ # The first entry added ("") should be ignored, only /foo and /bar are
+ # effectively added.
+ with_test_prefix "initial_directory_state" {
+ gdb_test "show directories" \
+ [search_dir_list [list \
+ "/foo" \
+ "/bar" \
+ "\\\$cdir" \
+ "\\\$cwd"]]
+ }
+
+ # Arguments can be quoted. Check a empty string has the same effect as
+ # 'set directory' (i.e. reset to $cdir:$cwd)
+ gdb_test_no_output "set directories \"\""
+
+ with_test_prefix "directory_after_reset" {
+ gdb_test "show directories" \
+ [search_dir_list [list \
+ "\\\$cdir" \
+ "\\\$cwd"]]
+ }
+
+ gdb_exit
+}
+
test_changing_search_directory
+test_change_search_directory_with_empty_dirname
test_truncated_comp_dir