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	Wed Mar 13 23:31:48 2013
--- new/agent/src/share/classes/sun/jvm/hotspot/HotSpotAgent.java	Wed Mar 13 23:31:47 2013

*** 1,7 **** --- 1,7 ---- /* ! * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. ! * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation.
*** 309,318 **** --- 309,320 ---- setupDebuggerWin32(); } else if (os.equals("linux")) { setupDebuggerLinux(); } else if (os.equals("bsd")) { setupDebuggerBsd(); + } else if (os.equals("darwin")) { + setupDebuggerDarwin(); } else { // Add support for more operating systems here throw new DebuggerException("Operating system " + os + " not yet supported"); }
*** 368,377 **** --- 370,383 ---- debugger, jvmLibNames); } else if (os.equals("bsd")) { db = new HotSpotTypeDataBase(machDesc, new BsdVtblAccess(debugger, jvmLibNames), debugger, jvmLibNames); + } else if (os.equals("darwin")) { + db = new HotSpotTypeDataBase(machDesc, + new BsdVtblAccess(debugger, jvmLibNames), + debugger, jvmLibNames); } else { throw new DebuggerException("OS \"" + os + "\" not yet supported (no VtblAccess yet)"); } } catch (NoSuchSymbolException e) {
*** 457,466 **** --- 463,474 ---- setupJVMLibNamesWin32(); } else if (os.equals("linux")) { setupJVMLibNamesLinux(); } else if (os.equals("bsd")) { setupJVMLibNamesBsd(); + } else if (os.equals("darwin")) { + setupJVMLibNamesDarwin(); } else { throw new RuntimeException("Unknown OS type"); } cpu = debugger.getCPU();
*** 565,574 **** --- 573,605 ---- private void setupJVMLibNamesBsd() { jvmLibNames = new String[] { "libjvm.so", "libjvm_g.so" }; } + // + // Darwin + // + + private void setupDebuggerDarwin() { + setupJVMLibNamesDarwin(); + + if (cpu.equals("amd64") || cpu.equals("x86_64")) { + machDesc = new MachineDescriptionAMD64(); + } else { + throw new DebuggerException("Darwin only supported on x86_64. Current arch: " + cpu); + } + + BsdDebuggerLocal dbg = new BsdDebuggerLocal(machDesc, !isServer); + debugger = dbg; + + attachDebugger(); + } + + private void setupJVMLibNamesDarwin() { + jvmLibNames = new String[] { "libjvm.dylib", "libjvm_g.dylib" }; + } + /** Convenience routine which should be called by per-platform debugger setup. Should not be called when startupMode is REMOTE_MODE. */ private void attachDebugger() { if (startupMode == PROCESS_MODE) {

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