< prev index next >

src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/HotSpotAgent.java

Print this page

 19  *
 20  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
 21  * or visit www.oracle.com if you need additional information or have any
 22  * questions.
 23  *
 24  */
 25 
 26 package sun.jvm.hotspot;
 27 
 28 import java.rmi.RemoteException;
 29 import java.lang.reflect.Constructor;
 30 import java.lang.reflect.InvocationTargetException;
 31 
 32 import sun.jvm.hotspot.debugger.Debugger;
 33 import sun.jvm.hotspot.debugger.DebuggerException;
 34 import sun.jvm.hotspot.debugger.JVMDebugger;
 35 import sun.jvm.hotspot.debugger.MachineDescription;
 36 import sun.jvm.hotspot.debugger.MachineDescriptionAMD64;
 37 import sun.jvm.hotspot.debugger.MachineDescriptionPPC64;
 38 import sun.jvm.hotspot.debugger.MachineDescriptionAArch64;

 39 import sun.jvm.hotspot.debugger.MachineDescriptionIntelX86;
 40 import sun.jvm.hotspot.debugger.NoSuchSymbolException;
 41 import sun.jvm.hotspot.debugger.bsd.BsdDebuggerLocal;
 42 import sun.jvm.hotspot.debugger.linux.LinuxDebuggerLocal;
 43 import sun.jvm.hotspot.debugger.remote.RemoteDebugger;
 44 import sun.jvm.hotspot.debugger.remote.RemoteDebuggerClient;
 45 import sun.jvm.hotspot.debugger.remote.RemoteDebuggerServer;
 46 import sun.jvm.hotspot.debugger.windbg.WindbgDebuggerLocal;
 47 import sun.jvm.hotspot.runtime.VM;
 48 import sun.jvm.hotspot.types.TypeDataBase;
 49 import sun.jvm.hotspot.utilities.PlatformInfo;
 50 import sun.jvm.hotspot.utilities.UnsupportedPlatformException;
 51 
 52 /** <P> This class wraps much of the basic functionality and is the
 53  * highest-level factory for VM data structures. It makes it simple
 54  * to start up the debugging system. </P>
 55  *
 56  * <P> FIXME: especially with the addition of remote debugging, this
 57  * has turned into a mess; needs rethinking. </P>
 58  */

541 
542     private void setupJVMLibNamesWin32() {
543         jvmLibNames = new String[] { "jvm.dll" };
544     }
545 
546     //
547     // Linux
548     //
549 
550     private void setupDebuggerLinux() {
551         setupJVMLibNamesLinux();
552 
553         if (cpu.equals("x86")) {
554             machDesc = new MachineDescriptionIntelX86();
555         } else if (cpu.equals("amd64")) {
556             machDesc = new MachineDescriptionAMD64();
557         } else if (cpu.equals("ppc64")) {
558             machDesc = new MachineDescriptionPPC64();
559         } else if (cpu.equals("aarch64")) {
560             machDesc = new MachineDescriptionAArch64();


561         } else {
562           try {
563             machDesc = (MachineDescription)
564               Class.forName("sun.jvm.hotspot.debugger.MachineDescription" +
565                             cpu.toUpperCase()).getDeclaredConstructor().newInstance();
566           } catch (Exception e) {
567             throw new DebuggerException("Linux not supported on machine type " + cpu);
568           }
569         }
570 
571         LinuxDebuggerLocal dbg =
572         new LinuxDebuggerLocal(machDesc, !isServer);
573         debugger = dbg;
574 
575         attachDebugger();
576     }
577 
578     private void setupJVMLibNamesLinux() {
579         jvmLibNames = new String[] { "libjvm.so" };
580     }

 19  *
 20  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
 21  * or visit www.oracle.com if you need additional information or have any
 22  * questions.
 23  *
 24  */
 25 
 26 package sun.jvm.hotspot;
 27 
 28 import java.rmi.RemoteException;
 29 import java.lang.reflect.Constructor;
 30 import java.lang.reflect.InvocationTargetException;
 31 
 32 import sun.jvm.hotspot.debugger.Debugger;
 33 import sun.jvm.hotspot.debugger.DebuggerException;
 34 import sun.jvm.hotspot.debugger.JVMDebugger;
 35 import sun.jvm.hotspot.debugger.MachineDescription;
 36 import sun.jvm.hotspot.debugger.MachineDescriptionAMD64;
 37 import sun.jvm.hotspot.debugger.MachineDescriptionPPC64;
 38 import sun.jvm.hotspot.debugger.MachineDescriptionAArch64;
 39 import sun.jvm.hotspot.debugger.MachineDescriptionRISCV64;
 40 import sun.jvm.hotspot.debugger.MachineDescriptionIntelX86;
 41 import sun.jvm.hotspot.debugger.NoSuchSymbolException;
 42 import sun.jvm.hotspot.debugger.bsd.BsdDebuggerLocal;
 43 import sun.jvm.hotspot.debugger.linux.LinuxDebuggerLocal;
 44 import sun.jvm.hotspot.debugger.remote.RemoteDebugger;
 45 import sun.jvm.hotspot.debugger.remote.RemoteDebuggerClient;
 46 import sun.jvm.hotspot.debugger.remote.RemoteDebuggerServer;
 47 import sun.jvm.hotspot.debugger.windbg.WindbgDebuggerLocal;
 48 import sun.jvm.hotspot.runtime.VM;
 49 import sun.jvm.hotspot.types.TypeDataBase;
 50 import sun.jvm.hotspot.utilities.PlatformInfo;
 51 import sun.jvm.hotspot.utilities.UnsupportedPlatformException;
 52 
 53 /** <P> This class wraps much of the basic functionality and is the
 54  * highest-level factory for VM data structures. It makes it simple
 55  * to start up the debugging system. </P>
 56  *
 57  * <P> FIXME: especially with the addition of remote debugging, this
 58  * has turned into a mess; needs rethinking. </P>
 59  */

542 
543     private void setupJVMLibNamesWin32() {
544         jvmLibNames = new String[] { "jvm.dll" };
545     }
546 
547     //
548     // Linux
549     //
550 
551     private void setupDebuggerLinux() {
552         setupJVMLibNamesLinux();
553 
554         if (cpu.equals("x86")) {
555             machDesc = new MachineDescriptionIntelX86();
556         } else if (cpu.equals("amd64")) {
557             machDesc = new MachineDescriptionAMD64();
558         } else if (cpu.equals("ppc64")) {
559             machDesc = new MachineDescriptionPPC64();
560         } else if (cpu.equals("aarch64")) {
561             machDesc = new MachineDescriptionAArch64();
562         } else if (cpu.equals("riscv64")) {
563             machDesc = new MachineDescriptionRISCV64();
564         } else {
565           try {
566             machDesc = (MachineDescription)
567               Class.forName("sun.jvm.hotspot.debugger.MachineDescription" +
568                             cpu.toUpperCase()).getDeclaredConstructor().newInstance();
569           } catch (Exception e) {
570             throw new DebuggerException("Linux not supported on machine type " + cpu);
571           }
572         }
573 
574         LinuxDebuggerLocal dbg =
575         new LinuxDebuggerLocal(machDesc, !isServer);
576         debugger = dbg;
577 
578         attachDebugger();
579     }
580 
581     private void setupJVMLibNamesLinux() {
582         jvmLibNames = new String[] { "libjvm.so" };
583     }
< prev index next >