Bytecode Visualizer

Inspect, understand and debug Java bytecode, no matter if you have the corresponding source.

Sourcecode Visualizer

Draws a control flow graph alongside of Java source code.

Control Flow Graph Factory

Eclipse plugin for generating, editing and exporting control flow graphs.

Control Flow Graph Factory DOT export example

Control Flow Graph

The following control flow graph is a bytecode graph generated by Control Flow Factory:

Control flow graph of the method C1.t()

Back to the top

DOT export — plain

The Control Flow Graph Factory export of the graph C1.t() without visual or geometry information is presented below:

Control flow graph plain

2 [label="" ];
2 -> 3 [label="" ];
3 -> 4 [label="0" ];
4 -> 5 [label="" ];
5 -> 6 [label="" ];
6 -> 7 [label="" ];
7 -> 8 [label="" ];
3 -> 9 [label="1" ];
9 -> 10 [label="" ];
10 -> 11 [label="" ];
11 -> 12 [label="true" ];
3 -> 13 [label="default" ];
8 -> 13 [label="" ];
11 -> 13 [label="false" ];
12 -> 13 [label="" ];
13 -> 15 [label="" ];
}
]]>

Each node has a unique ID and a label. The label includes the information of the original code label="29 putstatic". In this example the information is the bytecode instruction.

The label of an edge may have control flow specific information. In the example the outgoing edges of the switch table value and decision are labeled. The label may be empty.

Back to the top

DOT export with visual information

The export of the graph C1.t() with visual information is presented below:

Control flow graph plain

2 [label="", style=dashed ];
2 -> 3 [label="", style=solid ];
3 -> 4 [label="0", style=solid ];
4 -> 5 [label="", style=solid ];
5 -> 6 [label="", style=solid ];
6 -> 7 [label="", style=solid ];
7 -> 8 [label="", style=solid ];
3 -> 9 [label="1", style=solid ];
9 -> 10 [label="", style=solid ];
10 -> 11 [label="", style=solid ];
11 -> 12 [label="true", style=solid ];
3 -> 13 [label="default", style=solid ];
8 -> 13 [label="", style=solid ];
11 -> 13 [label="false", style=solid ];
12 -> 13 [label="", style=solid ];
13 -> 15 [label="", style=dashed ];
}
]]>

Each node has a unique ID and a label like the graph in the example above and the information about shape, style and node color (shape=hexagon, style="filled", fillcolor="#decd87"). The shape is one of the shapes defined in the DOT specification: diamond, parallelogram, box, invhouse, hexagon or ellipse. More shapes are available at the GraphViz info page about Node Shapes. The style is always filled. The node color is specified in the red-green-blue (RGB) format. Three hexadecimal numbers between 00 and FF, preceded by the character # (e.g. #decd87).

An edge includes the information about line style: solid or dashed. Usually the virtual edges are represented by dashed lines.

Back to the top

DOT export with visual and geometric information

The export of the graph C1.t() with visual and geometry information is presented below:

Control flow graph plain

 2 [label="", style=dashed ];
 2 -> 3 [label="", style=solid ];
 3 -> 4 [label="0", style=solid ];
 4 -> 5 [label="", style=solid ];
 5 -> 6 [label="", style=solid ];
 6 -> 7 [label="", style=solid ];
 7 -> 8 [label="", style=solid ];
 3 -> 9 [label="1", style=solid ];
 9 -> 10 [label="", style=solid ];
 10 -> 11 [label="", style=solid ];
 11 -> 12 [label="true", style=solid ];
 3 -> 13 [label="default", style=solid ];
 8 -> 13 [label="", style=solid ];
 11 -> 13 [label="false", style=solid ];
 12 -> 13 [label="", style=solid ];
 13 -> 15 [label="", style=dashed ];
}
]]>

In this graph each node additionally includes the following parameters:

  • fixedsize=true
  • fontsize=12
  • width=0.85
  • height=0.36

The parameter fixedsize and fontsize are always set accordingly to true and 12. The parameters width and height are set to the actual size of the nodes in inches.

Back to the top