diff agent/src/share/classes/sun/jvm/hotspot/debugger/bsd/BsdThread.java @ 8750:39432a1cefdd

8003348: SA can not read core file on OS Summary: Macosx uses Mach-O file format for binary files, not ELF format. Currently SA works on core files on other platforms, t his change enables SA work on core file generated on Darwin. Reviewed-by: sla, sspitsyn Contributed-by: yumin.qi@oracle.com
author minqi
date Thu, 14 Mar 2013 00:33:08 -0700
parents 758935f7c23f
children
line wrap: on
line diff
--- a/agent/src/share/classes/sun/jvm/hotspot/debugger/bsd/BsdThread.java	Wed Mar 13 17:34:29 2013 -0400
+++ b/agent/src/share/classes/sun/jvm/hotspot/debugger/bsd/BsdThread.java	Thu Mar 14 00:33:08 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 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
@@ -44,7 +44,8 @@
 
     BsdThread(BsdDebugger debugger, long id) {
         this.debugger = debugger;
-        this.thread_id = (int) id;
+        // use unique_thread_id to identify thread
+        this.unique_thread_id = id;
     }
 
     public boolean equals(Object obj) {
@@ -52,7 +53,7 @@
             return false;
         }
 
-        return (((BsdThread) obj).thread_id == thread_id);
+        return (((BsdThread) obj).unique_thread_id == unique_thread_id);
     }
 
     public int hashCode() {
@@ -80,4 +81,9 @@
       throws IllegalThreadStateException, DebuggerException {
         throw new DebuggerException("Unimplemented");
     }
+
+    /** this is not interface function, used in core file to get unique thread id on Macosx*/
+    public long getUniqueThreadId() {
+        return unique_thread_id;
+    }
 }