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 */
552
553 private void setupJVMLibNamesWin32() {
554 jvmLibNames = new String[] { "jvm.dll" };
555 }
556
557 //
558 // Linux
559 //
560
561 private void setupDebuggerLinux() {
562 setupJVMLibNamesLinux();
563
564 if (cpu.equals("x86")) {
565 machDesc = new MachineDescriptionIntelX86();
566 } else if (cpu.equals("amd64")) {
567 machDesc = new MachineDescriptionAMD64();
568 } else if (cpu.equals("ppc64")) {
569 machDesc = new MachineDescriptionPPC64();
570 } else if (cpu.equals("aarch64")) {
571 machDesc = new MachineDescriptionAArch64();
572 } else {
573 try {
574 machDesc = (MachineDescription)
575 Class.forName("sun.jvm.hotspot.debugger.MachineDescription" +
576 cpu.toUpperCase()).getDeclaredConstructor().newInstance();
577 } catch (Exception e) {
578 throw new DebuggerException("Linux not supported on machine type " + cpu);
579 }
580 }
581
582 LinuxDebuggerLocal dbg =
583 new LinuxDebuggerLocal(machDesc, !isServer);
584 debugger = dbg;
585
586 attachDebugger();
587 }
588
589 private void setupJVMLibNamesLinux() {
590 jvmLibNames = new String[] { "libjvm.so" };
591 }
|
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 */
553
554 private void setupJVMLibNamesWin32() {
555 jvmLibNames = new String[] { "jvm.dll" };
556 }
557
558 //
559 // Linux
560 //
561
562 private void setupDebuggerLinux() {
563 setupJVMLibNamesLinux();
564
565 if (cpu.equals("x86")) {
566 machDesc = new MachineDescriptionIntelX86();
567 } else if (cpu.equals("amd64")) {
568 machDesc = new MachineDescriptionAMD64();
569 } else if (cpu.equals("ppc64")) {
570 machDesc = new MachineDescriptionPPC64();
571 } else if (cpu.equals("aarch64")) {
572 machDesc = new MachineDescriptionAArch64();
573 } else if (cpu.equals("riscv64")) {
574 machDesc = new MachineDescriptionRISCV64();
575 } else {
576 try {
577 machDesc = (MachineDescription)
578 Class.forName("sun.jvm.hotspot.debugger.MachineDescription" +
579 cpu.toUpperCase()).getDeclaredConstructor().newInstance();
580 } catch (Exception e) {
581 throw new DebuggerException("Linux not supported on machine type " + cpu);
582 }
583 }
584
585 LinuxDebuggerLocal dbg =
586 new LinuxDebuggerLocal(machDesc, !isServer);
587 debugger = dbg;
588
589 attachDebugger();
590 }
591
592 private void setupJVMLibNamesLinux() {
593 jvmLibNames = new String[] { "libjvm.so" };
594 }
|