Package ghidra.feature.vt.api.impl
Class MarkupItemImpl
java.lang.Object
ghidra.feature.vt.api.impl.MarkupItemImpl
- All Implemented Interfaces:
VTMarkupItem
-
Field Summary
Fields inherited from interface ghidra.feature.vt.api.main.VTMarkupItem
DATA_ADDRESS_SOURCE, FUNCTION_ADDRESS_SOURCE, USER_DEFINED_ADDRESS_SOURCE
-
Constructor Summary
ConstructorDescriptionMarkupItemImpl
(MarkupItemStorage markupItem) MarkupItemImpl
(VTAssociation association, VTMarkupType markupType, ghidra.program.model.address.Address sourceAddress) -
Method Summary
Modifier and TypeMethodDescriptionvoid
apply
(VTMarkupItemApplyActionType applyType, ghidra.framework.options.ToolOptions options) Applies this markup item using the given action at the give address.boolean
canApply()
Returns true if this markup item can be applied.boolean
Returns true if this markup item can be unapplied.Returns the VTAssocation that generated this markup item.Returns a Stringable that represents the current value of the markup item in the destination program.ghidra.program.model.address.Address
Returns the address in the destination program for this association.Returns the editable status of this markup item's destination address.Returns a string that indicates the origin of the destination address.ghidra.program.util.ProgramLocation
Returns the field specific program location in the destination program for this association.Returns the VTMarkupType for this markup Item.Returns a Stringable that represents the original value of the markup item in the destination program.ghidra.program.model.address.Address
Returns the address in the source program for this association.ghidra.program.util.ProgramLocation
Returns the field specific program location in the source program for this association.Returns a Stringable that represents the value of the markup item in the source program.Returns the status of this markup item.Returns an optional description of the current markup item status.boolean
void
setConsidered
(VTMarkupItemConsideredStatus consideredStatus) Sets a considered status on this item without applying this item.void
setDefaultDestinationAddress
(ghidra.program.model.address.Address address, String addressSource) Sets the default destination address for this item.void
setDestinationAddress
(ghidra.program.model.address.Address destinationAddress) Sets the actual destination address for the markup item.boolean
supportsApplyAction
(VTMarkupItemApplyActionType actionType) Returns true if this markupItem supports an apply for the given apply action type.toString()
void
unapply()
Returns the value in the destination program back to its original value.
-
Constructor Details
-
MarkupItemImpl
public MarkupItemImpl(VTAssociation association, VTMarkupType markupType, ghidra.program.model.address.Address sourceAddress) -
MarkupItemImpl
-
-
Method Details
-
setDefaultDestinationAddress
public void setDefaultDestinationAddress(ghidra.program.model.address.Address address, String addressSource) Description copied from interface:VTMarkupItem
Sets the default destination address for this item. This address will not be saved, as it is considered a temporary address value. Further, this value is intended to be a "best guess" as to what the destination address should be.Users should not call this method, but should instead call
VTMarkupItem.setDestinationAddress(Address)
.- Specified by:
setDefaultDestinationAddress
in interfaceVTMarkupItem
- Parameters:
address
- the address to set.addressSource
- the source of the address. This will be the name of aVTProgramCorrelator
when a correlator is used to populate default address values.- See Also:
-
setDestinationAddress
public void setDestinationAddress(ghidra.program.model.address.Address destinationAddress) Description copied from interface:VTMarkupItem
Sets the actual destination address for the markup item. This method differs fromVTMarkupItem.setDefaultDestinationAddress(Address, String)
in that the address passed to this method will be saved.The
VTMarkupItem.getDestinationAddressSource()
will returnVTMarkupItem.USER_DEFINED_ADDRESS_SOURCE
when a valid destination address is set via this method.To clear the destination address you may pass null to this method.
- Specified by:
setDestinationAddress
in interfaceVTMarkupItem
- Parameters:
destinationAddress
- the new destination address for the item.- See Also:
-
getMarkupType
Description copied from interface:VTMarkupItem
Returns the VTMarkupType for this markup Item. VTMarkup types include comments, labels, function names, etc.- Specified by:
getMarkupType
in interfaceVTMarkupItem
- Returns:
- the VTMarkupType for this markup Item.
-
getStatus
Description copied from interface:VTMarkupItem
Returns the status of this markup item.- Specified by:
getStatus
in interfaceVTMarkupItem
- Returns:
- the status of this markup item.
-
setConsidered
Description copied from interface:VTMarkupItem
Sets a considered status on this item without applying this item. This is useful to indicate that you considered this item and have decided not to apply it, with some indication as to why.To clear the considered status pass
VTMarkupItemConsideredStatus.UNCONSIDERED
.If the status was an "applied" status, then an exception will be thrown. To determine if an item is applied you can use
VTMarkupItem.canUnapply()
.- Specified by:
setConsidered
in interfaceVTMarkupItem
- Parameters:
consideredStatus
- The considered status to set
-
apply
public void apply(VTMarkupItemApplyActionType applyType, ghidra.framework.options.ToolOptions options) throws VersionTrackingApplyException Description copied from interface:VTMarkupItem
Applies this markup item using the given action at the give address. The destination address and the address source must be set prior to calling this method.- Specified by:
apply
in interfaceVTMarkupItem
- Parameters:
applyType
- the type of apply action to take when applying the given markup itemoptions
- the options- Throws:
VersionTrackingApplyException
- if an error occurred while attempting to apply the markup item.
-
supportsApplyAction
Description copied from interface:VTMarkupItem
Returns true if this markupItem supports an apply for the given apply action type.- Specified by:
supportsApplyAction
in interfaceVTMarkupItem
- Parameters:
actionType
- the VTMarkupITemApplyActionType to test.- Returns:
- true if this markup item can be applied using the given action type.
-
getAssociation
Description copied from interface:VTMarkupItem
Returns the VTAssocation that generated this markup item.- Specified by:
getAssociation
in interfaceVTMarkupItem
- Returns:
- the VTAssocation that generated this markup item.
-
getSourceLocation
public ghidra.program.util.ProgramLocation getSourceLocation()Description copied from interface:VTMarkupItem
Returns the field specific program location in the source program for this association.- Specified by:
getSourceLocation
in interfaceVTMarkupItem
- Returns:
- the field specific program location in the source program for this association.
-
getDestinationLocation
public ghidra.program.util.ProgramLocation getDestinationLocation()Description copied from interface:VTMarkupItem
Returns the field specific program location in the destination program for this association.- Specified by:
getDestinationLocation
in interfaceVTMarkupItem
- Returns:
- the field specific program location in the destination program for this association.
-
getDisplayName
-
getStatusDescription
Description copied from interface:VTMarkupItem
Returns an optional description of the current markup item status. For example, if there status isVTMarkupItemStatus.FAILED_APPLY
, then this method should return a description of the failure.- Specified by:
getStatusDescription
in interfaceVTMarkupItem
- Returns:
- the description.
-
toString
-
getDestinationAddressEditStatus
Description copied from interface:VTMarkupItem
Returns the editable status of this markup item's destination address.- Specified by:
getDestinationAddressEditStatus
in interfaceVTMarkupItem
- Returns:
- the editable status of this markup item's destination address.
- See Also:
-
canApply
public boolean canApply()Description copied from interface:VTMarkupItem
Returns true if this markup item can be applied.- Specified by:
canApply
in interfaceVTMarkupItem
- Returns:
- true if this markup item can be applied.
-
canUnapply
public boolean canUnapply()Description copied from interface:VTMarkupItem
Returns true if this markup item can be unapplied.- Specified by:
canUnapply
in interfaceVTMarkupItem
- Returns:
- true if this markup item can be unapplied.
-
unapply
Description copied from interface:VTMarkupItem
Returns the value in the destination program back to its original value.- Specified by:
unapply
in interfaceVTMarkupItem
- Throws:
VersionTrackingApplyException
- if an error occurred while attempting to unapply the markup item.
-
getDestinationAddressSource
Description copied from interface:VTMarkupItem
Returns a string that indicates the origin of the destination address. Typically, it is determined either by an algorithm or the user.- Specified by:
getDestinationAddressSource
in interfaceVTMarkupItem
- Returns:
- a string that indicates the origin of the destination address.
-
isStoredInDB
public boolean isStoredInDB() -
getCurrentDestinationValue
Description copied from interface:VTMarkupItem
Returns a Stringable that represents the current value of the markup item in the destination program.- Specified by:
getCurrentDestinationValue
in interfaceVTMarkupItem
- Returns:
- a Stringable that represents the current value of the markup item in the destination program.
-
getOriginalDestinationValue
Description copied from interface:VTMarkupItem
Returns a Stringable that represents the original value of the markup item in the destination program.- Specified by:
getOriginalDestinationValue
in interfaceVTMarkupItem
- Returns:
- a Stringable that represents the original value of the markup item in the destination program.
-
getSourceValue
Description copied from interface:VTMarkupItem
Returns a Stringable that represents the value of the markup item in the source program.- Specified by:
getSourceValue
in interfaceVTMarkupItem
- Returns:
- a Stringable that represents the value of the markup item in the source program.
-
getDestinationAddress
public ghidra.program.model.address.Address getDestinationAddress()Description copied from interface:VTMarkupItem
Returns the address in the destination program for this association.- Specified by:
getDestinationAddress
in interfaceVTMarkupItem
- Returns:
- the address in the destination program for this association.
-
getSourceAddress
public ghidra.program.model.address.Address getSourceAddress()Description copied from interface:VTMarkupItem
Returns the address in the source program for this association.- Specified by:
getSourceAddress
in interfaceVTMarkupItem
- Returns:
- the address in the source program for this association.
-
getStorage
-