com.android.dx.command.dump
Class BlockDumper

java.lang.Object
  extended by com.android.dx.command.dump.BaseDumper
      extended by com.android.dx.command.dump.BlockDumper
All Implemented Interfaces:
ParseObserver
Direct Known Subclasses:
SsaDumper

public class BlockDumper
extends BaseDumper

Utility to dump basic block info from methods in a human-friendly form.


Field Summary
protected  DirectClassFile classFile
          null-ok; the class file object being constructed; becomes non-null during dump(byte[], java.io.PrintStream, java.lang.String, boolean, com.android.dx.command.dump.Args)
protected  boolean suppressDump
          whether or not to suppress dumping
 
Fields inherited from class com.android.dx.command.dump.BaseDumper
args
 
Method Summary
 void changeIndent(int indentDelta)
          Indicate that the level of indentation for a dump should increase or decrease (positive or negative argument, respectively).
 void dump()
          Does the dumping.
static void dump(byte[] bytes, PrintStream out, String filePath, boolean rop, com.android.dx.command.dump.Args args)
          Dumps the given array, interpreting it as a class file and dumping methods with indications of block-level stuff.
 void endParsingMember(ByteArray bytes, int offset, String name, String descriptor, Member member)
          Indicate that a particular member is no longer being parsed.
 void parsed(ByteArray bytes, int offset, int len, String human)
          Indicate that some parsing happened.
protected  boolean shouldDumpMethod(String name)
           
 void startParsingMember(ByteArray bytes, int offset, String name, String descriptor)
          Indicate that a particular member is now being parsed.
 
Methods inherited from class com.android.dx.command.dump.BaseDumper
getAt, getBytes, getFilePath, getRawBytes, getStrictParse, getWidth1, getWidth2, hexDump, print, println, setAt, twoColumns
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

classFile

protected DirectClassFile classFile
null-ok; the class file object being constructed; becomes non-null during dump(byte[], java.io.PrintStream, java.lang.String, boolean, com.android.dx.command.dump.Args)


suppressDump

protected boolean suppressDump
whether or not to suppress dumping

Method Detail

dump

public static void dump(byte[] bytes,
                        PrintStream out,
                        String filePath,
                        boolean rop,
                        com.android.dx.command.dump.Args args)
Dumps the given array, interpreting it as a class file and dumping methods with indications of block-level stuff.

Parameters:
bytes - non-null; bytes of the (alleged) class file
out - non-null; where to dump to
filePath - the file path for the class, excluding any base directory specification
rop - whether or not to registerize (make rop blocks)
args - commandline parsedArgs

dump

public void dump()
Does the dumping.


changeIndent

public void changeIndent(int indentDelta)
Indicate that the level of indentation for a dump should increase or decrease (positive or negative argument, respectively).

Specified by:
changeIndent in interface ParseObserver
Overrides:
changeIndent in class BaseDumper
Parameters:
indentDelta - the amount to change indentation

parsed

public void parsed(ByteArray bytes,
                   int offset,
                   int len,
                   String human)
Indicate that some parsing happened.

Specified by:
parsed in interface ParseObserver
Overrides:
parsed in class BaseDumper
Parameters:
bytes - non-null; the source that was parsed
offset - offset into bytes for what was parsed
len - number of bytes parsed
human - non-null; human form for what was parsed

shouldDumpMethod

protected boolean shouldDumpMethod(String name)
Parameters:
name - method name
Returns:
true if this method should be dumped

startParsingMember

public void startParsingMember(ByteArray bytes,
                               int offset,
                               String name,
                               String descriptor)
Indicate that a particular member is now being parsed.

Specified by:
startParsingMember in interface ParseObserver
Overrides:
startParsingMember in class BaseDumper
Parameters:
bytes - non-null; the source that is being parsed
offset - offset into bytes for the start of the member
name - non-null; name of the member
descriptor - non-null; descriptor of the member

endParsingMember

public void endParsingMember(ByteArray bytes,
                             int offset,
                             String name,
                             String descriptor,
                             Member member)
Indicate that a particular member is no longer being parsed.

Specified by:
endParsingMember in interface ParseObserver
Overrides:
endParsingMember in class BaseDumper
Parameters:
bytes - non-null; the source that was parsed
offset - offset into bytes for the end of the member
name - non-null; name of the member
descriptor - non-null; descriptor of the member
member - non-null; the actual member that was parsed


Copyright © 2015. All rights reserved.