Categories:
Audio (13)
Biotech (29)
Bytecode (36)
Database (77)
Framework (7)
Game (7)
General (507)
Graphics (53)
I/O (35)
IDE (2)
JAR Tools (102)
JavaBeans (21)
JDBC (121)
JDK (426)
JSP (20)
Logging (108)
Mail (58)
Messaging (8)
Network (84)
PDF (97)
Report (7)
Scripting (84)
Security (32)
Server (121)
Servlet (26)
SOAP (24)
Testing (54)
Web (15)
XML (322)
Collections:
Other Resources:
JDK 17 jdk.hotspot.agent.jmod - Hotspot Agent Module
JDK 17 jdk.hotspot.agent.jmod is the JMOD file for JDK 17 Hotspot Agent module.
JDK 17 Hotspot Agent module compiled class files are stored in \fyicenter\jdk-17.0.5\jmods\jdk.hotspot.agent.jmod.
JDK 17 Hotspot Agent module compiled class files are also linked and stored in the \fyicenter\jdk-17.0.5\lib\modules JImage file.
JDK 17 Hotspot Agent module source code files are stored in \fyicenter\jdk-17.0.5\lib\src.zip\jdk.hotspot.agent.
You can click and view the content of each source code file in the list below.
✍: FYIcenter
⏎ sun/jvm/hotspot/CLHSDB.java
/*
* Copyright (c) 2005, 2021, Oracle and/or its affiliates. All rights reserved.
* ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*/
package sun.jvm.hotspot;
import sun.jvm.hotspot.*;
import sun.jvm.hotspot.debugger.*;
import java.io.*;
import java.util.*;
public class CLHSDB {
public CLHSDB(JVMDebugger d) {
pid = -1;
execPath = null;
coreFilename = null;
debugServerName = null;
jvmDebugger = d;
}
public static void main(String[] args) {
new CLHSDB(args).run();
}
public void run() {
// If jvmDebugger is already set, we have been given a JVMDebugger.
// Otherwise, if pid != -1 we are supposed to attach to it.
// If execPath != null, it is the path of a jdk/bin/java
// and coreFilename is the pathname of a core file we are
// supposed to attach to.
// Finally, if debugServerName != null, we are supposed to
// connect to remote debug server.
agent = new HotSpotAgent();
Runtime.getRuntime().addShutdownHook(new java.lang.Thread() {
public void run() {
detachDebugger();
}
});
if (jvmDebugger != null) {
attachDebugger(jvmDebugger);
} else if (pid != -1) {
attachDebugger(pid);
} else if (execPath != null) {
attachDebugger(execPath, coreFilename);
} else if (debugServerName != null) {
connect(debugServerName);
}
CommandProcessor.DebuggerInterface di = new CommandProcessor.DebuggerInterface() {
public HotSpotAgent getAgent() {
return agent;
}
public boolean isAttached() {
return attached;
}
public void attach(int pid) {
attachDebugger(pid);
}
public void attach(String java, String core) {
attachDebugger(java, core);
}
public void attach(String debugServerName) {
connect(debugServerName);
}
public void detach() {
detachDebugger();
}
public void reattach() {
if (attached) {
detachDebugger();
}
if (pid != -1) {
attach(pid);
} else if (debugServerName != null) {
connect(debugServerName);
} else {
attach(execPath, coreFilename);
}
}
};
BufferedReader in =
new BufferedReader(new InputStreamReader(System.in));
CommandProcessor cp = new CommandProcessor(di, in, System.out, System.err);
cp.run(true);
}
//--------------------------------------------------------------------------------
// Internals only below this point
//
private HotSpotAgent agent;
private JVMDebugger jvmDebugger;
private boolean attached;
// These had to be made data members because they are referenced in inner classes.
private int pid;
private String execPath;
private String coreFilename;
private String debugServerName;
private void doUsage() {
System.out.println("Usage: java CLHSDB [[pid] | [path-to-java-executable [path-to-corefile]] | help ]");
System.out.println(" pid: attach to the process whose id is 'pid'");
System.out.println(" path-to-java-executable: Debug a core file produced by this program");
System.out.println(" path-to-corefile: Debug this corefile. The default is 'core'");
System.out.println(" If no arguments are specified, you can select what to do from the GUI.\n");
HotSpotAgent.showUsage();
}
private CLHSDB(String[] args) {
pid = -1;
execPath = null;
coreFilename = null;
debugServerName = null;
switch (args.length) {
case (0):
break;
case (1):
if (args[0].equals("help") || args[0].equals("-help")) {
doUsage();
return;
}
try {
// Attempt to attach as a PID
pid = Integer.parseInt(args[0]);
} catch (NumberFormatException e) {
// Attempt to connect to remote debug server
debugServerName = args[0];
}
break;
case (2):
execPath = args[0];
coreFilename = args[1];
break;
default:
System.out.println("HSDB Error: Too many options specified");
doUsage();
return;
}
}
private void attachDebugger(JVMDebugger d) {
agent.attach(d);
attached = true;
}
/** NOTE we are in a different thread here than either the main
thread or the Swing/AWT event handler thread, so we must be very
careful when creating or removing widgets */
private void attachDebugger(int pid) {
this.pid = pid;
try {
System.out.println("Attaching to process " + pid + ", please wait...");
// FIXME: display exec'd debugger's output messages during this
// lengthy call
agent.attach(pid);
attached = true;
}
catch (DebuggerException e) {
final String errMsg = formatMessage(e.getMessage(), 80);
System.err.println("Unable to connect to process ID " + pid + ":\n\n" + errMsg);
agent.detach();
e.printStackTrace();
return;
}
}
/** NOTE we are in a different thread here than either the main
thread or the Swing/AWT event handler thread, so we must be very
careful when creating or removing widgets */
private void attachDebugger(final String executablePath, final String corePath) {
// Try to open this core file
try {
System.out.println("Opening core file, please wait...");
// FIXME: display exec'd debugger's output messages during this
// lengthy call
agent.attach(executablePath, corePath);
attached = true;
}
catch (DebuggerException e) {
final String errMsg = formatMessage(e.getMessage(), 80);
System.err.println("Unable to open core file\n" + corePath + ":\n\n" + errMsg);
agent.detach();
e.printStackTrace();
return;
}
}
/** NOTE we are in a different thread here than either the main
thread or the Swing/AWT event handler thread, so we must be very
careful when creating or removing widgets */
private void connect(final String debugServerName) {
// Try to open this core file
try {
System.out.println("Connecting to debug server, please wait...");
agent.attach(debugServerName);
this.debugServerName = debugServerName;
attached = true;
}
catch (DebuggerException e) {
final String errMsg = formatMessage(e.getMessage(), 80);
System.err.println("Unable to connect to debug server \"" + debugServerName + "\":\n\n" + errMsg);
agent.detach();
e.printStackTrace();
return;
}
}
private void detachDebugger() {
if (!attached) {
return;
}
agent.detach();
attached = false;
}
private void detach() {
detachDebugger();
}
/** Punctuates the given string with \n's where necessary to not
exceed the given number of characters per line. Strips
extraneous whitespace. */
private String formatMessage(String message, int charsPerLine) {
StringBuilder buf = new StringBuilder(message.length());
StringTokenizer tokenizer = new StringTokenizer(message);
int curLineLength = 0;
while (tokenizer.hasMoreTokens()) {
String tok = tokenizer.nextToken();
if (curLineLength + tok.length() > charsPerLine) {
buf.append('\n');
curLineLength = 0;
} else {
if (curLineLength != 0) {
buf.append(' ');
++curLineLength;
}
}
buf.append(tok);
curLineLength += tok.length();
}
return buf.toString();
}
}
⏎ sun/jvm/hotspot/CLHSDB.java
Or download all of them as a single archive file:
File name: jdk.hotspot.agent-17.0.5-src.zip File size: 1238587 bytes Release date: 2022-09-13 Download
⇒ JDK 17 jdk.httpserver.jmod - HTTP Server Module
2023-10-04, ≈96🔥, 0💬
Popular Posts:
Java Cryptography Extension 1.6 JAR File Size and Download Location: File name: jce.jar, jce-1.6.jar...
JDK 17 java.management.jmod is the JMOD file for JDK 17 Management module. JDK 17 Management module ...
JDK 17 java.management.jmod is the JMOD file for JDK 17 Management module. JDK 17 Management module ...
Smack is an Open Source XMPP (Jabber) client library for instant messaging and presence. A pure Java...
How to compare performances of various XML parsers with the jaxp\SourceValidator.jav aprovided in th...