Skip to content

Commit 8635642

Browse files
committed
8338469: com/sun/jdi/DataDumpTest.java failed with Not a debuggee, or not listening for debugger to attach
Reviewed-by: dcubed
1 parent 961e944 commit 8635642

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

test/jdk/com/sun/jdi/DataDumpTest.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,11 @@ private static void runTest(String jdwpArg) throws Exception {
8484
try {
8585
p = pb.start();
8686
InputStream is = p.getInputStream();
87+
88+
// Read the first character of output to make sure we've waited until the
89+
// debuggee is ready. This will be the debug agent's "Listening..." message.
90+
char firstChar = (char)is.read();
91+
8792
out = new OutputAnalyzer(p);
8893

8994
// Attach a debugger and do the data dump. The data dump output will appear
@@ -92,8 +97,8 @@ private static void runTest(String jdwpArg) throws Exception {
9297

9398
out.waitFor(); // Wait for the debuggee to exit
9499

95-
System.out.println("Deuggee output:");
96-
System.out.println(out.getOutput());
100+
System.out.println("Debuggee output:");
101+
System.out.println(firstChar + out.getOutput());
97102

98103
// All these strings are part of the debug agent data dump output.
99104
out.shouldHaveExitValue(0);

0 commit comments

Comments
 (0)