Package com.android.dx.dex.file
Class DebugInfoEncoder
java.lang.Object
com.android.dx.dex.file.DebugInfoEncoder
An encoder for the dex debug info state machine format. The format
for each method enrty is as follows:
- signed LEB128: initial value for line register.
- n instances of signed LEB128: string indicies (offset by 1)
for each method argument in left-to-right order
with
this
excluded. A value of '0' indicates "no name" - A sequence of special or normal opcodes as defined in
DebugInfoConstants
. - A single terminating
OP_END_SEQUENCE
-
Constructor Summary
ConstructorDescriptionDebugInfoEncoder
(PositionList positions, LocalList locals, DexFile file, int codeSize, int regSize, boolean isStatic, CstMethodRef ref) Creates an instance. -
Method Summary
Modifier and TypeMethodDescriptionbyte[]
convert()
Converts this (PositionList, LocalList) pair into a state machine sequence.byte[]
convertAndAnnotate
(String prefix, PrintWriter debugPrint, AnnotatedOutput out, boolean consume) Converts and produces annotations on a stream.
-
Constructor Details
-
DebugInfoEncoder
public DebugInfoEncoder(PositionList positions, LocalList locals, DexFile file, int codeSize, int regSize, boolean isStatic, CstMethodRef ref) Creates an instance.- Parameters:
positions
-null-ok;
positions (line numbers) to encodelocals
-null-ok;
local variables to encodefile
-null-ok;
may only benull
if simply using this class to do a debug printcodeSize
-regSize
-isStatic
-ref
-
-
-
Method Details
-
convert
public byte[] convert()Converts this (PositionList, LocalList) pair into a state machine sequence.- Returns:
non-null;
encoded byte sequence without padding and terminated with a0x00
byte
-
convertAndAnnotate
public byte[] convertAndAnnotate(String prefix, PrintWriter debugPrint, AnnotatedOutput out, boolean consume) Converts and produces annotations on a stream. Does not write actual bits to theAnnotatedOutput
.- Parameters:
prefix
-null-ok;
prefix to attach to each line of outputdebugPrint
-null-ok;
if specified, an alternate output for annotationsout
-null-ok;
if specified, where annotations should goconsume
- whether to claim to have consumed output forout
- Returns:
non-null;
encoded output
-