[obvious,committed] gdb/testsuite: Fix gdb.base/list-missing-source.exp on remote host.

Message ID 96e77abd-c711-6583-2b5e-f5a3b949c3e1@codesourcery.com
State New
Headers show
Series
  • [obvious,committed] gdb/testsuite: Fix gdb.base/list-missing-source.exp on remote host.
Related show

Commit Message

Sandra Loosemore June 21, 2020, 12:32 a.m.
This test case tries to create a source file, compile it, and then 
delete it before starting GDB.  Unfortunately it was doing the file 
creation and deletion operations on build rather than host.  Fixing this 
was straightforward, so I have gone ahead and committed this patch.

-Sandra

Patch

commit 4d91c2a4677b90802c8d369190927921bf8ee97d
Author: Sandra Loosemore <sandra@codesourcery.com>
Date:   Sat Jun 20 17:23:53 2020 -0700

    Fix gdb.base/list-missing-source.exp on remote host.
    
    2020-06-20  Sandra Loosemore  <sandra@codesourcery.com>
    
    	gdb/testsuite/
    	* gdb.base/list-missing-source.exp: Correct $srcfile manipulation
    	for remote host.

diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 36662f9..5ae3ffa 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,8 @@ 
+2020-06-20  Sandra Loosemore  <sandra@codesourcery.com>
+
+	* gdb.base/list-missing-source.exp: Correct $srcfile manipulation
+	for remote host.
+
 2020-06-19  Sandra Loosemore  <sandra@codesourcery.com>
 	    Hafiz Abid Qadeer  <abidh@codesourcery.com>
 
diff --git a/gdb/testsuite/gdb.base/list-missing-source.exp b/gdb/testsuite/gdb.base/list-missing-source.exp
index e64f42c..72d3922 100644
--- a/gdb/testsuite/gdb.base/list-missing-source.exp
+++ b/gdb/testsuite/gdb.base/list-missing-source.exp
@@ -29,6 +29,7 @@  main ()
 }
 }
 close $fd
+set srcfile [remote_download host $srcfile]
 
 # Compile the source file.
 set options "debug"
@@ -39,7 +40,7 @@  if  { [gdb_compile "${srcfile}" "${binfile}" \
 }
 
 # Now delete the source file.
-file delete $srcfile
+remote_file host delete $srcfile
 
 # Now start GDB, run to main and try to list the source.
 clean_restart ${binfile}