public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] [gdb/testsuite] Fix copy-to-remote in gdb.base/vfork-follow-parent.exp
@ 2023-08-17  8:21 Tom de Vries
  2023-08-17  8:23 ` Tom de Vries
  2023-08-17 13:47 ` Andrew Burgess
  0 siblings, 2 replies; 3+ messages in thread
From: Tom de Vries @ 2023-08-17  8:21 UTC (permalink / raw)
  To: gdb-patches

When running test-case gdb.base/vfork-follow-parent.exp, I run into:
...
ERROR: tcl error sourcing gdb/testsuite/gdb.base/vfork-follow-parent.exp.
ERROR: error copying "vforked-prog": no such file or directory
    while executing
"file copy -force $fromfile $tofile"
    (procedure "gdb_remote_download" line 29)
    invoked from within
"gdb_remote_download target $binfile3"
...

Fix this by:
- making the copy-to-remote conditional on is_remote target, and
- allowing gdb_remote_download to find $binfile3 by using
  standard_output_file.

Also remove unused variable remote_exec_prog.

Tested on x86_64-linux.
---
 gdb/testsuite/gdb.base/vfork-follow-parent.exp | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/gdb/testsuite/gdb.base/vfork-follow-parent.exp b/gdb/testsuite/gdb.base/vfork-follow-parent.exp
index 70b54e729a5..a29706f58c5 100644
--- a/gdb/testsuite/gdb.base/vfork-follow-parent.exp
+++ b/gdb/testsuite/gdb.base/vfork-follow-parent.exp
@@ -30,7 +30,9 @@ if { [build_executable "compile $binfile3" $binfile3 $srcfile2] } {
     return -1
 }
 
-set remote_exec_prog [gdb_remote_download target $binfile3]
+if { [is_remote target] } {
+    gdb_remote_download target [standard_output_file $binfile3]
+}
 
 set opts [list debug additional_flags=-DTEST_EXIT]
 if { [build_executable "compile ${binfile}" ${binfile} ${srcfile} ${opts}] } {

base-commit: 3afe50fe1974f9a13326a31696f5a93371ed00b7
-- 
2.35.3


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] [gdb/testsuite] Fix copy-to-remote in gdb.base/vfork-follow-parent.exp
  2023-08-17  8:21 [PATCH] [gdb/testsuite] Fix copy-to-remote in gdb.base/vfork-follow-parent.exp Tom de Vries
@ 2023-08-17  8:23 ` Tom de Vries
  2023-08-17 13:47 ` Andrew Burgess
  1 sibling, 0 replies; 3+ messages in thread
From: Tom de Vries @ 2023-08-17  8:23 UTC (permalink / raw)
  To: gdb-patches

On 8/17/23 10:21, Tom de Vries via Gdb-patches wrote:
> When running test-case gdb.base/vfork-follow-parent.exp, I run into:
> ...
> ERROR: tcl error sourcing gdb/testsuite/gdb.base/vfork-follow-parent.exp.
> ERROR: error copying "vforked-prog": no such file or directory
>      while executing
> "file copy -force $fromfile $tofile"
>      (procedure "gdb_remote_download" line 29)
>      invoked from within
> "gdb_remote_download target $binfile3"
> ...
> 
> Fix this by:
> - making the copy-to-remote conditional on is_remote target, and
> - allowing gdb_remote_download to find $binfile3 by using
>    standard_output_file.
> 
> Also remove unused variable remote_exec_prog.
> 

Sorry, forgot to mention: pushed.

Thanks,
- Tom

> Tested on x86_64-linux.
> ---
>   gdb/testsuite/gdb.base/vfork-follow-parent.exp | 4 +++-
>   1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/gdb/testsuite/gdb.base/vfork-follow-parent.exp b/gdb/testsuite/gdb.base/vfork-follow-parent.exp
> index 70b54e729a5..a29706f58c5 100644
> --- a/gdb/testsuite/gdb.base/vfork-follow-parent.exp
> +++ b/gdb/testsuite/gdb.base/vfork-follow-parent.exp
> @@ -30,7 +30,9 @@ if { [build_executable "compile $binfile3" $binfile3 $srcfile2] } {
>       return -1
>   }
>   
> -set remote_exec_prog [gdb_remote_download target $binfile3]
> +if { [is_remote target] } {
> +    gdb_remote_download target [standard_output_file $binfile3]
> +}
>   
>   set opts [list debug additional_flags=-DTEST_EXIT]
>   if { [build_executable "compile ${binfile}" ${binfile} ${srcfile} ${opts}] } {
> 
> base-commit: 3afe50fe1974f9a13326a31696f5a93371ed00b7


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] [gdb/testsuite] Fix copy-to-remote in gdb.base/vfork-follow-parent.exp
  2023-08-17  8:21 [PATCH] [gdb/testsuite] Fix copy-to-remote in gdb.base/vfork-follow-parent.exp Tom de Vries
  2023-08-17  8:23 ` Tom de Vries
@ 2023-08-17 13:47 ` Andrew Burgess
  1 sibling, 0 replies; 3+ messages in thread
From: Andrew Burgess @ 2023-08-17 13:47 UTC (permalink / raw)
  To: Tom de Vries, gdb-patches

Tom de Vries via Gdb-patches <gdb-patches@sourceware.org> writes:

> When running test-case gdb.base/vfork-follow-parent.exp, I run into:
> ...
> ERROR: tcl error sourcing gdb/testsuite/gdb.base/vfork-follow-parent.exp.
> ERROR: error copying "vforked-prog": no such file or directory
>     while executing
> "file copy -force $fromfile $tofile"
>     (procedure "gdb_remote_download" line 29)
>     invoked from within
> "gdb_remote_download target $binfile3"
> ...

I'd love to know how I managed to have this passing.  I guess I must
have manged to get a vforked-prog binary in the wrong directory somehow.

>
> Fix this by:
> - making the copy-to-remote conditional on is_remote target, and
> - allowing gdb_remote_download to find $binfile3 by using
>   standard_output_file.
>
> Also remove unused variable remote_exec_prog.
>
> Tested on x86_64-linux.
> ---
>  gdb/testsuite/gdb.base/vfork-follow-parent.exp | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/gdb/testsuite/gdb.base/vfork-follow-parent.exp b/gdb/testsuite/gdb.base/vfork-follow-parent.exp
> index 70b54e729a5..a29706f58c5 100644
> --- a/gdb/testsuite/gdb.base/vfork-follow-parent.exp
> +++ b/gdb/testsuite/gdb.base/vfork-follow-parent.exp
> @@ -30,7 +30,9 @@ if { [build_executable "compile $binfile3" $binfile3 $srcfile2] } {
>      return -1
>  }
>  
> -set remote_exec_prog [gdb_remote_download target $binfile3]
> +if { [is_remote target] } {
> +    gdb_remote_download target [standard_output_file $binfile3]
> +}

The is_remote check is unnecessary.  It's the addition of
standard_output_file that fixes the problem.

The gdb_remote_download proc already has an is_remote check, and if not
remote it just copies the file to the standard_output_file directory.
Which, in this case, is where the file started, so is a no-op.

Thanks for fixing this.

Andrew



>  
>  set opts [list debug additional_flags=-DTEST_EXIT]
>  if { [build_executable "compile ${binfile}" ${binfile} ${srcfile} ${opts}] } {
>
> base-commit: 3afe50fe1974f9a13326a31696f5a93371ed00b7
> -- 
> 2.35.3


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-08-17 13:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-17  8:21 [PATCH] [gdb/testsuite] Fix copy-to-remote in gdb.base/vfork-follow-parent.exp Tom de Vries
2023-08-17  8:23 ` Tom de Vries
2023-08-17 13:47 ` Andrew Burgess

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).