From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2205) id D5F8B3858D33; Thu, 9 Mar 2023 14:49:08 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D5F8B3858D33 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1678373348; bh=zNDNA+yMPy2A1eg14MV8qDneIMAsWQHqg1KBFyAtI94=; h=From:To:Subject:Date:From; b=RucAIjuLiiTy3mWTxI48Ij9lzZ5q/lyEnha8ZJ6NsNM+EXlal+oDWejP4s8ODAs5p fd7vAqkPNF0MmejyLBH8ph/PTFxL+8BSHMeHuiX9W9sQgsGgIB/xKVt5INWztNg+hS pVuA50wc3NHeqtQw9uJjEug3JXijnqnv9Sh6m1us= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Tom de Vries To: gdb-cvs@sourceware.org Subject: [binutils-gdb] [gdb/testsuite] Fix gdb.threads/pending-fork-event-detach.exp for remote target X-Act-Checkin: binutils-gdb X-Git-Author: Tom de Vries X-Git-Refname: refs/heads/master X-Git-Oldrev: 093b56776fcf31ecc9342382341c1455fd397b16 X-Git-Newrev: 2562954ede66f32bff7d985e752b8052c2ae5775 Message-Id: <20230309144908.D5F8B3858D33@sourceware.org> Date: Thu, 9 Mar 2023 14:49:08 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D2562954ede66= f32bff7d985e752b8052c2ae5775 commit 2562954ede66f32bff7d985e752b8052c2ae5775 Author: Tom de Vries Date: Thu Mar 9 15:49:17 2023 +0100 [gdb/testsuite] Fix gdb.threads/pending-fork-event-detach.exp for remot= e target =20 Fix test-case gdb.threads/pending-fork-event-detach.exp for target board remote-gdbserver-on-localhost using gdb_remote_download for $touch_file= _bin. =20 Then, fix the test-case for target board remote-stdio-gdbserver with REMOTE_TMPDIR=3D~/tmp.remote-stdio-gdbserver by creating $touch_file_pa= th on target using remote_download, and using the resulting path. =20 Tested on x86_64-linux. Diff: --- gdb/testsuite/gdb.threads/pending-fork-event-detach.exp | 15 +++++++++++++= +- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/gdb/testsuite/gdb.threads/pending-fork-event-detach.exp b/gdb/= testsuite/gdb.threads/pending-fork-event-detach.exp index ff90ab87429..bde513f609d 100644 --- a/gdb/testsuite/gdb.threads/pending-fork-event-detach.exp +++ b/gdb/testsuite/gdb.threads/pending-fork-event-detach.exp @@ -42,6 +42,17 @@ if { [is_remote target] } { # If the target is remote, write the file in whatever the current work= ing # directory is, with a somewhat unique name. set touch_file_path ${testfile}-flag + + # Now get the remote name, by creating the file on build and copying i= t to + # target. + remote_exec build touch $touch_file_path + set target_touch_file_path [remote_download target $touch_file_path] + + # Clean up. + remote_file build delete $touch_file_path + remote_file target delete $target_touch_file_path + + set touch_file_path $target_touch_file_path } else { set touch_file_path [standard_output_file flag] } @@ -51,11 +62,13 @@ if { [gdb_compile "$srcdir/$subdir/$srcfile2" $touch_fi= le_bin executable $opts] return } =20 +set target_touch_file_bin [gdb_remote_download target $touch_file_bin] + proc do_test { target-non-stop who_forks fork_function stop_mode } { set opts [list \ debug \ "additional_flags=3D-DFORK_FUNCTION=3D$fork_function" \ - "additional_flags=3D-DTOUCH_FILE_BIN=3D\"$::touch_file_bin\""] + "additional_flags=3D-DTOUCH_FILE_BIN=3D\"$::target_touch_file_bin\""] =20 # WHO_FORKS says which of the main or other thread calls (v)fork. The # thread that does not call (v)fork is the one who tries to step.