Skip to content
Snippets Groups Projects
Commit 2562954e authored by Tom de Vries's avatar Tom de Vries
Browse files

[gdb/testsuite] Fix gdb.threads/pending-fork-event-detach.exp for remote target

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.

Then, fix the test-case for target board remote-stdio-gdbserver with
REMOTE_TMPDIR=~/tmp.remote-stdio-gdbserver by creating $touch_file_path
on target using remote_download, and using the resulting path.

Tested on x86_64-linux.
parent 093b5677
No related branches found
No related tags found
No related merge requests found
...@@ -42,6 +42,17 @@ if { [is_remote target] } { ...@@ -42,6 +42,17 @@ if { [is_remote target] } {
# If the target is remote, write the file in whatever the current working # If the target is remote, write the file in whatever the current working
# directory is, with a somewhat unique name. # directory is, with a somewhat unique name.
set touch_file_path ${testfile}-flag set touch_file_path ${testfile}-flag
# Now get the remote name, by creating the file on build and copying it 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 { } else {
set touch_file_path [standard_output_file flag] set touch_file_path [standard_output_file flag]
} }
...@@ -51,11 +62,13 @@ if { [gdb_compile "$srcdir/$subdir/$srcfile2" $touch_file_bin executable $opts] ...@@ -51,11 +62,13 @@ if { [gdb_compile "$srcdir/$subdir/$srcfile2" $touch_file_bin executable $opts]
return return
} }
set target_touch_file_bin [gdb_remote_download target $touch_file_bin]
proc do_test { target-non-stop who_forks fork_function stop_mode } { proc do_test { target-non-stop who_forks fork_function stop_mode } {
set opts [list \ set opts [list \
debug \ debug \
"additional_flags=-DFORK_FUNCTION=$fork_function" \ "additional_flags=-DFORK_FUNCTION=$fork_function" \
"additional_flags=-DTOUCH_FILE_BIN=\"$::touch_file_bin\""] "additional_flags=-DTOUCH_FILE_BIN=\"$::target_touch_file_bin\""]
# WHO_FORKS says which of the main or other thread calls (v)fork. The # 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. # thread that does not call (v)fork is the one who tries to step.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment