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 final java.lang.String tmpdir;
descriptor: Ljava/lang/String;
flags: (0x001a) ACC_PRIVATE, ACC_STATIC, ACC_FINAL
ConstantValue: "/tmp"
private int fd;
descriptor: I
flags: (0x0002) ACC_PRIVATE
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: 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=8, locals=12, 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 0
iconst_m1
putfield sun.tools.attach.VirtualMachineImpl.fd:I
2: aload 2
invokestatic java.lang.Integer.parseInt:(Ljava/lang/String;)I
istore 3
start local 3 3: goto 6
end local 3 StackMap locals: sun.tools.attach.VirtualMachineImpl com.sun.tools.attach.spi.AttachProvider java.lang.String
StackMap stack: java.lang.NumberFormatException
4: pop
5: 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 6: StackMap locals: int
StackMap stack:
aload 0
aload 0
iload 3
invokevirtual sun.tools.attach.VirtualMachineImpl.openDoor:(I)I
putfield sun.tools.attach.VirtualMachineImpl.fd:I
7: goto 35
StackMap locals:
StackMap stack: java.io.FileNotFoundException
8: pop
9: aload 0
iload 3
invokevirtual sun.tools.attach.VirtualMachineImpl.createAttachFile:(I)Ljava/io/File;
astore 4
start local 4 10: iload 3
invokestatic sun.tools.attach.VirtualMachineImpl.sigquit:(I)V
11: aload 0
invokevirtual sun.tools.attach.VirtualMachineImpl.attachTimeout:()J
lstore 5
start local 5 12: lconst_0
lstore 7
start local 7 13: lconst_0
lstore 9
start local 9 14: StackMap locals: sun.tools.attach.VirtualMachineImpl com.sun.tools.attach.spi.AttachProvider java.lang.String int java.io.File long long long
StackMap stack:
lload 9
ldc 100
ladd
lstore 9
15: lload 9
invokestatic java.lang.Thread.sleep:(J)V
16: goto 18
StackMap locals:
StackMap stack: java.lang.InterruptedException
17: pop
18: StackMap locals:
StackMap stack:
aload 0
aload 0
iload 3
invokevirtual sun.tools.attach.VirtualMachineImpl.openDoor:(I)I
putfield sun.tools.attach.VirtualMachineImpl.fd:I
19: goto 21
StackMap locals:
StackMap stack: java.io.FileNotFoundException
20: pop
21: StackMap locals:
StackMap stack:
lload 7
lload 9
ladd
lstore 7
22: lload 7
lload 5
ldc 2
ldiv
lcmp
ifle 24
aload 0
getfield sun.tools.attach.VirtualMachineImpl.fd:I
iconst_m1
if_icmpne 24
23: iload 3
invokestatic sun.tools.attach.VirtualMachineImpl.sigquit:(I)V
24: StackMap locals:
StackMap stack:
lload 7
lload 5
lcmp
ifgt 25
aload 0
getfield sun.tools.attach.VirtualMachineImpl.fd:I
iconst_m1
if_icmpeq 14
25: StackMap locals:
StackMap stack:
aload 0
getfield sun.tools.attach.VirtualMachineImpl.fd:I
iconst_m1
if_icmpne 34
26: new com.sun.tools.attach.AttachNotSupportedException
dup
27: ldc "Unable to open door %s: target process %d doesn't respond within %dms or HotSpot VM not loaded"
iconst_3
anewarray java.lang.Object
dup
iconst_0
28: aload 4
invokevirtual java.io.File.getPath:()Ljava/lang/String;
aastore
dup
iconst_1
iload 3
invokestatic java.lang.Integer.valueOf:(I)Ljava/lang/Integer;
aastore
dup
iconst_2
lload 7
invokestatic java.lang.Long.valueOf:(J)Ljava/lang/Long;
aastore
29: invokestatic java.lang.String.format:(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;
30: invokespecial com.sun.tools.attach.AttachNotSupportedException.<init>:(Ljava/lang/String;)V
athrow
end local 9 end local 7 end local 5 31: StackMap locals: sun.tools.attach.VirtualMachineImpl com.sun.tools.attach.spi.AttachProvider java.lang.String int java.io.File
StackMap stack: java.lang.Throwable
astore 11
32: aload 4
invokevirtual java.io.File.delete:()Z
pop
33: aload 11
athrow
34: StackMap locals:
StackMap stack:
aload 4
invokevirtual java.io.File.delete:()Z
pop
end local 4 35: StackMap locals:
StackMap stack:
getstatic sun.tools.attach.VirtualMachineImpl.$assertionsDisabled:Z
ifne 36
aload 0
getfield sun.tools.attach.VirtualMachineImpl.fd:I
ifge 36
new java.lang.AssertionError
dup
invokespecial java.lang.AssertionError.<init>:()V
athrow
36: StackMap locals:
StackMap stack:
return
end local 3 end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 37 0 this Lsun/tools/attach/VirtualMachineImpl;
0 37 1 provider Lcom/sun/tools/attach/spi/AttachProvider;
0 37 2 vmid Ljava/lang/String;
3 4 3 pid I
6 37 3 pid I
10 35 4 f Ljava/io/File;
12 31 5 timeout J
13 31 7 time_spend J
14 31 9 delay J
Exception table:
from to target type
2 3 4 Class java.lang.NumberFormatException
6 7 8 Class java.io.FileNotFoundException
15 16 17 Class java.lang.InterruptedException
18 19 20 Class java.io.FileNotFoundException
10 31 31 any
Exceptions:
throws com.sun.tools.attach.AttachNotSupportedException, java.io.IOException
MethodParameters:
Name Flags
provider
vmid
public void detach();
descriptor: ()V
flags: (0x0001) ACC_PUBLIC
Code:
stack=2, locals=2, args_size=1
start local 0 0: aload 0
dup
astore 1
monitorenter
1: aload 0
getfield sun.tools.attach.VirtualMachineImpl.fd:I
iconst_m1
if_icmpeq 4
2: aload 0
getfield sun.tools.attach.VirtualMachineImpl.fd:I
invokestatic sun.tools.attach.VirtualMachineImpl.close:(I)V
3: aload 0
iconst_m1
putfield sun.tools.attach.VirtualMachineImpl.fd:I
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=4, locals=9, 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:
aload 0
dup
astore 4
monitorenter
2: aload 0
getfield sun.tools.attach.VirtualMachineImpl.fd:I
iconst_m1
if_icmpne 4
3: new java.io.IOException
dup
ldc "Detached from target VM"
invokespecial java.io.IOException.<init>:(Ljava/lang/String;)V
athrow
4: StackMap locals: sun.tools.attach.VirtualMachineImpl java.lang.String java.lang.Object[] top sun.tools.attach.VirtualMachineImpl
StackMap stack:
aload 0
getfield sun.tools.attach.VirtualMachineImpl.fd:I
istore 3
start local 3 5: aload 4
monitorexit
6: goto 9
end local 3 StackMap locals:
StackMap stack: java.lang.Throwable
7: aload 4
monitorexit
8: athrow
start local 3 9: StackMap locals: sun.tools.attach.VirtualMachineImpl java.lang.String java.lang.Object[] int
StackMap stack:
iload 3
aload 1
aload 2
invokestatic sun.tools.attach.VirtualMachineImpl.enqueue:(ILjava/lang/String;[Ljava/lang/Object;)I
istore 4
start local 4 10: getstatic sun.tools.attach.VirtualMachineImpl.$assertionsDisabled:Z
ifne 11
iload 4
ifge 11
new java.lang.AssertionError
dup
invokespecial java.lang.AssertionError.<init>:()V
athrow
11: StackMap locals: int
StackMap stack:
new sun.tools.attach.VirtualMachineImpl$SocketInputStream
dup
aload 0
iload 4
invokespecial sun.tools.attach.VirtualMachineImpl$SocketInputStream.<init>:(Lsun/tools/attach/VirtualMachineImpl;I)V
astore 5
start local 5 12: aload 0
aload 5
invokevirtual sun.tools.attach.VirtualMachineImpl.readInt:(Ljava/io/InputStream;)I
istore 6
start local 6 13: goto 17
end local 6 StackMap locals: sun.tools.attach.VirtualMachineImpl java.lang.String java.lang.Object[] int int sun.tools.attach.VirtualMachineImpl$SocketInputStream
StackMap stack: java.io.IOException
14: astore 7
start local 7 15: aload 5
invokevirtual sun.tools.attach.VirtualMachineImpl$SocketInputStream.close:()V
16: aload 7
athrow
end local 7 start local 6 17: StackMap locals: int
StackMap stack:
iload 6
ifeq 28
18: aload 0
aload 5
invokevirtual sun.tools.attach.VirtualMachineImpl.readErrorMessage:(Ljava/io/InputStream;)Ljava/lang/String;
astore 7
start local 7 19: aload 5
invokevirtual sun.tools.attach.VirtualMachineImpl$SocketInputStream.close:()V
20: aload 1
ldc "load"
invokevirtual java.lang.String.equals:(Ljava/lang/Object;)Z
ifeq 25
21: ldc "Failed to load agent library"
astore 8
start local 8 22: aload 7
invokevirtual java.lang.String.isEmpty:()Z
ifne 24
23: new java.lang.StringBuilder
dup
aload 8
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 7
invokevirtual java.lang.StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
invokevirtual java.lang.StringBuilder.toString:()Ljava/lang/String;
astore 8
24: StackMap locals: java.lang.String java.lang.String
StackMap stack:
new com.sun.tools.attach.AgentLoadException
dup
aload 8
invokespecial com.sun.tools.attach.AgentLoadException.<init>:(Ljava/lang/String;)V
athrow
end local 8 25: StackMap locals:
StackMap stack:
aload 7
invokevirtual java.lang.String.isEmpty:()Z
ifeq 27
26: ldc "Command failed in target VM"
astore 7
27: StackMap locals:
StackMap stack:
new com.sun.tools.attach.AttachOperationFailedException
dup
aload 7
invokespecial com.sun.tools.attach.AttachOperationFailedException.<init>:(Ljava/lang/String;)V
athrow
end local 7 28: StackMap locals:
StackMap stack:
aload 5
areturn
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 29 0 this Lsun/tools/attach/VirtualMachineImpl;
0 29 1 cmd Ljava/lang/String;
0 29 2 args [Ljava/lang/Object;
5 7 3 door I
9 29 3 door I
10 29 4 s I
12 29 5 sis Lsun/tools/attach/VirtualMachineImpl$SocketInputStream;
13 14 6 completionStatus I
17 29 6 completionStatus I
15 17 7 ioe Ljava/io/IOException;
19 28 7 message Ljava/lang/String;
22 25 8 msg Ljava/lang/String;
Exception table:
from to target type
2 6 7 any
7 8 7 any
12 13 14 Class java.io.IOException
Exceptions:
throws com.sun.tools.attach.AgentLoadException, java.io.IOException
MethodParameters:
Name Flags
cmd
args
private int openDoor(int);
descriptor: (I)I
flags: (0x0002) ACC_PRIVATE
Code:
stack=3, locals=4, args_size=2
start local 0 start local 1 0: new java.lang.StringBuilder
dup
ldc "/tmp/.java_pid"
invokespecial java.lang.StringBuilder.<init>:(Ljava/lang/String;)V
iload 1
invokevirtual java.lang.StringBuilder.append:(I)Ljava/lang/StringBuilder;
invokevirtual java.lang.StringBuilder.toString:()Ljava/lang/String;
astore 2
start local 2 1: aload 0
aload 2
invokestatic sun.tools.attach.VirtualMachineImpl.open:(Ljava/lang/String;)I
putfield sun.tools.attach.VirtualMachineImpl.fd:I
2: aload 2
invokestatic sun.tools.attach.VirtualMachineImpl.checkPermissions:(Ljava/lang/String;)V
3: goto 7
StackMap locals: sun.tools.attach.VirtualMachineImpl int java.lang.String
StackMap stack: java.io.IOException
4: astore 3
start local 3 5: aload 0
getfield sun.tools.attach.VirtualMachineImpl.fd:I
invokestatic sun.tools.attach.VirtualMachineImpl.close:(I)V
6: aload 3
athrow
end local 3 7: StackMap locals:
StackMap stack:
aload 0
getfield sun.tools.attach.VirtualMachineImpl.fd:I
ireturn
end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 8 0 this Lsun/tools/attach/VirtualMachineImpl;
0 8 1 pid I
1 8 2 path Ljava/lang/String;
5 7 3 ioe Ljava/io/IOException;
Exception table:
from to target type
2 3 4 Class java.io.IOException
Exceptions:
throws java.io.IOException
MethodParameters:
Name Flags
pid
private java.io.File createAttachFile(int);
descriptor: (I)Ljava/io/File;
flags: (0x0002) ACC_PRIVATE
Code:
stack=4, locals=5, args_size=2
start local 0 start local 1 0: new java.lang.StringBuilder
dup
ldc ".attach_pid"
invokespecial java.lang.StringBuilder.<init>:(Ljava/lang/String;)V
iload 1
invokevirtual java.lang.StringBuilder.append:(I)Ljava/lang/StringBuilder;
invokevirtual java.lang.StringBuilder.toString:()Ljava/lang/String;
astore 2
start local 2 1: new java.lang.StringBuilder
dup
ldc "/proc/"
invokespecial java.lang.StringBuilder.<init>:(Ljava/lang/String;)V
iload 1
invokevirtual java.lang.StringBuilder.append:(I)Ljava/lang/StringBuilder;
ldc "/cwd/"
invokevirtual java.lang.StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
aload 2
invokevirtual java.lang.StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
invokevirtual java.lang.StringBuilder.toString:()Ljava/lang/String;
astore 3
start local 3 2: new java.io.File
dup
aload 3
invokespecial java.io.File.<init>:(Ljava/lang/String;)V
astore 4
start local 4 3: aload 4
invokevirtual java.io.File.createNewFile:()Z
pop
4: goto 8
StackMap locals: sun.tools.attach.VirtualMachineImpl int java.lang.String java.lang.String java.io.File
StackMap stack: java.io.IOException
5: pop
6: new java.io.File
dup
ldc "/tmp"
aload 2
invokespecial java.io.File.<init>:(Ljava/lang/String;Ljava/lang/String;)V
astore 4
7: aload 4
invokevirtual java.io.File.createNewFile:()Z
pop
8: StackMap locals:
StackMap stack:
aload 4
areturn
end local 4 end local 3 end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 9 0 this Lsun/tools/attach/VirtualMachineImpl;
0 9 1 pid I
1 9 2 fn Ljava/lang/String;
2 9 3 path Ljava/lang/String;
3 9 4 f Ljava/io/File;
Exception table:
from to target type
3 4 5 Class java.io.IOException
Exceptions:
throws java.io.IOException
MethodParameters:
Name Flags
pid
static native int open(java.lang.String);
descriptor: (Ljava/lang/String;)I
flags: (0x0108) ACC_STATIC, ACC_NATIVE
Exceptions:
throws java.io.IOException
MethodParameters:
Name Flags
path
static native void close(int);
descriptor: (I)V
flags: (0x0108) ACC_STATIC, ACC_NATIVE
Exceptions:
throws java.io.IOException
MethodParameters:
Name Flags
fd
static native int read(int, byte[], int, int);
descriptor: (I[BII)I
flags: (0x0108) ACC_STATIC, ACC_NATIVE
Exceptions:
throws java.io.IOException
MethodParameters:
Name Flags
fd
buf
off
buflen
static native void checkPermissions(java.lang.String);
descriptor: (Ljava/lang/String;)V
flags: (0x0108) ACC_STATIC, ACC_NATIVE
Exceptions:
throws java.io.IOException
MethodParameters:
Name Flags
path
static native void sigquit(int);
descriptor: (I)V
flags: (0x0108) ACC_STATIC, ACC_NATIVE
Exceptions:
throws java.io.IOException
MethodParameters:
Name Flags
pid
static native int enqueue(int, java.lang.String, java.lang.Object[]);
descriptor: (ILjava/lang/String;[Ljava/lang/Object;)I
flags: (0x0188) ACC_STATIC, ACC_VARARGS, ACC_NATIVE
Exceptions:
throws java.io.IOException
MethodParameters:
Name Flags
fd
cmd
args
}
SourceFile: "VirtualMachineImpl.java"
NestMembers:
sun.tools.attach.VirtualMachineImpl$SocketInputStream
InnerClasses:
private SocketInputStream = sun.tools.attach.VirtualMachineImpl$SocketInputStream of sun.tools.attach.VirtualMachineImpl