Package ghidra.feature.vt.api.main
Interface VTAssociation
- All Known Implementing Classes:
VTAssociationDB
public interface VTAssociation
A VTAssociation is a possible equivalence between a function or data in one program to
a function or data in another program. VTAssociations can be "Accepted" indicating that
the user has agreed that the association is correct.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Clears the state of the given association fromVTAssociationStatus.ACCEPTED
orVTAssociationStatus.REJECTED
toVTAssociationStatus.AVAILABLE
.ghidra.program.model.address.Address
Returns the address of the function or data item in the source program for this association.getMarkupItems
(ghidra.util.task.TaskMonitor monitor) Returns a list of markup items for this association.Returns the status of the markup items for this association.Returns a collection of VTAssociations that have either the same source address or the same destination address.Returns the VTSession that this association belongs to.ghidra.program.model.address.Address
Returns the address of the function or data item in the source program for this association.Returns the current status of this association.getType()
Returns the type of the association.int
Returns the current vote count which is an application settable field which should generally be used to indicate a number of supporting facts.boolean
Returns true if this association is accepted and has one or more markup items that have been applied.void
A convenience method to accept the given association without actually performing an apply.void
setMarkupStatus
(VTAssociationMarkupStatus markupItemsStatus) Sets the markup status of this association.void
Sets the status of this association toVTAssociationStatus.REJECTED
.void
setVoteCount
(int voteCount) Sets the vote count for this association which should be used to indicate the number of supporting facts for this association
-
Method Details
-
getType
VTAssociationType getType()Returns the type of the association. Either Function or Data.- Returns:
- the type of the association. Either Function or Data.
-
getSession
VTSession getSession()Returns the VTSession that this association belongs to.- Returns:
- the VTSession that this association belongs to.
-
getMarkupItems
Collection<VTMarkupItem> getMarkupItems(ghidra.util.task.TaskMonitor monitor) throws ghidra.util.exception.CancelledException Returns a list of markup items for this association.- Parameters:
monitor
- a task monitor used to monitor and control this operation.- Returns:
- a list of markup items for this association.
- Throws:
ghidra.util.exception.CancelledException
- if the operation was cancelled via the monitor.
-
hasAppliedMarkupItems
boolean hasAppliedMarkupItems()Returns true if this association is accepted and has one or more markup items that have been applied.- Returns:
- true if this association is accepted and has one or more markup items that have been applied.
-
getSourceAddress
ghidra.program.model.address.Address getSourceAddress()Returns the address of the function or data item in the source program for this association.- Returns:
- the address of the function or data item in the source program for this association.
-
getDestinationAddress
ghidra.program.model.address.Address getDestinationAddress()Returns the address of the function or data item in the source program for this association.- Returns:
- the address of the function or data item in the source program for this association.
-
getRelatedAssociations
Collection<VTAssociation> getRelatedAssociations()Returns a collection of VTAssociations that have either the same source address or the same destination address.- Returns:
- a collection of VTAssociations that have either the same source address or the same destination address.
-
setMarkupStatus
Sets the markup status of this association. This method is used by theVTAssociationManager
to update the association with information about the state of its markup items.- Parameters:
markupItemsStatus
- the markup items
-
getMarkupStatus
VTAssociationMarkupStatus getMarkupStatus()Returns the status of the markup items for this association. SeeVTAssociationMarkupStatus
for details.- Returns:
- the status of the markup items for this association.
-
getStatus
VTAssociationStatus getStatus()Returns the current status of this association. One of AVAILABLE, ACCEPTED, BLOCKED, or REJECTED. SeeVTAssociationStatus
for details.- Returns:
- the current status of this association. One of AVAILABLE, ACCEPTED, BLOCKED, or REJECTED.
-
setAccepted
A convenience method to accept the given association without actually performing an apply.- Throws:
VTAssociationStatusException
- if the given association isVTAssociationStatus.BLOCKED
-
clearStatus
Clears the state of the given association fromVTAssociationStatus.ACCEPTED
orVTAssociationStatus.REJECTED
toVTAssociationStatus.AVAILABLE
. This method will throw an exception if called while the given assocation's markup items have been applied. That is, you must first unapply any applied markup items before calling this method.- Throws:
VTAssociationStatusException
- if the given association's status is notVTAssociationStatus.ACCEPTED
/VTAssociationStatus.REJECTED
or if the given assocation's markup item manager contains markup items that have been applied.
-
setRejected
Sets the status of this association toVTAssociationStatus.REJECTED
.- Throws:
VTAssociationStatusException
- if the association is accepted.
-
getVoteCount
int getVoteCount()Returns the current vote count which is an application settable field which should generally be used to indicate a number of supporting facts. For example, other accepted associations may have matching call references to this association, each of those matching calls should have incremented the votes.- Returns:
- the current number of facts that support this association
-
setVoteCount
void setVoteCount(int voteCount) Sets the vote count for this association which should be used to indicate the number of supporting facts for this association- Parameters:
voteCount
- the new vote count for this association.
-