< prev index next >

src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/linux/LinuxThread.java

Print this page

        

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2018, 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.

@@ -35,11 +35,19 @@
     LinuxThread(LinuxDebugger debugger, Address addr) {
         this.debugger = debugger;
         // FIXME: size of data fetched here should be configurable.
         // However, making it so would produce a dependency on the "types"
         // package from the debugger package, which is not desired.
-        this.lwp_id = (int) addr.getCIntegerAt(0, 4, true);
+        int pid = (int)addr.getCIntegerAt(0, 4, true);
+        if (debugger instanceof LinuxDebuggerLocal) {
+            int hostPID = ((LinuxDebuggerLocal)debugger).getHostPID(pid);
+            if (hostPID != -1) {
+                pid = hostPID;
+            }
+        }
+        this.lwp_id = pid;
+
     }
 
     LinuxThread(LinuxDebugger debugger, long id) {
         this.debugger = debugger;
         this.lwp_id = (int) id;
< prev index next >