agent/src/share/classes/sun/jvm/hotspot/HotSpotAgent.java
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File
*** old/agent/src/share/classes/sun/jvm/hotspot/HotSpotAgent.java	Thu Sep 17 16:09:26 2009
--- new/agent/src/share/classes/sun/jvm/hotspot/HotSpotAgent.java	Thu Sep 17 16:09:26 2009

*** 26,36 **** --- 26,35 ---- import java.io.PrintStream; import java.net.*; import java.rmi.*; import sun.jvm.hotspot.debugger.*; import sun.jvm.hotspot.debugger.dbx.*; import sun.jvm.hotspot.debugger.proc.*; import sun.jvm.hotspot.debugger.remote.*; import sun.jvm.hotspot.debugger.win32.*; import sun.jvm.hotspot.debugger.windbg.*; import sun.jvm.hotspot.debugger.linux.*;
*** 42,55 **** --- 41,50 ---- /** <P> This class wraps much of the basic functionality and is the * highest-level factory for VM data structures. It makes it simple * to start up the debugging system. </P> * * <P> FIXME: need to add a way to configure the paths to dbx and the * DSO from the outside. However, this should work for now for * internal use. </P> * * <P> FIXME: especially with the addition of remote debugging, this * has turned into a mess; needs rethinking. </P> */ public class HotSpotAgent {
*** 86,119 **** --- 81,91 ---- // All needed information for server side private String serverID; private String[] jvmLibNames; // FIXME: make these configurable, i.e., via a dotfile; also // consider searching within the JDK from which this Java executable // comes to find them private static final String defaultDbxPathPrefix = "/net/jano.sfbay/export/disk05/hotspot/sa"; private static final String defaultDbxSvcAgentDSOPathPrefix = "/net/jano.sfbay/export/disk05/hotspot/sa"; static void showUsage() { System.out.println(" You can also pass these -D options to java to specify where to find dbx and the \n" + " Serviceability Agent plugin for dbx:"); System.out.println(" -DdbxPathName=<path-to-dbx-executable>\n" + " Default is derived from dbxPathPrefix"); System.out.println(" or"); System.out.println(" -DdbxPathPrefix=<xxx>\n" + " where xxx is the path name of a dir structure that contains:\n" + " <os>/<arch>/bin/dbx\n" + " The default is " + defaultDbxPathPrefix); System.out.println(" and"); System.out.println(" -DdbxSvcAgentDSOPathName=<path-to-dbx-serviceability-agent-module>\n" + " Default is determined from dbxSvcAgentDSOPathPrefix"); System.out.println(" or"); System.out.println(" -DdbxSvcAgentDSOPathPrefix=<xxx>\n" + " where xxx is the pathname of a dir structure that contains:\n" + " <os>/<arch>/bin/lib/libsvc_agent_dbx.so\n" + " The default is " + defaultDbxSvcAgentDSOPathPrefix); } public HotSpotAgent() { // for non-server add shutdown hook to clean-up debugger in case // of forced exit. For remote server, shutdown hook is added by
*** 434,444 **** --- 406,415 ---- // Solaris // private void setupDebuggerSolaris() { setupJVMLibNamesSolaris(); if(System.getProperty("sun.jvm.hotspot.debugger.useProcDebugger") != null) { ProcDebuggerLocal dbg = new ProcDebuggerLocal(null, true); debugger = dbg; attachDebugger(); // Set up CPU-dependent stuff
*** 463,552 **** --- 434,445 ---- } else { throw new DebuggerException("Solaris only supported on sparc/sparcv9/x86/amd64"); } dbg.setMachineDescription(machDesc); return; } else { String dbxPathName; String dbxPathPrefix; String dbxSvcAgentDSOPathName; String dbxSvcAgentDSOPathPrefix; String[] dbxSvcAgentDSOPathNames = null; // use path names/prefixes specified on command dbxPathName = System.getProperty("dbxPathName"); if (dbxPathName == null) { dbxPathPrefix = System.getProperty("dbxPathPrefix"); if (dbxPathPrefix == null) { dbxPathPrefix = defaultDbxPathPrefix; } dbxPathName = dbxPathPrefix + fileSep + os + fileSep + cpu + fileSep + "bin" + fileSep + "dbx"; } dbxSvcAgentDSOPathName = System.getProperty("dbxSvcAgentDSOPathName"); if (dbxSvcAgentDSOPathName != null) { dbxSvcAgentDSOPathNames = new String[] { dbxSvcAgentDSOPathName } ; } else { dbxSvcAgentDSOPathPrefix = System.getProperty("dbxSvcAgentDSOPathPrefix"); if (dbxSvcAgentDSOPathPrefix == null) { dbxSvcAgentDSOPathPrefix = defaultDbxSvcAgentDSOPathPrefix; } if (cpu.equals("sparc")) { dbxSvcAgentDSOPathNames = new String[] { // FIXME: bad hack for SPARC v9. This is necessary because // there are two dbx executables on SPARC, one for v8 and one // for v9, and it isn't obvious how to tell the two apart // using the dbx command line. See // DbxDebuggerLocal.importDbxModule(). dbxSvcAgentDSOPathPrefix + fileSep + os + fileSep + cpu + "v9" + fileSep + "lib" + fileSep + "libsvc_agent_dbx.so", dbxSvcAgentDSOPathPrefix + fileSep + os + fileSep + cpu + fileSep + "lib" + fileSep + "libsvc_agent_dbx.so", }; } else { dbxSvcAgentDSOPathNames = new String[] { dbxSvcAgentDSOPathPrefix + fileSep + os + fileSep + cpu + fileSep + "lib" + fileSep + "libsvc_agent_dbx.so" }; } } // Note we do not use a cache for the local debugger in server // mode; it's taken care of on the client side DbxDebuggerLocal dbg = new DbxDebuggerLocal(null, dbxPathName, dbxSvcAgentDSOPathNames, !isServer); debugger = dbg; attachDebugger(); // Set up CPU-dependent stuff if (cpu.equals("x86")) { machDesc = new MachineDescriptionIntelX86(); } else if (cpu.equals("sparc")) { int addressSize = dbg.getRemoteProcessAddressSize(); if (addressSize == -1) { throw new DebuggerException("Error occurred while trying to determine the remote process's " + "address size. It's possible that the Serviceability Agent's dbx module failed to " + "initialize. Examine the standard output and standard error streams from the dbx " + "process for more information."); } if (addressSize == 32) { machDesc = new MachineDescriptionSPARC32Bit(); } else if (addressSize == 64) { machDesc = new MachineDescriptionSPARC64Bit(); } else { throw new DebuggerException("Address size " + addressSize + " is not supported on SPARC"); } } dbg.setMachineDescription(machDesc); } } private void connectRemoteDebugger() throws DebuggerException { RemoteDebugger remote = (RemoteDebugger) RMIHelper.lookup(debugServerID); debugger = new RemoteDebuggerClient(remote); machDesc = ((RemoteDebuggerClient) debugger).getMachineDescription();

agent/src/share/classes/sun/jvm/hotspot/HotSpotAgent.java
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File