Top Fields Constructors Methods
org.droidparts.dexmaker.dx.dex.file

public Class DebugInfoItem

extends OffsettedItem
Class Inheritance
Imports
org.droidparts.dexmaker.dx.dex.code.DalvCode, .DalvInsnList, .LocalList, .PositionList, org.droidparts.dexmaker.dx.rop.cst.CstMethodRef, org.droidparts.dexmaker.dx.util.AnnotatedOutput, .ExceptionWithContext, java.io.PrintWriter

Field Summary

Modifier and TypeField and Description
private static final int
ALIGNMENT

the required alignment for instances of this class

private final DalvCode
code

non-null; the code this item represents

private static final boolean
private byte[]
private final boolean
private final CstMethodRef

Constructor Summary

AccessConstructor and Description
public
DebugInfoItem(DalvCode code, boolean isStatic, CstMethodRef ref)

Method Summary

Modifier and TypeMethod and Description
public void
addContents(DexFile
non-null; the file to populate
file
)

Implements abstract org.droidparts.dexmaker.dx.dex.file.Item.addContents.

Populates a DexFile with items from within this instance.
public void
annotateTo(DexFile
non-null; the file to use for referencing other sections
file
,
AnnotatedOutput
non-null; where to annotate to
out
,
String
null-ok; prefix to attach to each line of output
prefix
)

Writes annotations for the elements of this list, as zero-length.

public void
debugPrint(PrintWriter
non-null; where to dump
out
,
String
non-null; prefix to attach to each line of output
prefix
)

Does a human-friendly dump of this instance.

private byte[]

Returns:

non-null; the encoded array
encode
(DexFile
null-ok; file to refer to during encoding
file
,
String
null-ok; prefix to attach to each line of output
prefix
,
PrintWriter
null-ok; if specified, an alternate output for annotations
debugPrint
,
AnnotatedOutput
null-ok; if specified, where annotations should go
out
,
boolean
whether to claim to have consumed output for out
consume
)

Performs debug info encoding.

private byte[]

Returns:

non-null; the encoded array
encode0
(DexFile
null-ok; file to refer to during encoding
file
,
String
null-ok; prefix to attach to each line of output
prefix
,
PrintWriter
null-ok; if specified, an alternate output for annotations
debugPrint
,
AnnotatedOutput
null-ok; if specified, where annotations should go
out
,
boolean
whether to claim to have consumed output for out
consume
)

Helper for encode to do most of the work.

public ItemType
itemType()

Implements abstract org.droidparts.dexmaker.dx.dex.file.Item.itemType.

Returns the item type for this instance.
protected void
place0(Section
non-null; the section this instance has been added to
addedTo
,
int
>= 0; the offset from the start of the section where this instance was placed
offset
)

Overrides org.droidparts.dexmaker.dx.dex.file.OffsettedItem.place0.

Does additional work required when placing an instance.
public String
toHuman()

Implements abstract org.droidparts.dexmaker.dx.dex.file.OffsettedItem.toHuman.

Gets a short human-readable string representing this instance.
protected void
writeTo0(DexFile
non-null; the file to use for reference
file
,
AnnotatedOutput
non-null; where to write to
out
)

Implements abstract org.droidparts.dexmaker.dx.dex.file.OffsettedItem.writeTo0.

Performs the actual write of the contents of this instance to the given data section.
Inherited from org.droidparts.dexmaker.dx.dex.file.OffsettedItem:
compareTocompareTo0equalsgetAbsoluteOffsetgetAbsoluteOffsetOr0getAlignmentgetRelativeOffsetoffsetStringplacesetWriteSizewriteSizewriteTo

Field Detail

ALIGNMENTback to summary
private static final int ALIGNMENT

the required alignment for instances of this class

codeback to summary
private final DalvCode code

non-null; the code this item represents

ENABLE_ENCODER_SELF_CHECKback to summary
private static final boolean ENABLE_ENCODER_SELF_CHECK
encodedback to summary
private byte[] encoded
isStaticback to summary
private final boolean isStatic
refback to summary
private final CstMethodRef ref

Constructor Detail

DebugInfoItemback to summary
public DebugInfoItem(DalvCode code, boolean isStatic, CstMethodRef ref)

Method Detail

addContentsback to summary
public void addContents(DexFile file)

Implements abstract org.droidparts.dexmaker.dx.dex.file.Item.addContents.

Doc from org.droidparts.dexmaker.dx.dex.file.Item.addContents.

Populates a DexFile with items from within this instance. This will not add an item to the file for this instance itself (which should have been done by whatever refers to this instance).

Note

Subclasses must override this to do something appropriate.

Parameters
file:DexFile

non-null; the file to populate

Annotations
@Override
annotateToback to summary
public void annotateTo(DexFile file, AnnotatedOutput out, String prefix)

Writes annotations for the elements of this list, as zero-length. This is meant to be used for dumping this instance directly after a code dump (with the real local list actually existing elsewhere in the output).

Parameters
file:DexFile

non-null; the file to use for referencing other sections

out:AnnotatedOutput

non-null; where to annotate to

prefix:String

null-ok; prefix to attach to each line of output

debugPrintback to summary
public void debugPrint(PrintWriter out, String prefix)

Does a human-friendly dump of this instance.

Parameters
out:PrintWriter

non-null; where to dump

prefix:String

non-null; prefix to attach to each line of output

encodeback to summary
private byte[] encode(DexFile file, String prefix, PrintWriter debugPrint, AnnotatedOutput out, boolean consume)

Performs debug info encoding.

Parameters
file:DexFile

null-ok; file to refer to during encoding

prefix:String

null-ok; prefix to attach to each line of output

debugPrint:PrintWriter

null-ok; if specified, an alternate output for annotations

out:AnnotatedOutput

null-ok; if specified, where annotations should go

consume:boolean

whether to claim to have consumed output for out

Returns:byte[]

non-null; the encoded array

encode0back to summary
private byte[] encode0(DexFile file, String prefix, PrintWriter debugPrint, AnnotatedOutput out, boolean consume)

Helper for encode to do most of the work.

Parameters
file:DexFile

null-ok; file to refer to during encoding

prefix:String

null-ok; prefix to attach to each line of output

debugPrint:PrintWriter

null-ok; if specified, an alternate output for annotations

out:AnnotatedOutput

null-ok; if specified, where annotations should go

consume:boolean

whether to claim to have consumed output for out

Returns:byte[]

non-null; the encoded array

itemTypeback to summary
public ItemType itemType()

Implements abstract org.droidparts.dexmaker.dx.dex.file.Item.itemType.

Doc from org.droidparts.dexmaker.dx.dex.file.Item.itemType.

Returns the item type for this instance.

Returns:ItemType

non-null; the item type

Annotations
@Override
place0back to summary
protected void place0(Section addedTo, int offset)

Overrides org.droidparts.dexmaker.dx.dex.file.OffsettedItem.place0.

Doc from org.droidparts.dexmaker.dx.dex.file.OffsettedItem.place0.

Does additional work required when placing an instance. The default implementation of this method is a no-op. If a particular class needs to do something special, then it should override this method. In particular, if this instance did not know its write size up-front, then this method is responsible for setting it.

Parameters
addedTo:Section

non-null; the section this instance has been added to

offset:int

>= 0; the offset from the start of the section where this instance was placed

Annotations
@Override
toHumanback to summary
public String toHuman()

Implements abstract org.droidparts.dexmaker.dx.dex.file.OffsettedItem.toHuman.

Doc from org.droidparts.dexmaker.dx.dex.file.OffsettedItem.toHuman.

Gets a short human-readable string representing this instance.

Returns:String

non-null; the human form

Annotations
@Override
writeTo0back to summary
protected void writeTo0(DexFile file, AnnotatedOutput out)

Implements abstract org.droidparts.dexmaker.dx.dex.file.OffsettedItem.writeTo0.

Doc from org.droidparts.dexmaker.dx.dex.file.OffsettedItem.writeTo0.

Performs the actual write of the contents of this instance to the given data section. This is called by writeTo, which will have taken care of ensuring alignment.

Parameters
file:DexFile

non-null; the file to use for reference

out:AnnotatedOutput

non-null; where to write to

Annotations
@Override