test/com/sun/jdi/ProcessAttachTest.sh
Print this page
*** 68,78 ****
esac
startDebuggee()
{
OUTPUTFILE=${TESTCLASSES}/Debuggee.out
! ${JAVA} "$@" > ${OUTPUTFILE} &
startpid="$!"
pid="${startpid}"
# CYGWIN startpid is not the native windows PID we want, get the WINPID
if [ "${OS}" = "CYGWIN" ]; then
--- 68,78 ----
esac
startDebuggee()
{
OUTPUTFILE=${TESTCLASSES}/Debuggee.out
! ${JAVA} ${TESTVMOPTS} ${TESTJAVAOPTS} "$@" > ${OUTPUTFILE} &
startpid="$!"
pid="${startpid}"
# CYGWIN startpid is not the native windows PID we want, get the WINPID
if [ "${OS}" = "CYGWIN" ]; then
*** 105,115 ****
echo "Debuggee is process $pid (startpid=${startpid})"
}
stopDebuggee()
{
! $JAVA -classpath "${TESTCLASSES}" ShutdownDebuggee $1
if [ $? != 0 ] ; then
echo "Error: ShutdownDebuggee failed"
failures=`expr $failures + 1`
kill -9 ${startpid}
fi
--- 105,115 ----
echo "Debuggee is process $pid (startpid=${startpid})"
}
stopDebuggee()
{
! $JAVA ${TESTVMOPTS} ${TESTJAVAOPTS} -classpath "${TESTCLASSES}" ShutdownDebuggee $1
if [ $? != 0 ] ; then
echo "Error: ShutdownDebuggee failed"
failures=`expr $failures + 1`
kill -9 ${startpid}
fi
*** 132,142 ****
startDebuggee \
$DEBUGGEEFLAGS \
-agentlib:jdwp=transport=dt_socket,server=y,suspend=n \
-classpath "${TESTCLASSES}" ProcessAttachDebuggee "${PORTFILE}"
! $JAVA -classpath "${TESTCLASSES}${PS}${TESTJAVA}/lib/tools.jar" \
ProcessAttachDebugger $pid 2>&1
if [ $? != 0 ]; then failures=`expr $failures + 1`; fi
# Note that when the debugger disconnects, the debuggee picks another
# port and outputs another 'Listening for transport ... ' msg.
--- 132,142 ----
startDebuggee \
$DEBUGGEEFLAGS \
-agentlib:jdwp=transport=dt_socket,server=y,suspend=n \
-classpath "${TESTCLASSES}" ProcessAttachDebuggee "${PORTFILE}"
! $JAVA ${TESTVMOPTS} ${TESTJAVAOPTS} -classpath "${TESTCLASSES}${PS}${TESTJAVA}/lib/tools.jar" \
ProcessAttachDebugger $pid 2>&1
if [ $? != 0 ]; then failures=`expr $failures + 1`; fi
# Note that when the debugger disconnects, the debuggee picks another
# port and outputs another 'Listening for transport ... ' msg.
*** 150,160 ****
startDebuggee \
$DEBUGGEEFLAGS \
-agentlib:jdwp=transport=dt_socket,server=y,suspend=y \
-classpath "${TESTCLASSES}" ProcessAttachDebuggee "${PORTFILE}"
! $JAVA -classpath "${TESTCLASSES}${PS}${TESTJAVA}/lib/tools.jar" \
ProcessAttachDebugger $pid 2>&1
# The debuggee is suspended and doesn't run until the debugger
# disconnects. We have to give it time to write the port number
# to ${PORTFILE}
--- 150,160 ----
startDebuggee \
$DEBUGGEEFLAGS \
-agentlib:jdwp=transport=dt_socket,server=y,suspend=y \
-classpath "${TESTCLASSES}" ProcessAttachDebuggee "${PORTFILE}"
! $JAVA ${TESTVMOPTS} ${TESTJAVAOPTS} -classpath "${TESTCLASSES}${PS}${TESTJAVA}/lib/tools.jar" \
ProcessAttachDebugger $pid 2>&1
# The debuggee is suspended and doesn't run until the debugger
# disconnects. We have to give it time to write the port number
# to ${PORTFILE}