X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=gdb%2Ftestsuite%2Fgdb.server%2Fext-attach.exp;h=9baeeb732f941e9a6a9c69ca3c233e6b17aab93e;hb=a0eaec95753c0f093f5cb80080ef423030d35edd;hp=5f7bac48dbb32c76535e21ed3920d4ac3ff07124;hpb=31b638d39a426599109be120a9e547126397d40f;p=platform%2Fupstream%2Fgdb.git diff --git a/gdb/testsuite/gdb.server/ext-attach.exp b/gdb/testsuite/gdb.server/ext-attach.exp index 5f7bac4..9baeeb7 100644 --- a/gdb/testsuite/gdb.server/ext-attach.exp +++ b/gdb/testsuite/gdb.server/ext-attach.exp @@ -44,15 +44,7 @@ gdbserver_start_extended gdb_test_no_output "set remote exec-file $target_exec" "set remote exec-file" -# Start the program running and then wait for a bit, to be sure -# that it can be attached to. -set testpid [eval exec $binfile &] -exec sleep 2 -if { [istarget "*-*-cygwin*"] } { - # testpid is the Cygwin PID, GDB uses the Windows PID, which might be - # different due to the way fork/exec works. - set testpid [ exec ps -e | gawk "{ if (\$1 == $testpid) print \$4; }" ] -} +set testpid [spawn_wait_for_attach $binfile] gdb_test "attach $testpid" \ "Attaching to program: .*, process $testpid.*(in|at).*" \