Inheritance Graphs

Inheritance GraphThe Dump tool is now able to export an inheritance graph for a given ABC/SWC/SWF file. This is a very easy and nice way to look at the classes and their relationships. The small image shows the graph for one ABC file of the AudioTool. I think this it is pretty neat.

You will need a program like Graphviz to visualize the exported DOT file. If you want to export the inheritance graph you basically writejava -jar dump.jar -input file.swf -ig. I think this shows a really cool feature of Apparat. It is also very easy to reverse engineer a UML diagram. I am not interested in such a feature but maybe someone else.

Update: Here is a full-size example for the inheritance graph of the unfinished ImageProcessing library I am currently working on.

ImageProcessing Library Inheritance Graph

Related Posts

10 Responses to “Inheritance Graphs”


  1. 1 Macaca

    Could you link to a full size example?

  2. 2 joa

    Just added the complete graph of the new imageprocessing library.

  3. 3 Marcus Stade

    Hey Joa! This looks mighty interesting, but I can’t get it to work. I get the following exception:

    Exception in thread “main” java.lang.UnsupportedClassVersionError: Bad version number in .class file
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:675)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
    at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:316)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:280)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:374)

  4. 4 Marcus Stade

    I noticed the comments in your earlier post:
    http://blog.joa-ebert.com/2009/08/17/dump-disassembler/

    I am indeed running this on a Mac and I’ll give this a shot to see if I can get it running!

  5. 5 Marcus Stade

    So I tried the suggestions in the other post, but I still can’t get it to work. Now it complains about being OutOfMemory. While my swf is rather complex I’d imagine, I don’t think it’d warrant being out of memory when I have 1.5GB+ free memory. Is there some Java setting I must change in order to get this working?

  6. 6 Marcus Stade

    Here’s the callstack:

    [i] Running tool “Dump” …
    [i] Exporting inheritance graph to “frame1.dot”.
    Exception in thread “main” java.lang.OutOfMemoryError: Java heap space
    at com.joa_ebert.apparat.abc.bytecode.OperationFactory.create(Unknown Source)
    at com.joa_ebert.apparat.abc.bytecode.BytecodeDecoder.decode(Unknown Source)
    at com.joa_ebert.apparat.abc.bytecode.BytecodeDecoder.decode(Unknown Source)
    at com.joa_ebert.apparat.abc.bytecode.BytecodeDecoder.decode(Unknown Source)
    at com.joa_ebert.apparat.abc.Abc.readMethodBodies(Unknown Source)
    at com.joa_ebert.apparat.abc.Abc.read(Unknown Source)
    at com.joa_ebert.apparat.abc.Abc.read(Unknown Source)
    at com.joa_ebert.apparat.abc.Abc.read(Unknown Source)
    at com.joa_ebert.apparat.tools.dump.Dump.run(Unknown Source)
    at com.joa_ebert.apparat.tools.ToolRunner.run(Unknown Source)
    at com.joa_ebert.apparat.tools.dump.Dump.main(Unknown Source)

  7. 7 Marcus Stade

    Adding -Xmx1024m did the trick!

  8. 8 joa

    Well yes, Java is a little bit annoying when it comes to configuration. I think I will have to write some binaries that launch the tools and do the configuration part automatically.

  1. 1 Twitter Trackbacks for Inheritance Graphs at blog.joa-ebert.com – Blog of Joa Ebert [joa-ebert.com] on Topsy.com
  2. 2 » Day Two Marc Hibbins

Leave a Reply