publicstaticvoid main(String[] args) { if (!new JITDebug().parseArgs(args)) { thrownew RuntimeException("Unexpected command line arguments: "
+ args);
}
}
boolean parseArgs(String[] args) { switch (args.length) { case0:
testLaunch(); returntrue; case1: if (args[0].equals("TARGET")) {
debugTarget(); returntrue;
} else { returnfalse;
} case3: if (args[0].equals("DEBUGGER")) { // launched by using "-agentlib:" "launch" sub-option: // The following strings are appended to the string given in this argument (space-delimited). // They can aid the launched debugger in establishing a connection with this VM. // The resulting string is executed. // - The value of the transport sub-option. // - The value of the address sub-option (or the generated address if one is not given)
trivialDebugger(args[1], args[2]); returntrue;
} else { returnfalse;
} default: returnfalse;
}
}
void doAttach(String connectorName, AttachingConnector conn, String transportAddress) {
Map<String, Connector.Argument> connArgs = conn.defaultArguments(); if ("com.sun.jdi.SharedMemoryAttach".equals(connectorName)) {
Connector.Argument portArg = (Connector.Argument)connArgs.get("name");
portArg.setValue(transportAddress);
} else {
Connector.Argument portArg = (Connector.Argument)connArgs.get("port");
portArg.setValue(transportAddress);
} try {
VirtualMachine vm = conn.attach(connArgs);
System.out.println("attached to: " + transportAddress);
vm.exit(0); // we are happy - terminate VM with no error
System.out.println("we are happy - terminated VM with no error");
} catch (Exception exc) {
System.err.flush();
System.err.println("Exception: " + exc + " - hanging");
System.err.flush();
hang();
}
}
/** Hang so that test fails */ void hang() { try { // ten minute nap Thread.sleep(10 * 60 * 1000);
} catch (InterruptedException exc) { // shouldn't happen
}
}
}
Messung V0.5 in Prozent
¤ Diese beiden folgenden Angebotsgruppen bietet das Unternehmen0.14Angebot
(Wie Sie bei der Firma Beratungs- und Dienstleistungen beauftragen können 2026-06-10)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.