Throwable.printStackTrace() prints to System.err, so print
all other output to System.err as well to avoid races like
#################### info
# Tests jvmti plugin attaching during live phase.
#################### diffs
--- expected.txt 2017-01-13 18:22:13.
897224469 +0000
+++ output.txt 2017-01-30 17:51:21.
091550290 +0000
@@ -6,6 +6,6 @@
Goodbye!
Hello, world!
java.io.IOException: Process is not debuggable.
+Goodbye!
at dalvik.system.VMDebug.attachAgent(Native Method)
at Main.main(Main.java:27)
-Goodbye!
####################
Test: m test-art-host-run-test-909-attach-agent
Change-Id: I956bd24db056154b938568c156df80d4ff56ba11
public class Main {
public static void main(String[] args) {
- System.out.println("Hello, world!");
+ System.err.println("Hello, world!");
for(String a : args) {
if(a.startsWith("agent:")) {
String agent = a.substring(6);
}
}
}
- System.out.println("Goodbye!");
+ System.err.println("Goodbye!");
}
}