src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/linux/LinuxDebuggerLocal.java
changeset 53379 e47074d2d8cc
parent 51203 220c9188db4f
child 58913 e2dfab7beccb
equal deleted inserted replaced
53378:52abdb8a48b2 53379:e47074d2d8cc
     1 /*
     1 /*
     2  * Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2002, 2019, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.
     7  * published by the Free Software Foundation.
   100     // native methods
   100     // native methods
   101 
   101 
   102     private native static void init0()
   102     private native static void init0()
   103                                 throws DebuggerException;
   103                                 throws DebuggerException;
   104     private native void setSAAltRoot0(String altroot);
   104     private native void setSAAltRoot0(String altroot);
   105     private native void attach0(int pid, boolean isInContainer)
   105     private native void attach0(int pid)
   106                                 throws DebuggerException;
   106                                 throws DebuggerException;
   107     private native void attach0(String execName, String coreName)
   107     private native void attach0(String execName, String coreName)
   108                                 throws DebuggerException;
   108                                 throws DebuggerException;
   109     private native void detach0()
   109     private native void detach0()
   110                                 throws DebuggerException;
   110                                 throws DebuggerException;
   319             fillNSpidMap(proc);
   319             fillNSpidMap(proc);
   320         }
   320         }
   321 
   321 
   322         class AttachTask implements WorkerThreadTask {
   322         class AttachTask implements WorkerThreadTask {
   323            int pid;
   323            int pid;
   324            boolean isInContainer;
       
   325            public void doit(LinuxDebuggerLocal debugger) {
   324            public void doit(LinuxDebuggerLocal debugger) {
   326               debugger.attach0(pid, isInContainer);
   325               debugger.attach0(pid);
   327               debugger.attached = true;
   326               debugger.attached = true;
   328               debugger.isCore = false;
   327               debugger.isCore = false;
   329               findABIVersion();
   328               findABIVersion();
   330            }
   329            }
   331         }
   330         }
   332 
   331 
   333         AttachTask task = new AttachTask();
   332         AttachTask task = new AttachTask();
   334         task.pid = processID;
   333         task.pid = processID;
   335         task.isInContainer = (processID != NSpid);
       
   336         workerThread.execute(task);
   334         workerThread.execute(task);
   337     }
   335     }
   338 
   336 
   339     /** From the Debugger interface via JVMDebugger */
   337     /** From the Debugger interface via JVMDebugger */
   340     public synchronized void attach(String execName, String coreName) {
   338     public synchronized void attach(String execName, String coreName) {