public class sun.tools.attach.BsdVirtualMachine extends sun.tools.attach.HotSpotVirtualMachine
minor version: 0
major version: 59
flags: flags: (0x0021) ACC_PUBLIC, ACC_SUPER
this_class: sun.tools.attach.BsdVirtualMachine
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
java.lang.String path;
descriptor: Ljava/lang/String;
flags: (0x0000)
private static final java.lang.String PROTOCOL_VERSION;
descriptor: Ljava/lang/String;
flags: (0x001a) ACC_PRIVATE, ACC_STATIC, ACC_FINAL
ConstantValue: "1"
private static final int ATTACH_ERROR_BADVERSION;
descriptor: I
flags: (0x001a) ACC_PRIVATE, ACC_STATIC, ACC_FINAL
ConstantValue: 101
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/BsdVirtualMachine;
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.BsdVirtualMachine.$assertionsDisabled:Z
3: ldc "attach"
invokestatic java.lang.System.loadLibrary:(Ljava/lang/String;)V
4: invokestatic sun.tools.attach.BsdVirtualMachine.getTempDir:()Ljava/lang/String;
putstatic sun.tools.attach.BsdVirtualMachine.tmpdir:Ljava/lang/String;
5: 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=10, 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.BsdVirtualMachine 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
aload 0
iload 3
invokevirtual sun.tools.attach.BsdVirtualMachine.findSocketFile:(I)Ljava/lang/String;
putfield sun.tools.attach.BsdVirtualMachine.path:Ljava/lang/String;
6: aload 0
getfield sun.tools.attach.BsdVirtualMachine.path:Ljava/lang/String;
ifnonnull 27
7: new java.io.File
dup
getstatic sun.tools.attach.BsdVirtualMachine.tmpdir:Ljava/lang/String;
new java.lang.StringBuilder
dup
ldc ".attach_pid"
invokespecial java.lang.StringBuilder.<init>:(Ljava/lang/String;)V
iload 3
invokevirtual java.lang.StringBuilder.append:(I)Ljava/lang/StringBuilder;
invokevirtual java.lang.StringBuilder.toString:()Ljava/lang/String;
invokespecial java.io.File.<init>:(Ljava/lang/String;Ljava/lang/String;)V
astore 4
start local 4 8: aload 4
invokevirtual java.io.File.getPath:()Ljava/lang/String;
invokestatic sun.tools.attach.BsdVirtualMachine.createAttachFile:(Ljava/lang/String;)V
9: iload 3
invokestatic sun.tools.attach.BsdVirtualMachine.sendQuitTo:(I)V
10: iconst_0
istore 5
start local 5 11: ldc 200
lstore 6
start local 6 12: aload 0
invokevirtual sun.tools.attach.BsdVirtualMachine.attachTimeout:()J
lload 6
ldiv
l2i
istore 8
start local 8 13: StackMap locals: sun.tools.attach.BsdVirtualMachine com.sun.tools.attach.spi.AttachProvider java.lang.String int java.io.File int long int
StackMap stack:
lload 6
invokestatic java.lang.Thread.sleep:(J)V
14: goto 16
StackMap locals:
StackMap stack: java.lang.InterruptedException
15: pop
16: StackMap locals:
StackMap stack:
aload 0
aload 0
iload 3
invokevirtual sun.tools.attach.BsdVirtualMachine.findSocketFile:(I)Ljava/lang/String;
putfield sun.tools.attach.BsdVirtualMachine.path:Ljava/lang/String;
17: iinc 5 1
18: iload 5
iload 8
if_icmpgt 19
aload 0
getfield sun.tools.attach.BsdVirtualMachine.path:Ljava/lang/String;
ifnull 13
19: StackMap locals:
StackMap stack:
aload 0
getfield sun.tools.attach.BsdVirtualMachine.path:Ljava/lang/String;
ifnonnull 26
20: new com.sun.tools.attach.AttachNotSupportedException
dup
21: ldc "Unable to open socket file: target process not responding or HotSpot VM not loaded"
22: invokespecial com.sun.tools.attach.AttachNotSupportedException.<init>:(Ljava/lang/String;)V
athrow
end local 8 end local 6 end local 5 23: StackMap locals: sun.tools.attach.BsdVirtualMachine com.sun.tools.attach.spi.AttachProvider java.lang.String int java.io.File
StackMap stack: java.lang.Throwable
astore 9
24: aload 4
invokevirtual java.io.File.delete:()Z
pop
25: aload 9
athrow
26: StackMap locals:
StackMap stack:
aload 4
invokevirtual java.io.File.delete:()Z
pop
end local 4 27: StackMap locals:
StackMap stack:
aload 0
getfield sun.tools.attach.BsdVirtualMachine.path:Ljava/lang/String;
invokestatic sun.tools.attach.BsdVirtualMachine.checkPermissions:(Ljava/lang/String;)V
28: invokestatic sun.tools.attach.BsdVirtualMachine.socket:()I
istore 4
start local 4 29: iload 4
aload 0
getfield sun.tools.attach.BsdVirtualMachine.path:Ljava/lang/String;
invokestatic sun.tools.attach.BsdVirtualMachine.connect:(ILjava/lang/String;)V
30: goto 34
StackMap locals: sun.tools.attach.BsdVirtualMachine com.sun.tools.attach.spi.AttachProvider java.lang.String int int
StackMap stack: java.lang.Throwable
31: astore 5
32: iload 4
invokestatic sun.tools.attach.BsdVirtualMachine.close:(I)V
33: aload 5
athrow
34: StackMap locals:
StackMap stack:
iload 4
invokestatic sun.tools.attach.BsdVirtualMachine.close:(I)V
35: return
end local 4 end local 3 end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 36 0 this Lsun/tools/attach/BsdVirtualMachine;
0 36 1 provider Lcom/sun/tools/attach/spi/AttachProvider;
0 36 2 vmid Ljava/lang/String;
2 3 3 pid I
5 36 3 pid I
8 27 4 f Ljava/io/File;
11 23 5 i I
12 23 6 delay J
13 23 8 retries I
29 36 4 s I
Exception table:
from to target type
1 2 3 Class java.lang.NumberFormatException
13 14 15 Class java.lang.InterruptedException
9 23 23 any
29 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.BsdVirtualMachine.path:Ljava/lang/String;
ifnull 3
2: aload 0
aconst_null
putfield sun.tools.attach.BsdVirtualMachine.path:Ljava/lang/String;
3: StackMap locals: sun.tools.attach.BsdVirtualMachine
StackMap stack:
aload 1
monitorexit
4: goto 7
StackMap locals:
StackMap stack: java.lang.Throwable
5: aload 1
monitorexit
6: athrow
7: StackMap locals:
StackMap stack:
return
end local 0 LocalVariableTable:
Start End Slot Name Signature
0 8 0 this Lsun/tools/attach/BsdVirtualMachine;
Exception table:
from to target type
1 4 5 any
5 6 5 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.BsdVirtualMachine.$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.BsdVirtualMachine.path:Ljava/lang/String;
ifnonnull 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.BsdVirtualMachine java.lang.String java.lang.Object[] top sun.tools.attach.BsdVirtualMachine
StackMap stack:
aload 0
getfield sun.tools.attach.BsdVirtualMachine.path:Ljava/lang/String;
astore 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.BsdVirtualMachine java.lang.String java.lang.Object[] java.lang.String
StackMap stack:
invokestatic sun.tools.attach.BsdVirtualMachine.socket:()I
istore 4
start local 4 10: iload 4
aload 3
invokestatic sun.tools.attach.BsdVirtualMachine.connect:(ILjava/lang/String;)V
11: goto 15
StackMap locals: sun.tools.attach.BsdVirtualMachine java.lang.String java.lang.Object[] java.lang.String int
StackMap stack: java.io.IOException
12: astore 5
start local 5 13: iload 4
invokestatic sun.tools.attach.BsdVirtualMachine.close:(I)V
14: aload 5
athrow
end local 5 15: StackMap locals:
StackMap stack:
aconst_null
astore 5
start local 5 16: aload 0
iload 4
ldc "1"
invokevirtual sun.tools.attach.BsdVirtualMachine.writeString:(ILjava/lang/String;)V
17: aload 0
iload 4
aload 1
invokevirtual sun.tools.attach.BsdVirtualMachine.writeString:(ILjava/lang/String;)V
18: iconst_0
istore 6
start local 6 19: goto 25
20: StackMap locals: java.io.IOException int
StackMap stack:
iload 6
aload 2
arraylength
if_icmpge 23
aload 2
iload 6
aaload
ifnull 23
21: aload 0
iload 4
aload 2
iload 6
aaload
checkcast java.lang.String
invokevirtual sun.tools.attach.BsdVirtualMachine.writeString:(ILjava/lang/String;)V
22: goto 24
23: StackMap locals:
StackMap stack:
aload 0
iload 4
ldc ""
invokevirtual sun.tools.attach.BsdVirtualMachine.writeString:(ILjava/lang/String;)V
24: StackMap locals:
StackMap stack:
iinc 6 1
StackMap locals:
StackMap stack:
25: iload 6
iconst_3
if_icmplt 20
end local 6 26: goto 29
StackMap locals: sun.tools.attach.BsdVirtualMachine java.lang.String java.lang.Object[] java.lang.String int java.io.IOException
StackMap stack: java.io.IOException
27: astore 6
start local 6 28: aload 6
astore 5
end local 6 29: StackMap locals:
StackMap stack:
new sun.tools.attach.BsdVirtualMachine$SocketInputStream
dup
aload 0
iload 4
invokespecial sun.tools.attach.BsdVirtualMachine$SocketInputStream.<init>:(Lsun/tools/attach/BsdVirtualMachine;I)V
astore 6
start local 6 30: aload 0
aload 6
invokevirtual sun.tools.attach.BsdVirtualMachine.readInt:(Ljava/io/InputStream;)I
istore 7
start local 7 31: goto 37
end local 7 StackMap locals: sun.tools.attach.BsdVirtualMachine java.lang.String java.lang.Object[] java.lang.String int java.io.IOException sun.tools.attach.BsdVirtualMachine$SocketInputStream
StackMap stack: java.io.IOException
32: astore 8
start local 8 33: aload 6
invokevirtual sun.tools.attach.BsdVirtualMachine$SocketInputStream.close:()V
34: aload 5
ifnull 36
35: aload 5
athrow
36: StackMap locals: sun.tools.attach.BsdVirtualMachine java.lang.String java.lang.Object[] java.lang.String int java.io.IOException sun.tools.attach.BsdVirtualMachine$SocketInputStream top java.io.IOException
StackMap stack:
aload 8
athrow
end local 8 start local 7 37: StackMap locals: sun.tools.attach.BsdVirtualMachine java.lang.String java.lang.Object[] java.lang.String int java.io.IOException sun.tools.attach.BsdVirtualMachine$SocketInputStream int
StackMap stack:
iload 7
ifeq 44
38: aload 6
invokevirtual sun.tools.attach.BsdVirtualMachine$SocketInputStream.close:()V
39: iload 7
bipush 101
if_icmpne 41
40: new java.io.IOException
dup
ldc "Protocol mismatch with target VM"
invokespecial java.io.IOException.<init>:(Ljava/lang/String;)V
athrow
41: StackMap locals:
StackMap stack:
aload 1
ldc "load"
invokevirtual java.lang.String.equals:(Ljava/lang/Object;)Z
ifeq 43
42: new com.sun.tools.attach.AgentLoadException
dup
ldc "Failed to load agent library"
invokespecial com.sun.tools.attach.AgentLoadException.<init>:(Ljava/lang/String;)V
athrow
43: StackMap locals:
StackMap stack:
new java.io.IOException
dup
ldc "Command failed in target VM"
invokespecial java.io.IOException.<init>:(Ljava/lang/String;)V
athrow
44: StackMap locals:
StackMap stack:
aload 6
areturn
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 45 0 this Lsun/tools/attach/BsdVirtualMachine;
0 45 1 cmd Ljava/lang/String;
0 45 2 args [Ljava/lang/Object;
5 7 3 p Ljava/lang/String;
9 45 3 p Ljava/lang/String;
10 45 4 s I
13 15 5 x Ljava/io/IOException;
16 45 5 ioe Ljava/io/IOException;
19 26 6 i I
28 29 6 x Ljava/io/IOException;
30 45 6 sis Lsun/tools/attach/BsdVirtualMachine$SocketInputStream;
31 32 7 completionStatus I
37 45 7 completionStatus I
33 37 8 x Ljava/io/IOException;
Exception table:
from to target type
2 6 7 any
7 8 7 any
10 11 12 Class java.io.IOException
16 26 27 Class java.io.IOException
30 31 32 Class java.io.IOException
Exceptions:
throws com.sun.tools.attach.AgentLoadException, java.io.IOException
MethodParameters:
Name Flags
cmd
args
private java.lang.String findSocketFile(int);
descriptor: (I)Ljava/lang/String;
flags: (0x0002) ACC_PRIVATE
Code:
stack=4, locals=4, args_size=2
start local 0 start local 1 0: new java.lang.StringBuilder
dup
ldc ".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: new java.io.File
dup
getstatic sun.tools.attach.BsdVirtualMachine.tmpdir:Ljava/lang/String;
aload 2
invokespecial java.io.File.<init>:(Ljava/lang/String;Ljava/lang/String;)V
astore 3
start local 3 2: aload 3
invokevirtual java.io.File.exists:()Z
ifeq 3
aload 3
invokevirtual java.io.File.getPath:()Ljava/lang/String;
goto 4
StackMap locals: java.lang.String java.io.File
StackMap stack:
3: aconst_null
StackMap locals:
StackMap stack: java.lang.String
4: areturn
end local 3 end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 5 0 this Lsun/tools/attach/BsdVirtualMachine;
0 5 1 pid I
1 5 2 fn Ljava/lang/String;
2 5 3 f Ljava/io/File;
MethodParameters:
Name Flags
pid
private void writeString(int, java.lang.String);
descriptor: (ILjava/lang/String;)V
flags: (0x0002) ACC_PRIVATE
Code:
stack=4, locals=4, args_size=3
start local 0 start local 1 start local 2 0: aload 2
invokevirtual java.lang.String.length:()I
ifle 6
1: aload 2
ldc "UTF-8"
invokevirtual java.lang.String.getBytes:(Ljava/lang/String;)[B
astore 3
start local 3 2: goto 5
end local 3 StackMap locals:
StackMap stack: java.io.UnsupportedEncodingException
3: pop
4: new java.lang.InternalError
dup
invokespecial java.lang.InternalError.<init>:()V
athrow
start local 3 5: StackMap locals: byte[]
StackMap stack:
iload 1
aload 3
iconst_0
aload 3
arraylength
invokestatic sun.tools.attach.BsdVirtualMachine.write:(I[BII)V
end local 3 6: StackMap locals:
StackMap stack:
iconst_1
newarray 8
astore 3
start local 3 7: aload 3
iconst_0
iconst_0
bastore
8: iload 1
aload 3
iconst_0
iconst_1
invokestatic sun.tools.attach.BsdVirtualMachine.write:(I[BII)V
9: return
end local 3 end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 10 0 this Lsun/tools/attach/BsdVirtualMachine;
0 10 1 fd I
0 10 2 s Ljava/lang/String;
2 3 3 b [B
5 6 3 b [B
7 10 3 b [B
Exception table:
from to target type
1 2 3 Class java.io.UnsupportedEncodingException
Exceptions:
throws java.io.IOException
MethodParameters:
Name Flags
fd
s
static native void sendQuitTo(int);
descriptor: (I)V
flags: (0x0108) ACC_STATIC, ACC_NATIVE
Exceptions:
throws java.io.IOException
MethodParameters:
Name Flags
pid
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 int socket();
descriptor: ()I
flags: (0x0108) ACC_STATIC, ACC_NATIVE
Exceptions:
throws java.io.IOException
static native void connect(int, java.lang.String);
descriptor: (ILjava/lang/String;)V
flags: (0x0108) ACC_STATIC, ACC_NATIVE
Exceptions:
throws java.io.IOException
MethodParameters:
Name Flags
fd
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 write(int, byte[], int, int);
descriptor: (I[BII)V
flags: (0x0108) ACC_STATIC, ACC_NATIVE
Exceptions:
throws java.io.IOException
MethodParameters:
Name Flags
fd
buf
off
bufLen
static native void createAttachFile(java.lang.String);
descriptor: (Ljava/lang/String;)V
flags: (0x0108) ACC_STATIC, ACC_NATIVE
MethodParameters:
Name Flags
path
static native java.lang.String getTempDir();
descriptor: ()Ljava/lang/String;
flags: (0x0108) ACC_STATIC, ACC_NATIVE
}
SourceFile: "BsdVirtualMachine.java"
NestMembers:
sun.tools.attach.BsdVirtualMachine$SocketInputStream
InnerClasses:
private SocketInputStream = sun.tools.attach.BsdVirtualMachine$SocketInputStream of sun.tools.attach.BsdVirtualMachine