From 88e2a0d5def53f65ebf8aecbe93a5e61d3de0747 Mon Sep 17 00:00:00 2001 From: nloodin Date: Wed, 9 May 2012 16:24:07 +0200 Subject: [PATCH] 7163117: Agent can't connect to process on Mac OSX Reviewed-by: dholmes, coleenp, sla, minqi, kvn --- agent/src/share/classes/sun/jvm/hotspot/HotSpotAgent.java | 4 ++-- .../share/classes/sun/jvm/hotspot/bugspot/BugSpotAgent.java | 4 ++-- .../classes/sun/jvm/hotspot/debugger/bsd/BsdCDebugger.java | 2 +- .../sun/jvm/hotspot/debugger/bsd/BsdThreadContextFactory.java | 2 +- .../sun/jvm/hotspot/debugger/proc/ProcDebuggerLocal.java | 2 +- .../sun/jvm/hotspot/debugger/remote/RemoteDebuggerClient.java | 2 +- agent/src/share/classes/sun/jvm/hotspot/runtime/Threads.java | 2 +- .../sun/jvm/hotspot/ui/classbrowser/HTMLGenerator.java | 2 +- 8 files changed, 10 insertions(+), 10 deletions(-) diff --git a/agent/src/share/classes/sun/jvm/hotspot/HotSpotAgent.java b/agent/src/share/classes/sun/jvm/hotspot/HotSpotAgent.java index 233bc173a..029c20f0b 100644 --- a/agent/src/share/classes/sun/jvm/hotspot/HotSpotAgent.java +++ b/agent/src/share/classes/sun/jvm/hotspot/HotSpotAgent.java @@ -572,10 +572,10 @@ public class HotSpotAgent { if (cpu.equals("x86")) { machDesc = new MachineDescriptionIntelX86(); - } else if (cpu.equals("amd64")) { + } else if (cpu.equals("amd64") || cpu.equals("x86_64")) { machDesc = new MachineDescriptionAMD64(); } else { - throw new DebuggerException("BSD only supported on x86/amd64"); + throw new DebuggerException("BSD only supported on x86/x86_64. Current arch: " + cpu); } BsdDebuggerLocal dbg = new BsdDebuggerLocal(machDesc, !isServer); diff --git a/agent/src/share/classes/sun/jvm/hotspot/bugspot/BugSpotAgent.java b/agent/src/share/classes/sun/jvm/hotspot/bugspot/BugSpotAgent.java index bb0a44470..3b89f5996 100644 --- a/agent/src/share/classes/sun/jvm/hotspot/bugspot/BugSpotAgent.java +++ b/agent/src/share/classes/sun/jvm/hotspot/bugspot/BugSpotAgent.java @@ -762,10 +762,10 @@ public class BugSpotAgent { if (cpu.equals("x86")) { machDesc = new MachineDescriptionIntelX86(); - } else if (cpu.equals("amd64")) { + } else if (cpu.equals("amd64") || (cpu.equals("x86_64"))) { machDesc = new MachineDescriptionAMD64(); } else { - throw new DebuggerException("Bsd only supported on x86/amd64"); + throw new DebuggerException("Bsd only supported on x86/x86_64. Current arch: " + cpu); } // Note we do not use a cache for the local debugger in server diff --git a/agent/src/share/classes/sun/jvm/hotspot/debugger/bsd/BsdCDebugger.java b/agent/src/share/classes/sun/jvm/hotspot/debugger/bsd/BsdCDebugger.java index 92f7bbf3d..1818d1d5a 100644 --- a/agent/src/share/classes/sun/jvm/hotspot/debugger/bsd/BsdCDebugger.java +++ b/agent/src/share/classes/sun/jvm/hotspot/debugger/bsd/BsdCDebugger.java @@ -90,7 +90,7 @@ class BsdCDebugger implements CDebugger { Address pc = context.getRegisterAsAddress(X86ThreadContext.EIP); if (pc == null) return null; return new BsdX86CFrame(dbg, ebp, pc); - } else if (cpu.equals("amd64")) { + } else if (cpu.equals("amd64") || cpu.equals("x86_64")) { AMD64ThreadContext context = (AMD64ThreadContext) thread.getContext(); Address rbp = context.getRegisterAsAddress(AMD64ThreadContext.RBP); if (rbp == null) return null; diff --git a/agent/src/share/classes/sun/jvm/hotspot/debugger/bsd/BsdThreadContextFactory.java b/agent/src/share/classes/sun/jvm/hotspot/debugger/bsd/BsdThreadContextFactory.java index 8c13adade..01fe1d745 100644 --- a/agent/src/share/classes/sun/jvm/hotspot/debugger/bsd/BsdThreadContextFactory.java +++ b/agent/src/share/classes/sun/jvm/hotspot/debugger/bsd/BsdThreadContextFactory.java @@ -33,7 +33,7 @@ class BsdThreadContextFactory { String cpu = dbg.getCPU(); if (cpu.equals("x86")) { return new BsdX86ThreadContext(dbg); - } else if (cpu.equals("amd64")) { + } else if (cpu.equals("amd64") || cpu.equals("x86_64")) { return new BsdAMD64ThreadContext(dbg); } else { throw new RuntimeException("cpu " + cpu + " is not yet supported"); diff --git a/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/ProcDebuggerLocal.java b/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/ProcDebuggerLocal.java index 5d75114fd..1d9f7cea1 100644 --- a/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/ProcDebuggerLocal.java +++ b/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/ProcDebuggerLocal.java @@ -81,7 +81,7 @@ public class ProcDebuggerLocal extends DebuggerBase implements ProcDebugger { pcRegIndex = X86ThreadContext.EIP; fpRegIndex = X86ThreadContext.EBP; unalignedAccessesOkay = true; - } else if (cpu.equals("amd64")) { + } else if (cpu.equals("amd64") || cpu.equals("x86_64")) { threadFactory = new ProcAMD64ThreadFactory(this); pcRegIndex = AMD64ThreadContext.RIP; fpRegIndex = AMD64ThreadContext.RBP; diff --git a/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/RemoteDebuggerClient.java b/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/RemoteDebuggerClient.java index 4f226df52..beb3f536a 100644 --- a/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/RemoteDebuggerClient.java +++ b/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/RemoteDebuggerClient.java @@ -64,7 +64,7 @@ public class RemoteDebuggerClient extends DebuggerBase implements JVMDebugger { cachePageSize = 4096; cacheNumPages = parseCacheNumPagesProperty(cacheSize / cachePageSize); unalignedAccessesOkay = true; - } else if (cpu.equals("amd64")) { + } else if (cpu.equals("amd64") || cpu.equals("x86_64")) { threadFactory = new RemoteAMD64ThreadFactory(this); cachePageSize = 4096; cacheNumPages = parseCacheNumPagesProperty(cacheSize / cachePageSize); diff --git a/agent/src/share/classes/sun/jvm/hotspot/runtime/Threads.java b/agent/src/share/classes/sun/jvm/hotspot/runtime/Threads.java index 44ce89804..67d929d1d 100644 --- a/agent/src/share/classes/sun/jvm/hotspot/runtime/Threads.java +++ b/agent/src/share/classes/sun/jvm/hotspot/runtime/Threads.java @@ -95,7 +95,7 @@ public class Threads { } else if (os.equals("bsd")) { if (cpu.equals("x86")) { access = new BsdX86JavaThreadPDAccess(); - } else if (cpu.equals("amd64")) { + } else if (cpu.equals("amd64") || cpu.equals("x86_64")) { access = new BsdAMD64JavaThreadPDAccess(); } } diff --git a/agent/src/share/classes/sun/jvm/hotspot/ui/classbrowser/HTMLGenerator.java b/agent/src/share/classes/sun/jvm/hotspot/ui/classbrowser/HTMLGenerator.java index 210bed768..b8d5c8bab 100644 --- a/agent/src/share/classes/sun/jvm/hotspot/ui/classbrowser/HTMLGenerator.java +++ b/agent/src/share/classes/sun/jvm/hotspot/ui/classbrowser/HTMLGenerator.java @@ -199,7 +199,7 @@ public class HTMLGenerator implements /* imports */ ClassConstants { cpuHelper = new SPARCHelper(); } else if (cpu.equals("x86")) { cpuHelper = new X86Helper(); - } else if (cpu.equals("amd64")) { + } else if (cpu.equals("amd64") || cpu.equals("x86_64")) { cpuHelper = new AMD64Helper(); } else if (cpu.equals("ia64")) { cpuHelper = new IA64Helper(); -- GitLab