Interface MapProposal<T,P,E extends MapEntry<T,P>>
- All Known Subinterfaces:
ModuleMapProposal,RegionMapProposal,SectionMapProposal
-
Method Summary
Modifier and TypeMethodDescriptionCompute the overall map given by this proposaldoubleCompute a notional "score" of the proposalstatic <T,P, E extends MapEntry<T, P>, M extends MapProposal<T, P, E>>
Collection<E> flatten(Collection<M> proposals) Flatten proposals into a single collection of entriesGet the corresponding program image of this proposalgetToObject(T from) Get the destination (program) object for a given source (trace) objectgetTrace()Get the trace containing the trace objects in this proposalremoveOverlapping(Collection<E> entries) Remove entries from a collection which overlap existing entries in the trace
-
Method Details
-
flatten
static <T,P, Collection<E> flattenE extends MapEntry<T, P>, M extends MapProposal<T, P, E>> (Collection<M> proposals) Flatten proposals into a single collection of entriesThe output is suitable for use in
DebuggerStaticMappingService.addMappings(Collection, TaskMonitor, boolean, String). In some contexts, the user should be permitted to see and optionally adjust the collection first.Note, it is advisable to filter the returned collection using
removeOverlapping(Collection)to avoid errors from adding overlapped mappings. Alternatively, you can settruncateExistingto true when callingDebuggerStaticMappingService.addMappings(Collection, TaskMonitor, boolean, String).- Parameters:
proposals- the collection of proposed maps- Returns:
- the flattened, filtered collection
-
removeOverlapping
Remove entries from a collection which overlap existing entries in the trace- Parameters:
entries- the entries to filter- Returns:
- the filtered entries
-
getTrace
Trace getTrace()Get the trace containing the trace objects in this proposal- Returns:
- the trace
-
getProgram
Program getProgram()Get the corresponding program image of this proposal- Returns:
- the program
-
getToObject
Get the destination (program) object for a given source (trace) object- Parameters:
from- the trace object- Returns:
- the proposed program object
-
computeScore
double computeScore()Compute a notional "score" of the proposalThis may examine attributes of the "from" and "to" objects, in order to determine the likelihood of the match based on this proposal. The implementation need not assign meaning to any particular score, but a higher score must imply a more likely match.
- Returns:
- a score of the proposed pair
-
computeMap
Compute the overall map given by this proposal- Returns:
- the map
-