1 /*
2 * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 package sun.jvm.hotspot;
26
27 import java.rmi.RemoteException;
28 import java.lang.reflect.Constructor;
29 import java.lang.reflect.InvocationTargetException;
30
31 import sun.jvm.hotspot.debugger.Debugger;
32 import sun.jvm.hotspot.debugger.DebuggerException;
33 import sun.jvm.hotspot.debugger.JVMDebugger;
34 import sun.jvm.hotspot.debugger.MachineDescription;
35 import sun.jvm.hotspot.debugger.MachineDescriptionAMD64;
36 import sun.jvm.hotspot.debugger.MachineDescriptionIA64;
37 import sun.jvm.hotspot.debugger.MachineDescriptionIntelX86;
38 import sun.jvm.hotspot.debugger.MachineDescriptionSPARC32Bit;
39 import sun.jvm.hotspot.debugger.MachineDescriptionSPARC64Bit;
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.proc.ProcDebuggerLocal;
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>
571 // FIXME: add support for server mode
572 }
573
574 private void setupJVMLibNamesWin32() {
575 jvmLibNames = new String[] { "jvm.dll" };
576 }
577
578 //
579 // Linux
580 //
581
582 private void setupDebuggerLinux() {
583 setupJVMLibNamesLinux();
584
585 if (cpu.equals("x86")) {
586 machDesc = new MachineDescriptionIntelX86();
587 } else if (cpu.equals("ia64")) {
588 machDesc = new MachineDescriptionIA64();
589 } else if (cpu.equals("amd64")) {
590 machDesc = new MachineDescriptionAMD64();
591 } else if (cpu.equals("sparc")) {
592 if (LinuxDebuggerLocal.getAddressSize()==8) {
593 machDesc = new MachineDescriptionSPARC64Bit();
594 } else {
595 machDesc = new MachineDescriptionSPARC32Bit();
596 }
597 } else {
598 try {
599 machDesc = (MachineDescription)
600 Class.forName("sun.jvm.hotspot.debugger.MachineDescription" +
601 cpu.toUpperCase()).newInstance();
602 } catch (Exception e) {
603 throw new DebuggerException("Linux not supported on machine type " + cpu);
604 }
605 }
606
607 LinuxDebuggerLocal dbg =
608 new LinuxDebuggerLocal(machDesc, !isServer);
609 debugger = dbg;
610
|
1 /*
2 * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 package sun.jvm.hotspot;
26
27 import java.rmi.RemoteException;
28 import java.lang.reflect.Constructor;
29 import java.lang.reflect.InvocationTargetException;
30
31 import sun.jvm.hotspot.debugger.Debugger;
32 import sun.jvm.hotspot.debugger.DebuggerException;
33 import sun.jvm.hotspot.debugger.JVMDebugger;
34 import sun.jvm.hotspot.debugger.MachineDescription;
35 import sun.jvm.hotspot.debugger.MachineDescriptionAMD64;
36 import sun.jvm.hotspot.debugger.MachineDescriptionPPC64;
37 import sun.jvm.hotspot.debugger.MachineDescriptionIA64;
38 import sun.jvm.hotspot.debugger.MachineDescriptionIntelX86;
39 import sun.jvm.hotspot.debugger.MachineDescriptionSPARC32Bit;
40 import sun.jvm.hotspot.debugger.MachineDescriptionSPARC64Bit;
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.proc.ProcDebuggerLocal;
45 import sun.jvm.hotspot.debugger.remote.RemoteDebugger;
46 import sun.jvm.hotspot.debugger.remote.RemoteDebuggerClient;
47 import sun.jvm.hotspot.debugger.remote.RemoteDebuggerServer;
48 import sun.jvm.hotspot.debugger.windbg.WindbgDebuggerLocal;
49 import sun.jvm.hotspot.runtime.VM;
50 import sun.jvm.hotspot.types.TypeDataBase;
51 import sun.jvm.hotspot.utilities.PlatformInfo;
52 import sun.jvm.hotspot.utilities.UnsupportedPlatformException;
53
54 /** <P> This class wraps much of the basic functionality and is the
55 * highest-level factory for VM data structures. It makes it simple
56 * to start up the debugging system. </P>
572 // FIXME: add support for server mode
573 }
574
575 private void setupJVMLibNamesWin32() {
576 jvmLibNames = new String[] { "jvm.dll" };
577 }
578
579 //
580 // Linux
581 //
582
583 private void setupDebuggerLinux() {
584 setupJVMLibNamesLinux();
585
586 if (cpu.equals("x86")) {
587 machDesc = new MachineDescriptionIntelX86();
588 } else if (cpu.equals("ia64")) {
589 machDesc = new MachineDescriptionIA64();
590 } else if (cpu.equals("amd64")) {
591 machDesc = new MachineDescriptionAMD64();
592 } else if (cpu.equals("ppc64")) {
593 machDesc = new MachineDescriptionPPC64();
594 } else if (cpu.equals("sparc")) {
595 if (LinuxDebuggerLocal.getAddressSize()==8) {
596 machDesc = new MachineDescriptionSPARC64Bit();
597 } else {
598 machDesc = new MachineDescriptionSPARC32Bit();
599 }
600 } else {
601 try {
602 machDesc = (MachineDescription)
603 Class.forName("sun.jvm.hotspot.debugger.MachineDescription" +
604 cpu.toUpperCase()).newInstance();
605 } catch (Exception e) {
606 throw new DebuggerException("Linux not supported on machine type " + cpu);
607 }
608 }
609
610 LinuxDebuggerLocal dbg =
611 new LinuxDebuggerLocal(machDesc, !isServer);
612 debugger = dbg;
613
|