Package com.android.dx.command.dump
Class BlockDumper
java.lang.Object
com.android.dx.command.dump.BaseDumper
com.android.dx.command.dump.BlockDumper
- All Implemented Interfaces:
ParseObserver
- Direct Known Subclasses:
SsaDumper
Utility to dump basic block info from methods in a human-friendly form.
-
Field Summary
Modifier and TypeFieldDescriptionprotected DirectClassFile
null-ok;
the class file object being constructed; becomes non-null duringdump(byte[], java.io.PrintStream, java.lang.String, boolean, com.android.dx.command.dump.Args)
protected boolean
whether or not to suppress dumpingFields inherited from class com.android.dx.command.dump.BaseDumper
args, dexOptions
-
Method Summary
Modifier and TypeMethodDescriptionvoid
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
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
getBytes, getFilePath, getRawBytes, getReadBytes, getStrictParse, getWidth1, getWidth2, hexDump, print, println, twoColumns
-
Field Details
-
classFile
null-ok;
the class file object being constructed; becomes non-null duringdump(byte[], java.io.PrintStream, java.lang.String, boolean, com.android.dx.command.dump.Args)
-
suppressDump
protected boolean suppressDumpwhether or not to suppress dumping
-
-
Method Details
-
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 fileout
-non-null;
where to dump tofilePath
- the file path for the class, excluding any base directory specificationrop
- 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 interfaceParseObserver
- Overrides:
changeIndent
in classBaseDumper
- Parameters:
indentDelta
- the amount to change indentation
-
parsed
Indicate that some parsing happened.- Specified by:
parsed
in interfaceParseObserver
- Overrides:
parsed
in classBaseDumper
- Parameters:
bytes
-non-null;
the source that was parsedoffset
- offset intobytes
for what was parsedlen
- number of bytes parsedhuman
-non-null;
human form for what was parsed
-
shouldDumpMethod
- Parameters:
name
- method name- Returns:
- true if this method should be dumped
-
startParsingMember
Indicate that a particular member is now being parsed.- Specified by:
startParsingMember
in interfaceParseObserver
- Overrides:
startParsingMember
in classBaseDumper
- Parameters:
bytes
-non-null;
the source that is being parsedoffset
- offset intobytes
for the start of the membername
-non-null;
name of the memberdescriptor
-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 interfaceParseObserver
- Overrides:
endParsingMember
in classBaseDumper
- Parameters:
bytes
-non-null;
the source that was parsedoffset
- offset intobytes
for the end of the membername
-non-null;
name of the memberdescriptor
-non-null;
descriptor of the membermember
-non-null;
the actual member that was parsed
-