changeset 3482:1fcba869fe4a hs23.2-b01

7163117: Agent can't connect to process on Mac OSX Reviewed-by: dholmes, coleenp, sla, minqi, kvn
author nloodin
date Wed, 09 May 2012 16:24:07 +0200
parents 1a9c601a5395
children b65719ad597b
files agent/src/share/classes/sun/jvm/hotspot/HotSpotAgent.java agent/src/share/classes/sun/jvm/hotspot/bugspot/BugSpotAgent.java agent/src/share/classes/sun/jvm/hotspot/debugger/bsd/BsdCDebugger.java agent/src/share/classes/sun/jvm/hotspot/debugger/bsd/BsdThreadContextFactory.java agent/src/share/classes/sun/jvm/hotspot/debugger/proc/ProcDebuggerLocal.java agent/src/share/classes/sun/jvm/hotspot/debugger/remote/RemoteDebuggerClient.java agent/src/share/classes/sun/jvm/hotspot/runtime/Threads.java agent/src/share/classes/sun/jvm/hotspot/ui/classbrowser/HTMLGenerator.java
diffstat 8 files changed, 10 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/agent/src/share/classes/sun/jvm/hotspot/HotSpotAgent.java	Wed May 09 00:28:45 2012 -0400
+++ b/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/agent/src/share/classes/sun/jvm/hotspot/bugspot/BugSpotAgent.java	Wed May 09 00:28:45 2012 -0400
+++ b/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/agent/src/share/classes/sun/jvm/hotspot/debugger/bsd/BsdCDebugger.java	Wed May 09 00:28:45 2012 -0400
+++ b/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/agent/src/share/classes/sun/jvm/hotspot/debugger/bsd/BsdThreadContextFactory.java	Wed May 09 00:28:45 2012 -0400
+++ b/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/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/ProcDebuggerLocal.java	Wed May 09 00:28:45 2012 -0400
+++ b/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/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/RemoteDebuggerClient.java	Wed May 09 00:28:45 2012 -0400
+++ b/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/agent/src/share/classes/sun/jvm/hotspot/runtime/Threads.java	Wed May 09 00:28:45 2012 -0400
+++ b/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/agent/src/share/classes/sun/jvm/hotspot/ui/classbrowser/HTMLGenerator.java	Wed May 09 00:28:45 2012 -0400
+++ b/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();