public class sun.tools.attach.VirtualMachineImpl extends sun.tools.attach.HotSpotVirtualMachine
minor version: 0
major version: 59
flags: flags: (0x0021) ACC_PUBLIC, ACC_SUPER
this_class: sun.tools.attach.VirtualMachineImpl
super_class: sun.tools.attach.HotSpotVirtualMachine
{
private static byte[] stub;
descriptor: [B
flags: (0x000a) ACC_PRIVATE, ACC_STATIC
private volatile long hProcess;
descriptor: J
flags: (0x0042) ACC_PRIVATE, ACC_VOLATILE
static final boolean $assertionsDisabled;
descriptor: Z
flags: (0x1018) ACC_STATIC, ACC_FINAL, ACC_SYNTHETIC
static void <clinit>();
descriptor: ()V
flags: (0x0008) ACC_STATIC
Code:
stack=1, locals=0, args_size=0
0: ldc Lsun/tools/attach/VirtualMachineImpl;
invokevirtual java.lang.Class.desiredAssertionStatus:()Z
ifne 1
iconst_1
goto 2
StackMap locals:
StackMap stack:
1: iconst_0
StackMap locals:
StackMap stack: int
2: putstatic sun.tools.attach.VirtualMachineImpl.$assertionsDisabled:Z
3: ldc "attach"
invokestatic java.lang.System.loadLibrary:(Ljava/lang/String;)V
4: invokestatic sun.tools.attach.VirtualMachineImpl.init:()V
5: invokestatic sun.tools.attach.VirtualMachineImpl.generateStub:()[B
putstatic sun.tools.attach.VirtualMachineImpl.stub:[B
6: return
LocalVariableTable:
Start End Slot Name Signature
void <init>(com.sun.tools.attach.spi.AttachProvider, java.lang.String);
descriptor: (Lcom/sun/tools/attach/spi/AttachProvider;Ljava/lang/String;)V
flags: (0x0000)
Code:
stack=6, locals=5, args_size=3
start local 0 start local 1 start local 2 0: aload 0
aload 1
aload 2
invokespecial sun.tools.attach.HotSpotVirtualMachine.<init>:(Lcom/sun/tools/attach/spi/AttachProvider;Ljava/lang/String;)V
1: aload 2
invokestatic java.lang.Integer.parseInt:(Ljava/lang/String;)I
istore 3
start local 3 2: goto 5
end local 3 StackMap locals: sun.tools.attach.VirtualMachineImpl com.sun.tools.attach.spi.AttachProvider java.lang.String
StackMap stack: java.lang.NumberFormatException
3: pop
4: new com.sun.tools.attach.AttachNotSupportedException
dup
ldc "Invalid process identifier"
invokespecial com.sun.tools.attach.AttachNotSupportedException.<init>:(Ljava/lang/String;)V
athrow
start local 3 5: StackMap locals: int
StackMap stack:
aload 0
iload 3
invokestatic sun.tools.attach.VirtualMachineImpl.openProcess:(I)J
putfield sun.tools.attach.VirtualMachineImpl.hProcess:J
6: aload 0
getfield sun.tools.attach.VirtualMachineImpl.hProcess:J
getstatic sun.tools.attach.VirtualMachineImpl.stub:[B
aconst_null
aconst_null
iconst_0
anewarray java.lang.Object
invokestatic sun.tools.attach.VirtualMachineImpl.enqueue:(J[BLjava/lang/String;Ljava/lang/String;[Ljava/lang/Object;)V
7: goto 10
StackMap locals:
StackMap stack: java.io.IOException
8: astore 4
start local 4 9: new com.sun.tools.attach.AttachNotSupportedException
dup
aload 4
invokevirtual java.io.IOException.getMessage:()Ljava/lang/String;
invokespecial com.sun.tools.attach.AttachNotSupportedException.<init>:(Ljava/lang/String;)V
athrow
end local 4 10: StackMap locals:
StackMap stack:
return
end local 3 end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 11 0 this Lsun/tools/attach/VirtualMachineImpl;
0 11 1 provider Lcom/sun/tools/attach/spi/AttachProvider;
0 11 2 id Ljava/lang/String;
2 3 3 pid I
5 11 3 pid I
9 10 4 x Ljava/io/IOException;
Exception table:
from to target type
1 2 3 Class java.lang.NumberFormatException
6 7 8 Class java.io.IOException
Exceptions:
throws com.sun.tools.attach.AttachNotSupportedException, java.io.IOException
MethodParameters:
Name Flags
provider
id
public void detach();
descriptor: ()V
flags: (0x0001) ACC_PUBLIC
Code:
stack=4, locals=2, args_size=1
start local 0 0: aload 0
dup
astore 1
monitorenter
1: aload 0
getfield sun.tools.attach.VirtualMachineImpl.hProcess:J
ldc -1
lcmp
ifeq 4
2: aload 0
getfield sun.tools.attach.VirtualMachineImpl.hProcess:J
invokestatic sun.tools.attach.VirtualMachineImpl.closeProcess:(J)V
3: aload 0
ldc -1
putfield sun.tools.attach.VirtualMachineImpl.hProcess:J
4: StackMap locals: sun.tools.attach.VirtualMachineImpl
StackMap stack:
aload 1
monitorexit
5: goto 8
StackMap locals:
StackMap stack: java.lang.Throwable
6: aload 1
monitorexit
7: athrow
8: StackMap locals:
StackMap stack:
return
end local 0 LocalVariableTable:
Start End Slot Name Signature
0 9 0 this Lsun/tools/attach/VirtualMachineImpl;
Exception table:
from to target type
1 5 6 any
6 7 6 any
Exceptions:
throws java.io.IOException
java.io.InputStream execute(java.lang.String, java.lang.Object[]);
descriptor: (Ljava/lang/String;[Ljava/lang/Object;)Ljava/io/InputStream;
flags: (0x0080) ACC_VARARGS
Code:
stack=6, locals=13, args_size=3
start local 0 start local 1 start local 2 0: getstatic sun.tools.attach.VirtualMachineImpl.$assertionsDisabled:Z
ifne 1
aload 2
arraylength
iconst_3
if_icmple 1
new java.lang.AssertionError
dup
invokespecial java.lang.AssertionError.<init>:()V
athrow
1: StackMap locals:
StackMap stack:
new java.util.Random
dup
invokespecial java.util.Random.<init>:()V
astore 3
start local 3 2: aload 3
invokevirtual java.util.Random.nextInt:()I
istore 4
start local 4 3: ldc "\\\\.\\pipe\\javatool"
astore 5
start local 5 4: new java.lang.StringBuilder
dup
aload 5
invokestatic java.lang.String.valueOf:(Ljava/lang/Object;)Ljava/lang/String;
invokespecial java.lang.StringBuilder.<init>:(Ljava/lang/String;)V
iload 4
invokevirtual java.lang.StringBuilder.append:(I)Ljava/lang/StringBuilder;
invokevirtual java.lang.StringBuilder.toString:()Ljava/lang/String;
astore 6
start local 6 5: aload 6
invokestatic sun.tools.attach.VirtualMachineImpl.createPipe:(Ljava/lang/String;)J
lstore 7
start local 7 6: goto 11
end local 7 StackMap locals: sun.tools.attach.VirtualMachineImpl java.lang.String java.lang.Object[] java.util.Random int java.lang.String java.lang.String
StackMap stack: java.io.IOException
7: pop
8: aload 3
invokevirtual java.util.Random.nextInt:()I
istore 4
9: new java.lang.StringBuilder
dup
aload 5
invokestatic java.lang.String.valueOf:(Ljava/lang/Object;)Ljava/lang/String;
invokespecial java.lang.StringBuilder.<init>:(Ljava/lang/String;)V
iload 4
invokevirtual java.lang.StringBuilder.append:(I)Ljava/lang/StringBuilder;
invokevirtual java.lang.StringBuilder.toString:()Ljava/lang/String;
astore 6
10: aload 6
invokestatic sun.tools.attach.VirtualMachineImpl.createPipe:(Ljava/lang/String;)J
lstore 7
start local 7 11: StackMap locals: long
StackMap stack:
aload 0
getfield sun.tools.attach.VirtualMachineImpl.hProcess:J
ldc -1
lcmp
ifne 14
12: lload 7
invokestatic sun.tools.attach.VirtualMachineImpl.closePipe:(J)V
13: new java.io.IOException
dup
ldc "Detached from target VM"
invokespecial java.io.IOException.<init>:(Ljava/lang/String;)V
athrow
14: StackMap locals:
StackMap stack:
aload 0
getfield sun.tools.attach.VirtualMachineImpl.hProcess:J
getstatic sun.tools.attach.VirtualMachineImpl.stub:[B
aload 1
aload 6
aload 2
invokestatic sun.tools.attach.VirtualMachineImpl.enqueue:(J[BLjava/lang/String;Ljava/lang/String;[Ljava/lang/Object;)V
15: lload 7
invokestatic sun.tools.attach.VirtualMachineImpl.connectPipe:(J)V
16: new sun.tools.attach.VirtualMachineImpl$PipedInputStream
dup
aload 0
lload 7
invokespecial sun.tools.attach.VirtualMachineImpl$PipedInputStream.<init>:(Lsun/tools/attach/VirtualMachineImpl;J)V
astore 9
start local 9 17: aload 0
aload 9
invokevirtual sun.tools.attach.VirtualMachineImpl.readInt:(Ljava/io/InputStream;)I
istore 10
start local 10 18: iload 10
ifeq 29
19: aload 0
aload 9
invokevirtual sun.tools.attach.VirtualMachineImpl.readErrorMessage:(Ljava/io/InputStream;)Ljava/lang/String;
astore 11
start local 11 20: aload 9
invokevirtual sun.tools.attach.VirtualMachineImpl$PipedInputStream.close:()V
21: aload 1
ldc "load"
invokevirtual java.lang.String.equals:(Ljava/lang/Object;)Z
ifeq 26
22: ldc "Failed to load agent library"
astore 12
start local 12 23: aload 11
invokevirtual java.lang.String.isEmpty:()Z
ifne 25
24: new java.lang.StringBuilder
dup
aload 12
invokestatic java.lang.String.valueOf:(Ljava/lang/Object;)Ljava/lang/String;
invokespecial java.lang.StringBuilder.<init>:(Ljava/lang/String;)V
ldc ": "
invokevirtual java.lang.StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
aload 11
invokevirtual java.lang.StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
invokevirtual java.lang.StringBuilder.toString:()Ljava/lang/String;
astore 12
25: StackMap locals: sun.tools.attach.VirtualMachineImpl java.lang.String java.lang.Object[] java.util.Random int java.lang.String java.lang.String long sun.tools.attach.VirtualMachineImpl$PipedInputStream int java.lang.String java.lang.String
StackMap stack:
new com.sun.tools.attach.AgentLoadException
dup
aload 12
invokespecial com.sun.tools.attach.AgentLoadException.<init>:(Ljava/lang/String;)V
athrow
end local 12 26: StackMap locals:
StackMap stack:
aload 11
invokevirtual java.lang.String.isEmpty:()Z
ifeq 28
27: ldc "Command failed in target VM"
astore 11
28: StackMap locals:
StackMap stack:
new com.sun.tools.attach.AttachOperationFailedException
dup
aload 11
invokespecial com.sun.tools.attach.AttachOperationFailedException.<init>:(Ljava/lang/String;)V
athrow
end local 11 29: StackMap locals:
StackMap stack:
aload 9
30: areturn
end local 10 end local 9 31: StackMap locals: sun.tools.attach.VirtualMachineImpl java.lang.String java.lang.Object[] java.util.Random int java.lang.String java.lang.String long
StackMap stack: java.io.IOException
astore 9
start local 9 32: lload 7
invokestatic sun.tools.attach.VirtualMachineImpl.closePipe:(J)V
33: aload 9
athrow
end local 9 end local 7 end local 6 end local 5 end local 4 end local 3 end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 34 0 this Lsun/tools/attach/VirtualMachineImpl;
0 34 1 cmd Ljava/lang/String;
0 34 2 args [Ljava/lang/Object;
2 34 3 rnd Ljava/util/Random;
3 34 4 r I
4 34 5 pipeprefix Ljava/lang/String;
5 34 6 pipename Ljava/lang/String;
6 7 7 hPipe J
11 34 7 hPipe J
17 31 9 in Lsun/tools/attach/VirtualMachineImpl$PipedInputStream;
18 31 10 status I
20 29 11 message Ljava/lang/String;
23 26 12 msg Ljava/lang/String;
32 34 9 ioe Ljava/io/IOException;
Exception table:
from to target type
5 6 7 Class java.io.IOException
14 30 31 Class java.io.IOException
Exceptions:
throws com.sun.tools.attach.AgentLoadException, java.io.IOException
MethodParameters:
Name Flags
cmd
args
static native void init();
descriptor: ()V
flags: (0x0108) ACC_STATIC, ACC_NATIVE
static native byte[] generateStub();
descriptor: ()[B
flags: (0x0108) ACC_STATIC, ACC_NATIVE
static native long openProcess(int);
descriptor: (I)J
flags: (0x0108) ACC_STATIC, ACC_NATIVE
Exceptions:
throws java.io.IOException
MethodParameters:
Name Flags
pid
static native void closeProcess(long);
descriptor: (J)V
flags: (0x0108) ACC_STATIC, ACC_NATIVE
Exceptions:
throws java.io.IOException
MethodParameters:
Name Flags
hProcess
static native long createPipe(java.lang.String);
descriptor: (Ljava/lang/String;)J
flags: (0x0108) ACC_STATIC, ACC_NATIVE
Exceptions:
throws java.io.IOException
MethodParameters:
Name Flags
name
static native void closePipe(long);
descriptor: (J)V
flags: (0x0108) ACC_STATIC, ACC_NATIVE
Exceptions:
throws java.io.IOException
MethodParameters:
Name Flags
hPipe
static native void connectPipe(long);
descriptor: (J)V
flags: (0x0108) ACC_STATIC, ACC_NATIVE
Exceptions:
throws java.io.IOException
MethodParameters:
Name Flags
hPipe
static native int readPipe(long, byte[], int, int);
descriptor: (J[BII)I
flags: (0x0108) ACC_STATIC, ACC_NATIVE
Exceptions:
throws java.io.IOException
MethodParameters:
Name Flags
hPipe
buf
off
buflen
static native void enqueue(long, byte[], java.lang.String, java.lang.String, java.lang.Object[]);
descriptor: (J[BLjava/lang/String;Ljava/lang/String;[Ljava/lang/Object;)V
flags: (0x0188) ACC_STATIC, ACC_VARARGS, ACC_NATIVE
Exceptions:
throws java.io.IOException
MethodParameters:
Name Flags
hProcess
stub
cmd
pipename
args
}
SourceFile: "VirtualMachineImpl.java"
NestMembers:
sun.tools.attach.VirtualMachineImpl$PipedInputStream
InnerClasses:
private PipedInputStream = sun.tools.attach.VirtualMachineImpl$PipedInputStream of sun.tools.attach.VirtualMachineImpl