Interface IMemoryModel
- All Known Subinterfaces:
IMethodStackMemoryModel,INativeCodeModel<InsnType>
A manager for the collection of
memory items generated by the
native code analyzer.-
Method Summary
Modifier and TypeMethodDescriptionvoidaddListener(IMemoryModelListener listener) Register a listener that will receive updates when this model is updated.intRetrieve the bitsizeRetrieve the comment manager associated with this model.getContinuousItemsInRange(long addressBegin, long addressEnd) Get a contiguous list of items, without gaps.Get the lowest-address element in the model.Retrieve a "gap items" factory.getItemAt(long address) Retrieve the item starting at the given address.getItemOver(long address) Retrieve the item spanning over the given address.getItemOverOrGap(long address, long lowerBound, long upperBound) Retrieve the item spanning over the given address, or if no item exists, return a temporary item that fills the gap, partially or fully.getItemsInRange(long addressBegin, boolean includePartialFirstItem, long addressEnd, boolean includePartialLastItem) Get a map of items in the given range.getItemsInRange(long addressBegin, boolean includePartialFirstItem, long addressEnd, boolean includePartialLastItem, Predicate<INativeContinuousItem> predicate) Get a map of items in the given range.Retrieve the label manager associated with this model.Get the highest-address element in the model.getLock()Retrieve the model lock, used to request a full-access model lock or a partial, read-only, transactional lock.getNextItem(long address) Retrieve the closest item whose address is strictly greater than the provided address.default INativeContinuousItemRetrieve the closest item after the given one..getPreviousItem(long address) Retrieve the closest item whose address is strictly less than the provided address.default INativeContinuousItemRetrieve the closest before the given one..getView()Get a full view of the current model.Get a copy view of the current model.booleanisEmpty()Determine if the model is empty.booleanisEmptyRange(long address, int size) Determine if a provided range is free (ie, contains no item or overlapping item).voidnotifyListenersOfModelChange(MemoryModelEventType eventType, Object eventDetails) Issue a notification of model change to all listeners.voidremoveListener(IMemoryModelListener listener) Unregister a listener.intsize()Provide the number of elements in the model.
-
Method Details
-
getLock
IUnitLock getLock()Retrieve the model lock, used to request a full-access model lock or a partial, read-only, transactional lock. All plugin code accessing the native units and units relying on native units should use those locks to perform operations safely in a concurrent environment.- Returns:
- model lock
-
addListener
Register a listener that will receive updates when this model is updated.- Parameters:
listener- listener to add
-
removeListener
Unregister a listener.- Parameters:
listener- listener to remove
-
notifyListenersOfModelChange
Issue a notification of model change to all listeners.- Parameters:
eventType- event typeeventDetails- event details
-
isEmpty
boolean isEmpty()Determine if the model is empty.- Returns:
- true if the model has no item
-
size
int size()Provide the number of elements in the model.- Returns:
- number of items
-
getFirstItem
INativeContinuousItem getFirstItem()Get the lowest-address element in the model.- Returns:
- first item, or null if the model is empty
-
getLastItem
INativeContinuousItem getLastItem()Get the highest-address element in the model.- Returns:
- last item, or null if the model is empty
-
getView
SortedMap<Long,INativeContinuousItem> getView()Get a full view of the current model. Same asgetView(null, null).- Returns:
- an unmodifiable view of the model containing the native items
-
getView
Get a copy view of the current model.- Parameters:
fromAddress- optional start addresstoAddress- optional end address- Returns:
- an unmodifiable view of the model containing the native items
-
getItemAt
Retrieve the item starting at the given address.- Parameters:
address- item start address- Returns:
- the item or null
-
getItemOver
Retrieve the item spanning over the given address.- Parameters:
address- address to query- Returns:
- the item or null
-
getNextItem
Retrieve the closest item whose address is strictly greater than the provided address.- Parameters:
address- address to query- Returns:
- the next item or null
-
getNextItem
Retrieve the closest item after the given one..- Parameters:
item- current item- Returns:
- the next item or null
-
getPreviousItem
Retrieve the closest before the given one..- Parameters:
item- current item- Returns:
- the previous item or null
-
getPreviousItem
Retrieve the closest item whose address is strictly less than the provided address.- Parameters:
address- address to query- Returns:
- the previous item or null
-
getItemOverOrGap
Retrieve the item spanning over the given address, or if no item exists, return a temporary item that fills the gap, partially or fully. In the latter case, the gap item is not attached to the memory model.- Parameters:
address- the address to be queried; the address must be in the bounds range defined belowlowerBound- the lower bound for the gap, if no item was foundupperBound- the higher bound for the gap, used if no item was found; must be >= that the lower bound- Returns:
- an item or a gap item, or null if the addresses are invalid
-
getContinuousItemsInRange
Get a contiguous list of items, without gaps. The last item, if present, may have an end-address pastaddressEnd. Gaps are filled usinggetGapFactory().- Parameters:
addressBegin- start addressaddressEnd- end address- Returns:
- a list of items, with gap items to fill in possible gaps
-
getItemsInRange
SortedMap<Long,INativeContinuousItem> getItemsInRange(long addressBegin, boolean includePartialFirstItem, long addressEnd, boolean includePartialLastItem) Get a map of items in the given range.- Parameters:
addressBegin- start addressincludePartialFirstItem- include the first item if it spans over (not starts on) the start addressaddressEnd- end addressincludePartialLastItem- include the last item if it spans over (not ends on) the last address- Returns:
- matching items
-
getItemsInRange
SortedMap<Long,INativeContinuousItem> getItemsInRange(long addressBegin, boolean includePartialFirstItem, long addressEnd, boolean includePartialLastItem, Predicate<INativeContinuousItem> predicate) Get a map of items in the given range.- Parameters:
addressBegin- start addressincludePartialFirstItem- include the first item if it spans over (not starts on) the start addressaddressEnd- end addressincludePartialLastItem- include the last item if it spans over (not ends on) the last addresspredicate-Predicateto use to filter required values.- Returns:
- matching items
-
isEmptyRange
boolean isEmptyRange(long address, int size) Determine if a provided range is free (ie, contains no item or overlapping item).- Parameters:
address- start addresssize- range size- Returns:
- true if the range contains no item
-
getGapFactory
ISegmentFactory<Long,INativeContinuousItem> getGapFactory()Retrieve a "gap items" factory. The factory is used to produce temporary items to fill in gaps, when using methods likegetContinuousItemsInRange(long, long).- Returns:
- a factory (mandatory)
-
getLabelManager
ILabelManager getLabelManager()Retrieve the label manager associated with this model.- Returns:
- label manager
-
getCommentManager
ICommentManager getCommentManager()Retrieve the comment manager associated with this model.- Returns:
- comment manager
-
getBitsize
int getBitsize()Retrieve the bitsize- Returns:
- memory model bit size
-