Mercurial > hg > truffle
diff agent/src/share/classes/sun/jvm/hotspot/HotSpotAgent.java @ 3960:f08d439fab8c
7089790: integrate bsd-port changes
Reviewed-by: kvn, twisti, jrose
Contributed-by: Kurt Miller <kurt@intricatesoftware.com>, Greg Lewis <glewis@eyesbeyond.com>, Jung-uk Kim <jkim@freebsd.org>, Christos Zoulas <christos@zoulas.com>, Landon Fuller <landonf@plausible.coop>, The FreeBSD Foundation <board@freebsdfoundation.org>, Michael Franz <mvfranz@gmail.com>, Roger Hoover <rhoover@apple.com>, Alexander Strange <astrange@apple.com>
author | never |
---|---|
date | Sun, 25 Sep 2011 16:03:29 -0700 |
parents | f6f3bb0ee072 |
children | 78d2ae5ab35b |
line wrap: on
line diff
--- a/agent/src/share/classes/sun/jvm/hotspot/HotSpotAgent.java Tue Sep 20 23:50:16 2011 -0700 +++ b/agent/src/share/classes/sun/jvm/hotspot/HotSpotAgent.java Sun Sep 25 16:03:29 2011 -0700 @@ -28,6 +28,7 @@ import java.net.*; import java.rmi.*; import sun.jvm.hotspot.debugger.*; +import sun.jvm.hotspot.debugger.bsd.*; import sun.jvm.hotspot.debugger.proc.*; import sun.jvm.hotspot.debugger.remote.*; import sun.jvm.hotspot.debugger.windbg.*; @@ -335,6 +336,8 @@ setupDebuggerWin32(); } else if (os.equals("linux")) { setupDebuggerLinux(); + } else if (os.equals("bsd")) { + setupDebuggerBsd(); } else { // Add support for more operating systems here throw new DebuggerException("Operating system " + os + " not yet supported"); @@ -390,6 +393,10 @@ db = new HotSpotTypeDataBase(machDesc, new LinuxVtblAccess(debugger, jvmLibNames), debugger, jvmLibNames); + } else if (os.equals("bsd")) { + db = new HotSpotTypeDataBase(machDesc, + new BsdVtblAccess(debugger, jvmLibNames), + debugger, jvmLibNames); } else { throw new DebuggerException("OS \"" + os + "\" not yet supported (no VtblAccess yet)"); } @@ -477,6 +484,8 @@ setupJVMLibNamesWin32(); } else if (os.equals("linux")) { setupJVMLibNamesLinux(); + } else if (os.equals("bsd")) { + setupJVMLibNamesBsd(); } else { throw new RuntimeException("Unknown OS type"); } @@ -554,6 +563,31 @@ jvmLibNames = new String[] { "libjvm.so", "libjvm_g.so" }; } + // + // BSD + // + + private void setupDebuggerBsd() { + setupJVMLibNamesBsd(); + + if (cpu.equals("x86")) { + machDesc = new MachineDescriptionIntelX86(); + } else if (cpu.equals("amd64")) { + machDesc = new MachineDescriptionAMD64(); + } else { + throw new DebuggerException("BSD only supported on x86/amd64"); + } + + BsdDebuggerLocal dbg = new BsdDebuggerLocal(machDesc, !isServer); + debugger = dbg; + + attachDebugger(); + } + + private void setupJVMLibNamesBsd() { + jvmLibNames = new String[] { "libjvm.so", "libjvm_g.so" }; + } + /** Convenience routine which should be called by per-platform debugger setup. Should not be called when startupMode is REMOTE_MODE. */