7163117: Agent can't connect to process on Mac OSX
Reviewed-by: dholmes, coleenp, sla, minqi, kvn
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/HotSpotAgent.java Wed May 09 04:32:34 2012 -0400
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/HotSpotAgent.java Wed May 09 16:24:07 2012 +0200
@@ -572,10 +572,10 @@
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);
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/bugspot/BugSpotAgent.java Wed May 09 04:32:34 2012 -0400
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/bugspot/BugSpotAgent.java Wed May 09 16:24:07 2012 +0200
@@ -762,10 +762,10 @@
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
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/bsd/BsdCDebugger.java Wed May 09 04:32:34 2012 -0400
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/bsd/BsdCDebugger.java Wed May 09 16:24:07 2012 +0200
@@ -90,7 +90,7 @@
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;
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/bsd/BsdThreadContextFactory.java Wed May 09 04:32:34 2012 -0400
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/bsd/BsdThreadContextFactory.java Wed May 09 16:24:07 2012 +0200
@@ -33,7 +33,7 @@
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");
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/ProcDebuggerLocal.java Wed May 09 04:32:34 2012 -0400
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/ProcDebuggerLocal.java Wed May 09 16:24:07 2012 +0200
@@ -81,7 +81,7 @@
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;
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/RemoteDebuggerClient.java Wed May 09 04:32:34 2012 -0400
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/RemoteDebuggerClient.java Wed May 09 16:24:07 2012 +0200
@@ -64,7 +64,7 @@
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);
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/Threads.java Wed May 09 04:32:34 2012 -0400
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/Threads.java Wed May 09 16:24:07 2012 +0200
@@ -95,7 +95,7 @@
} 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();
}
}
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/classbrowser/HTMLGenerator.java Wed May 09 04:32:34 2012 -0400
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/classbrowser/HTMLGenerator.java Wed May 09 16:24:07 2012 +0200
@@ -199,7 +199,7 @@
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();