public class com.sun.tools.example.trace.Trace
minor version: 0
major version: 59
flags: flags: (0x0021) ACC_PUBLIC, ACC_SUPER
this_class: com.sun.tools.example.trace.Trace
super_class: java.lang.Object
{
private final com.sun.jdi.VirtualMachine vm;
descriptor: Lcom/sun/jdi/VirtualMachine;
flags: (0x0012) ACC_PRIVATE, ACC_FINAL
private java.lang.Thread errThread;
descriptor: Ljava/lang/Thread;
flags: (0x0002) ACC_PRIVATE
private java.lang.Thread outThread;
descriptor: Ljava/lang/Thread;
flags: (0x0002) ACC_PRIVATE
private int debugTraceMode;
descriptor: I
flags: (0x0002) ACC_PRIVATE
private boolean watchFields;
descriptor: Z
flags: (0x0002) ACC_PRIVATE
private java.lang.String[] excludes;
descriptor: [Ljava/lang/String;
flags: (0x0002) ACC_PRIVATE
public static void main(java.lang.String[]);
descriptor: ([Ljava/lang/String;)V
flags: (0x0009) ACC_PUBLIC, ACC_STATIC
Code:
stack=2, locals=1, args_size=1
start local 0 0: new com.sun.tools.example.trace.Trace
aload 0
invokespecial com.sun.tools.example.trace.Trace.<init>:([Ljava/lang/String;)V
1: return
end local 0 LocalVariableTable:
Start End Slot Name Signature
0 2 0 args [Ljava/lang/String;
MethodParameters:
Name Flags
args
void <init>(java.lang.String[]);
descriptor: ([Ljava/lang/String;)V
flags: (0x0000)
Code:
stack=6, locals=6, args_size=2
start local 0 start local 1 0: aload 0
invokespecial java.lang.Object.<init>:()V
1: aload 0
aconst_null
putfield com.sun.tools.example.trace.Trace.errThread:Ljava/lang/Thread;
2: aload 0
aconst_null
putfield com.sun.tools.example.trace.Trace.outThread:Ljava/lang/Thread;
3: aload 0
iconst_0
putfield com.sun.tools.example.trace.Trace.debugTraceMode:I
4: aload 0
iconst_0
putfield com.sun.tools.example.trace.Trace.watchFields:Z
5: aload 0
iconst_4
anewarray java.lang.String
dup
iconst_0
ldc "java.*"
aastore
dup
iconst_1
ldc "javax.*"
aastore
dup
iconst_2
ldc "sun.*"
aastore
dup
iconst_3
6: ldc "com.sun.*"
aastore
putfield com.sun.tools.example.trace.Trace.excludes:[Ljava/lang/String;
7: new java.io.PrintWriter
dup
getstatic java.lang.System.out:Ljava/io/PrintStream;
invokespecial java.io.PrintWriter.<init>:(Ljava/io/OutputStream;)V
astore 2
start local 2 8: iconst_0
istore 3
start local 3 9: goto 39
10: StackMap locals: com.sun.tools.example.trace.Trace java.lang.String[] java.io.PrintWriter int
StackMap stack:
aload 1
iload 3
aaload
astore 4
start local 4 11: aload 4
iconst_0
invokevirtual java.lang.String.charAt:(I)C
bipush 45
if_icmpeq 13
12: goto 40
13: StackMap locals: java.lang.String
StackMap stack:
aload 4
ldc "-output"
invokevirtual java.lang.String.equals:(Ljava/lang/Object;)Z
ifeq 22
14: new java.io.PrintWriter
dup
new java.io.FileWriter
dup
aload 1
iinc 3 1
iload 3
aaload
invokespecial java.io.FileWriter.<init>:(Ljava/lang/String;)V
invokespecial java.io.PrintWriter.<init>:(Ljava/io/Writer;)V
astore 2
15: goto 38
StackMap locals:
StackMap stack: java.io.IOException
16: astore 5
start local 5 17: getstatic java.lang.System.err:Ljava/io/PrintStream;
new java.lang.StringBuilder
dup
ldc "Cannot open output file: "
invokespecial java.lang.StringBuilder.<init>:(Ljava/lang/String;)V
aload 1
iload 3
aaload
invokevirtual java.lang.StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
18: ldc " - "
invokevirtual java.lang.StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
aload 5
invokevirtual java.lang.StringBuilder.append:(Ljava/lang/Object;)Ljava/lang/StringBuilder;
invokevirtual java.lang.StringBuilder.toString:()Ljava/lang/String;
19: invokevirtual java.io.PrintStream.println:(Ljava/lang/String;)V
20: iconst_1
invokestatic java.lang.System.exit:(I)V
end local 5 21: goto 38
StackMap locals:
StackMap stack:
22: aload 4
ldc "-all"
invokevirtual java.lang.String.equals:(Ljava/lang/Object;)Z
ifeq 25
23: aload 0
iconst_0
anewarray java.lang.String
putfield com.sun.tools.example.trace.Trace.excludes:[Ljava/lang/String;
24: goto 38
StackMap locals:
StackMap stack:
25: aload 4
ldc "-fields"
invokevirtual java.lang.String.equals:(Ljava/lang/Object;)Z
ifeq 28
26: aload 0
iconst_1
putfield com.sun.tools.example.trace.Trace.watchFields:Z
27: goto 38
StackMap locals:
StackMap stack:
28: aload 4
ldc "-dbgtrace"
invokevirtual java.lang.String.equals:(Ljava/lang/Object;)Z
ifeq 31
29: aload 0
aload 1
iinc 3 1
iload 3
aaload
invokestatic java.lang.Integer.parseInt:(Ljava/lang/String;)I
putfield com.sun.tools.example.trace.Trace.debugTraceMode:I
30: goto 38
StackMap locals:
StackMap stack:
31: aload 4
ldc "-help"
invokevirtual java.lang.String.equals:(Ljava/lang/Object;)Z
ifeq 35
32: aload 0
invokevirtual com.sun.tools.example.trace.Trace.usage:()V
33: iconst_0
invokestatic java.lang.System.exit:(I)V
34: goto 38
35: StackMap locals:
StackMap stack:
getstatic java.lang.System.err:Ljava/io/PrintStream;
new java.lang.StringBuilder
dup
ldc "No option: "
invokespecial java.lang.StringBuilder.<init>:(Ljava/lang/String;)V
aload 4
invokevirtual java.lang.StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
invokevirtual java.lang.StringBuilder.toString:()Ljava/lang/String;
invokevirtual java.io.PrintStream.println:(Ljava/lang/String;)V
36: aload 0
invokevirtual com.sun.tools.example.trace.Trace.usage:()V
37: iconst_1
invokestatic java.lang.System.exit:(I)V
end local 4 38: StackMap locals:
StackMap stack:
iinc 3 1
StackMap locals:
StackMap stack:
39: iload 3
aload 1
arraylength
if_icmplt 10
40: StackMap locals:
StackMap stack:
iload 3
aload 1
arraylength
if_icmplt 44
41: getstatic java.lang.System.err:Ljava/io/PrintStream;
ldc "<class> missing"
invokevirtual java.io.PrintStream.println:(Ljava/lang/String;)V
42: aload 0
invokevirtual com.sun.tools.example.trace.Trace.usage:()V
43: iconst_1
invokestatic java.lang.System.exit:(I)V
44: StackMap locals:
StackMap stack:
new java.lang.StringBuffer
dup
invokespecial java.lang.StringBuffer.<init>:()V
astore 4
start local 4 45: aload 4
aload 1
iload 3
aaload
invokevirtual java.lang.StringBuffer.append:(Ljava/lang/String;)Ljava/lang/StringBuffer;
pop
46: iinc 3 1
goto 50
47: StackMap locals: java.lang.StringBuffer
StackMap stack:
aload 4
bipush 32
invokevirtual java.lang.StringBuffer.append:(C)Ljava/lang/StringBuffer;
pop
48: aload 4
aload 1
iload 3
aaload
invokevirtual java.lang.StringBuffer.append:(Ljava/lang/String;)Ljava/lang/StringBuffer;
pop
49: iinc 3 1
StackMap locals:
StackMap stack:
50: iload 3
aload 1
arraylength
if_icmplt 47
51: aload 0
aload 0
aload 4
invokevirtual java.lang.StringBuffer.toString:()Ljava/lang/String;
invokevirtual com.sun.tools.example.trace.Trace.launchTarget:(Ljava/lang/String;)Lcom/sun/jdi/VirtualMachine;
putfield com.sun.tools.example.trace.Trace.vm:Lcom/sun/jdi/VirtualMachine;
52: aload 0
aload 2
invokevirtual com.sun.tools.example.trace.Trace.generateTrace:(Ljava/io/PrintWriter;)V
53: return
end local 4 end local 3 end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 54 0 this Lcom/sun/tools/example/trace/Trace;
0 54 1 args [Ljava/lang/String;
8 54 2 writer Ljava/io/PrintWriter;
9 54 3 inx I
11 38 4 arg Ljava/lang/String;
17 21 5 exc Ljava/io/IOException;
45 54 4 sb Ljava/lang/StringBuffer;
Exception table:
from to target type
14 15 16 Class java.io.IOException
MethodParameters:
Name Flags
args
void generateTrace(java.io.PrintWriter);
descriptor: (Ljava/io/PrintWriter;)V
flags: (0x0000)
Code:
stack=5, locals=3, args_size=2
start local 0 start local 1 0: aload 0
getfield com.sun.tools.example.trace.Trace.vm:Lcom/sun/jdi/VirtualMachine;
aload 0
getfield com.sun.tools.example.trace.Trace.debugTraceMode:I
invokeinterface com.sun.jdi.VirtualMachine.setDebugTraceMode:(I)V
1: new com.sun.tools.example.trace.EventThread
dup
aload 0
getfield com.sun.tools.example.trace.Trace.vm:Lcom/sun/jdi/VirtualMachine;
aload 0
getfield com.sun.tools.example.trace.Trace.excludes:[Ljava/lang/String;
aload 1
invokespecial com.sun.tools.example.trace.EventThread.<init>:(Lcom/sun/jdi/VirtualMachine;[Ljava/lang/String;Ljava/io/PrintWriter;)V
astore 2
start local 2 2: aload 2
aload 0
getfield com.sun.tools.example.trace.Trace.watchFields:Z
invokevirtual com.sun.tools.example.trace.EventThread.setEventRequests:(Z)V
3: aload 2
invokevirtual com.sun.tools.example.trace.EventThread.start:()V
4: aload 0
invokevirtual com.sun.tools.example.trace.Trace.redirectOutput:()V
5: aload 0
getfield com.sun.tools.example.trace.Trace.vm:Lcom/sun/jdi/VirtualMachine;
invokeinterface com.sun.jdi.VirtualMachine.resume:()V
6: aload 2
invokevirtual com.sun.tools.example.trace.EventThread.join:()V
7: aload 0
getfield com.sun.tools.example.trace.Trace.errThread:Ljava/lang/Thread;
invokevirtual java.lang.Thread.join:()V
8: aload 0
getfield com.sun.tools.example.trace.Trace.outThread:Ljava/lang/Thread;
invokevirtual java.lang.Thread.join:()V
9: goto 11
StackMap locals: com.sun.tools.example.trace.Trace java.io.PrintWriter com.sun.tools.example.trace.EventThread
StackMap stack: java.lang.InterruptedException
10: pop
11: StackMap locals:
StackMap stack:
aload 1
invokevirtual java.io.PrintWriter.close:()V
12: return
end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 13 0 this Lcom/sun/tools/example/trace/Trace;
0 13 1 writer Ljava/io/PrintWriter;
2 13 2 eventThread Lcom/sun/tools/example/trace/EventThread;
Exception table:
from to target type
6 9 10 Class java.lang.InterruptedException
MethodParameters:
Name Flags
writer
com.sun.jdi.VirtualMachine launchTarget(java.lang.String);
descriptor: (Ljava/lang/String;)Lcom/sun/jdi/VirtualMachine;
flags: (0x0000)
Code:
stack=5, locals=5, args_size=2
start local 0 start local 1 0: aload 0
invokevirtual com.sun.tools.example.trace.Trace.findLaunchingConnector:()Lcom/sun/jdi/connect/LaunchingConnector;
astore 2
start local 2 1: aload 0
aload 2
aload 1
invokevirtual com.sun.tools.example.trace.Trace.connectorArguments:(Lcom/sun/jdi/connect/LaunchingConnector;Ljava/lang/String;)Ljava/util/Map;
2: astore 3
start local 3 3: aload 2
aload 3
invokeinterface com.sun.jdi.connect.LaunchingConnector.launch:(Ljava/util/Map;)Lcom/sun/jdi/VirtualMachine;
4: areturn
5: StackMap locals: com.sun.tools.example.trace.Trace java.lang.String com.sun.jdi.connect.LaunchingConnector java.util.Map
StackMap stack: java.io.IOException
astore 4
start local 4 6: new java.lang.Error
dup
new java.lang.StringBuilder
dup
ldc "Unable to launch target VM: "
invokespecial java.lang.StringBuilder.<init>:(Ljava/lang/String;)V
aload 4
invokevirtual java.lang.StringBuilder.append:(Ljava/lang/Object;)Ljava/lang/StringBuilder;
invokevirtual java.lang.StringBuilder.toString:()Ljava/lang/String;
invokespecial java.lang.Error.<init>:(Ljava/lang/String;)V
athrow
end local 4 7: StackMap locals:
StackMap stack: com.sun.jdi.connect.IllegalConnectorArgumentsException
astore 4
start local 4 8: new java.lang.Error
dup
new java.lang.StringBuilder
dup
ldc "Internal error: "
invokespecial java.lang.StringBuilder.<init>:(Ljava/lang/String;)V
aload 4
invokevirtual java.lang.StringBuilder.append:(Ljava/lang/Object;)Ljava/lang/StringBuilder;
invokevirtual java.lang.StringBuilder.toString:()Ljava/lang/String;
invokespecial java.lang.Error.<init>:(Ljava/lang/String;)V
athrow
end local 4 9: StackMap locals:
StackMap stack: com.sun.jdi.connect.VMStartException
astore 4
start local 4 10: new java.lang.Error
dup
new java.lang.StringBuilder
dup
ldc "Target VM failed to initialize: "
invokespecial java.lang.StringBuilder.<init>:(Ljava/lang/String;)V
11: aload 4
invokevirtual com.sun.jdi.connect.VMStartException.getMessage:()Ljava/lang/String;
invokevirtual java.lang.StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
invokevirtual java.lang.StringBuilder.toString:()Ljava/lang/String;
12: invokespecial java.lang.Error.<init>:(Ljava/lang/String;)V
athrow
end local 4 end local 3 end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 13 0 this Lcom/sun/tools/example/trace/Trace;
0 13 1 mainArgs Ljava/lang/String;
1 13 2 connector Lcom/sun/jdi/connect/LaunchingConnector;
3 13 3 arguments Ljava/util/Map<Ljava/lang/String;Lcom/sun/jdi/connect/Connector$Argument;>;
6 7 4 exc Ljava/io/IOException;
8 9 4 exc Lcom/sun/jdi/connect/IllegalConnectorArgumentsException;
10 13 4 exc Lcom/sun/jdi/connect/VMStartException;
Exception table:
from to target type
3 4 5 Class java.io.IOException
3 4 7 Class com.sun.jdi.connect.IllegalConnectorArgumentsException
3 4 9 Class com.sun.jdi.connect.VMStartException
MethodParameters:
Name Flags
mainArgs
void redirectOutput();
descriptor: ()V
flags: (0x0000)
Code:
stack=6, locals=2, args_size=1
start local 0 0: aload 0
getfield com.sun.tools.example.trace.Trace.vm:Lcom/sun/jdi/VirtualMachine;
invokeinterface com.sun.jdi.VirtualMachine.process:()Ljava/lang/Process;
astore 1
start local 1 1: aload 0
new com.sun.tools.example.trace.StreamRedirectThread
dup
ldc "error reader"
2: aload 1
invokevirtual java.lang.Process.getErrorStream:()Ljava/io/InputStream;
3: getstatic java.lang.System.err:Ljava/io/PrintStream;
invokespecial com.sun.tools.example.trace.StreamRedirectThread.<init>:(Ljava/lang/String;Ljava/io/InputStream;Ljava/io/OutputStream;)V
4: putfield com.sun.tools.example.trace.Trace.errThread:Ljava/lang/Thread;
5: aload 0
new com.sun.tools.example.trace.StreamRedirectThread
dup
ldc "output reader"
6: aload 1
invokevirtual java.lang.Process.getInputStream:()Ljava/io/InputStream;
7: getstatic java.lang.System.out:Ljava/io/PrintStream;
invokespecial com.sun.tools.example.trace.StreamRedirectThread.<init>:(Ljava/lang/String;Ljava/io/InputStream;Ljava/io/OutputStream;)V
8: putfield com.sun.tools.example.trace.Trace.outThread:Ljava/lang/Thread;
9: aload 0
getfield com.sun.tools.example.trace.Trace.errThread:Ljava/lang/Thread;
invokevirtual java.lang.Thread.start:()V
10: aload 0
getfield com.sun.tools.example.trace.Trace.outThread:Ljava/lang/Thread;
invokevirtual java.lang.Thread.start:()V
11: return
end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 12 0 this Lcom/sun/tools/example/trace/Trace;
1 12 1 process Ljava/lang/Process;
com.sun.jdi.connect.LaunchingConnector findLaunchingConnector();
descriptor: ()Lcom/sun/jdi/connect/LaunchingConnector;
flags: (0x0000)
Code:
stack=3, locals=4, args_size=1
start local 0 0: invokestatic com.sun.jdi.Bootstrap.virtualMachineManager:()Lcom/sun/jdi/VirtualMachineManager;
invokeinterface com.sun.jdi.VirtualMachineManager.allConnectors:()Ljava/util/List;
astore 1
start local 1 1: aload 1
invokeinterface java.util.List.iterator:()Ljava/util/Iterator;
astore 3
goto 5
StackMap locals: com.sun.tools.example.trace.Trace java.util.List top java.util.Iterator
StackMap stack:
2: aload 3
invokeinterface java.util.Iterator.next:()Ljava/lang/Object;
checkcast com.sun.jdi.connect.Connector
astore 2
start local 2 3: aload 2
invokeinterface com.sun.jdi.connect.Connector.name:()Ljava/lang/String;
ldc "com.sun.jdi.CommandLineLaunch"
invokevirtual java.lang.String.equals:(Ljava/lang/Object;)Z
ifeq 5
4: aload 2
checkcast com.sun.jdi.connect.LaunchingConnector
areturn
end local 2 5: StackMap locals:
StackMap stack:
aload 3
invokeinterface java.util.Iterator.hasNext:()Z
ifne 2
6: new java.lang.Error
dup
ldc "No launching connector"
invokespecial java.lang.Error.<init>:(Ljava/lang/String;)V
athrow
end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 7 0 this Lcom/sun/tools/example/trace/Trace;
1 7 1 connectors Ljava/util/List<Lcom/sun/jdi/connect/Connector;>;
3 5 2 connector Lcom/sun/jdi/connect/Connector;
java.util.Map<java.lang.String, com.sun.jdi.connect.Connector$Argument> connectorArguments(com.sun.jdi.connect.LaunchingConnector, java.lang.String);
descriptor: (Lcom/sun/jdi/connect/LaunchingConnector;Ljava/lang/String;)Ljava/util/Map;
flags: (0x0000)
Code:
stack=3, locals=6, args_size=3
start local 0 start local 1 start local 2 0: aload 1
invokeinterface com.sun.jdi.connect.LaunchingConnector.defaultArguments:()Ljava/util/Map;
astore 3
start local 3 1: aload 3
ldc "main"
invokeinterface java.util.Map.get:(Ljava/lang/Object;)Ljava/lang/Object;
checkcast com.sun.jdi.connect.Connector$Argument
2: astore 4
start local 4 3: aload 4
ifnonnull 5
4: new java.lang.Error
dup
ldc "Bad launching connector"
invokespecial java.lang.Error.<init>:(Ljava/lang/String;)V
athrow
5: StackMap locals: java.util.Map com.sun.jdi.connect.Connector$Argument
StackMap stack:
aload 4
aload 2
invokeinterface com.sun.jdi.connect.Connector$Argument.setValue:(Ljava/lang/String;)V
6: aload 0
getfield com.sun.tools.example.trace.Trace.watchFields:Z
ifeq 12
7: aload 3
ldc "options"
invokeinterface java.util.Map.get:(Ljava/lang/Object;)Ljava/lang/Object;
checkcast com.sun.jdi.connect.Connector$Argument
8: astore 5
start local 5 9: aload 5
ifnonnull 11
10: new java.lang.Error
dup
ldc "Bad launching connector"
invokespecial java.lang.Error.<init>:(Ljava/lang/String;)V
athrow
11: StackMap locals: com.sun.jdi.connect.Connector$Argument
StackMap stack:
aload 5
ldc "-classic"
invokeinterface com.sun.jdi.connect.Connector$Argument.setValue:(Ljava/lang/String;)V
end local 5 12: StackMap locals:
StackMap stack:
aload 3
areturn
end local 4 end local 3 end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 13 0 this Lcom/sun/tools/example/trace/Trace;
0 13 1 connector Lcom/sun/jdi/connect/LaunchingConnector;
0 13 2 mainArgs Ljava/lang/String;
1 13 3 arguments Ljava/util/Map<Ljava/lang/String;Lcom/sun/jdi/connect/Connector$Argument;>;
3 13 4 mainArg Lcom/sun/jdi/connect/Connector$Argument;
9 12 5 optionArg Lcom/sun/jdi/connect/Connector$Argument;
Signature: (Lcom/sun/jdi/connect/LaunchingConnector;Ljava/lang/String;)Ljava/util/Map<Ljava/lang/String;Lcom/sun/jdi/connect/Connector$Argument;>;
MethodParameters:
Name Flags
connector
mainArgs
void usage();
descriptor: ()V
flags: (0x0000)
Code:
stack=2, locals=1, args_size=1
start local 0 0: getstatic java.lang.System.err:Ljava/io/PrintStream;
ldc "Usage: java Trace <options> <class> <args>"
invokevirtual java.io.PrintStream.println:(Ljava/lang/String;)V
1: getstatic java.lang.System.err:Ljava/io/PrintStream;
ldc "<options> are:"
invokevirtual java.io.PrintStream.println:(Ljava/lang/String;)V
2: getstatic java.lang.System.err:Ljava/io/PrintStream;
3: ldc " -output <filename> Output trace to <filename>"
4: invokevirtual java.io.PrintStream.println:(Ljava/lang/String;)V
5: getstatic java.lang.System.err:Ljava/io/PrintStream;
6: ldc " -all Include system classes in output"
7: invokevirtual java.io.PrintStream.println:(Ljava/lang/String;)V
8: getstatic java.lang.System.err:Ljava/io/PrintStream;
9: ldc " -help Print this help message"
10: invokevirtual java.io.PrintStream.println:(Ljava/lang/String;)V
11: getstatic java.lang.System.err:Ljava/io/PrintStream;
ldc "<class> is the program to trace"
invokevirtual java.io.PrintStream.println:(Ljava/lang/String;)V
12: getstatic java.lang.System.err:Ljava/io/PrintStream;
ldc "<args> are the arguments to <class>"
invokevirtual java.io.PrintStream.println:(Ljava/lang/String;)V
13: return
end local 0 LocalVariableTable:
Start End Slot Name Signature
0 14 0 this Lcom/sun/tools/example/trace/Trace;
}
SourceFile: "Trace.java"
InnerClasses:
public abstract Argument = com.sun.jdi.connect.Connector$Argument of com.sun.jdi.connect.Connector