Disable parts of gdb.base/source-dir.exp on remote host
authorSandra Loosemore <sandra@codesourcery.com>
Mon, 22 Jun 2020 17:10:02 +0000 (10:10 -0700)
committerSandra Loosemore <sandra@codesourcery.com>
Mon, 22 Jun 2020 17:10:02 +0000 (10:10 -0700)
One set of tests in this file does a lot of complicated directory
manipulations to force a specific DW_AT_comp_dir format and gdb
directory search path.  As it's written, everything assumes host ==
build, and it does not seem to me that there is any obvious way to
rewrite this so it will work in general on remote host.  For instance,
our harness for testing on remote Windows host normally does all
compilation and GDB execution in $cwd using relative pathnames and I'm
not sure all these directory tricks would set up the scenario it's
trying to test even if they were correctly performed on host rather
than build.  So I think it's reasonable just to disable this on remote
host instead.

I also noted that it's using the wrong search path syntax for Windows
host in the "set directories" command and conditionalized that while I
was looking at it.  That's a necessary fix to make this work in a
situation where host == build and it's Windows, but I'm not actually
set up to test that it's sufficient, too.

2020-06-22  Sandra Loosemore  <sandra@codesourcery.com>

gdb/testsuite/
* gdb.base/source-dir.exp (test_truncated_comp_dir): Skip on
remote host.  Fix search path syntax on Windows host.

gdb/testsuite/ChangeLog
gdb/testsuite/gdb.base/source-dir.exp

index 5d64783df5dbfd0c5ac70ff88c1773d9ba05dee6..1d3c764de05476b4bcd38c9ca21c7a8861650704 100644 (file)
@@ -1,3 +1,8 @@
+2020-06-22  Sandra Loosemore  <sandra@codesourcery.com>
+
+       * gdb.base/source-dir.exp (test_truncated_comp_dir): Skip on
+       remote host.  Fix search path syntax on Windows host.
+
 2020-06-21  Philippe Waroquiers  <philippe.waroquiers@skynet.be>
 
        * gdb.base/attach.exp: Test priority of 'exec-file' changed
index 8f70352dcca26dcd419a6e3de79a62f49701e804..093dda7b9232eeadf5b98068d437f7fdb1bad084 100644 (file)
@@ -81,6 +81,12 @@ proc test_truncated_comp_dir {} {
     # find the source file no matter what we added to the directory
     # search path, this should now be fixed.
 
+    # All of these pathname and directory manipulations assume
+    # host == build, so do not attempt this set of tests on remote host.
+    if [is_remote host] {
+        return
+    }
+
     set original_dir [pwd]
     set working_dir [standard_output_file ""]
     cd ${working_dir}
@@ -108,7 +114,11 @@ proc test_truncated_comp_dir {} {
 
     clean_restart ${binfile}
 
-    gdb_test_no_output "set directories \$cdir:\$cwd"
+    if { [ishost *-*-mingw*] } {
+        gdb_test_no_output "set directories \$cdir;\$cwd"
+    } else {
+       gdb_test_no_output "set directories \$cdir:\$cwd"
+    }
     gdb_test "show directories" \
        "\r\nSource directories searched: \\\$cdir\[:;\]\\\$cwd"
 
This page took 0.033351 seconds and 4 git commands to generate.