Package ghidra.program.model.sourcemap
Class DummySourceFileManager
java.lang.Object
ghidra.program.model.sourcemap.DummySourceFileManager
- All Implemented Interfaces:
SourceFileManager
A "dummy" implementation of
SourceFileManager.-
Field Summary
Fields inherited from interface ghidra.program.model.sourcemap.SourceFileManager
DUMMY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanaddSourceFile(SourceFile sourceFile) Adds aSourceFileto this manager.addSourceMapEntry(SourceFile sourceFile, int lineNumber, Address baseAddr, long length) Creates aSourceMapEntrywithSourceFilesourceFile, line numberlineNumber, and non-negative lengthlengthand adds it to the program database.booleancontainsSourceFile(SourceFile sourceFile) Returns true precisely when this manager containssourceFile.Returns aListcontaining allSourceFiles of the program.Returns aListcontainingSourceFiles which are mapped to at least one address in the programgetSourceMapEntries(SourceFile sourceFile, int minLine, int maxLine) Returns the sorted list ofSourceMapEntrys forsourceFilewith line number betweenminLineandmaxLine, inclusive.getSourceMapEntries(Address addr) Returns a sorted list ofSourceMapEntrys associated with an addressaddr.getSourceMapEntryIterator(Address address, boolean forward) Returns aSourceMapEntryIteratorstarting ataddress.booleanbooleanremoveSourceFile(SourceFile sourceFile) Removes aSourceFilefrom this manager.booleanRemoves aSourceMapEntryfrom this manager.voidtransferSourceMapEntries(SourceFile source, SourceFile target) Changes the source map so that anySourceMapEntryassociated withsourceis associated withtargetinstead.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ghidra.program.model.sourcemap.SourceFileManager
addSourceMapEntry, getSourceMapEntries, getSourceMapEntries
-
Constructor Details
-
DummySourceFileManager
public DummySourceFileManager()
-
-
Method Details
-
getSourceMapEntries
Description copied from interface:SourceFileManagerReturns a sorted list ofSourceMapEntrys associated with an addressaddr.- Specified by:
getSourceMapEntriesin interfaceSourceFileManager- Parameters:
addr- address- Returns:
- line number
-
addSourceMapEntry
public SourceMapEntry addSourceMapEntry(SourceFile sourceFile, int lineNumber, Address baseAddr, long length) throws LockException Description copied from interface:SourceFileManagerCreates aSourceMapEntrywithSourceFilesourceFile, line numberlineNumber, and non-negative lengthlengthand adds it to the program database.Entries with non-zero lengths must either cover the same address range or be disjoint.
- Specified by:
addSourceMapEntryin interfaceSourceFileManager- Parameters:
sourceFile- source filelineNumber- line numberbaseAddr- minimum address of rangelength- number of addresses in range- Returns:
- created SourceMapEntry
- Throws:
LockException- if invoked without exclusive access
-
intersectsSourceMapEntry
Description copied from interface:SourceFileManager- Specified by:
intersectsSourceMapEntryin interfaceSourceFileManager- Parameters:
addrs- addresses to check- Returns:
- true when at least one address has source map info
-
getAllSourceFiles
Description copied from interface:SourceFileManagerReturns aListcontaining allSourceFiles of the program.- Specified by:
getAllSourceFilesin interfaceSourceFileManager- Returns:
- source file list
-
getMappedSourceFiles
Description copied from interface:SourceFileManagerReturns aListcontainingSourceFiles which are mapped to at least one address in the program- Specified by:
getMappedSourceFilesin interfaceSourceFileManager- Returns:
- mapped source file list
-
transferSourceMapEntries
Description copied from interface:SourceFileManagerChanges the source map so that anySourceMapEntryassociated withsourceis associated withtargetinstead. Any entries associated withtargetbefore invocation will still be associated withtargetafter invocation.sourcewill not be associated with any entries after invocation (unlesssourceandtargetare the same). Line number information is not changed.- Specified by:
transferSourceMapEntriesin interfaceSourceFileManager- Parameters:
source- source file to get info fromtarget- source file to move info to
-
getSourceMapEntryIterator
Description copied from interface:SourceFileManagerReturns aSourceMapEntryIteratorstarting ataddress.- Specified by:
getSourceMapEntryIteratorin interfaceSourceFileManager- Parameters:
address- starting addressforward- direction of iterator (true = forward)- Returns:
- iterator
-
getSourceMapEntries
Description copied from interface:SourceFileManagerReturns the sorted list ofSourceMapEntrys forsourceFilewith line number betweenminLineandmaxLine, inclusive.- Specified by:
getSourceMapEntriesin interfaceSourceFileManager- Parameters:
sourceFile- source fileminLine- minimum line numbermaxLine- maximum line number- Returns:
- source map entries
-
addSourceFile
Description copied from interface:SourceFileManagerAdds aSourceFileto this manager. A SourceFile must be added before it can be associated with any source map information.- Specified by:
addSourceFilein interfaceSourceFileManager- Parameters:
sourceFile- source file to add (can't be null)- Returns:
- true if this manager did not already contain sourceFile
- Throws:
LockException- if invoked without exclusive access
-
removeSourceFile
Description copied from interface:SourceFileManagerRemoves aSourceFilefrom this manager. Any associatedSourceMapEntrys will also be removed.- Specified by:
removeSourceFilein interfaceSourceFileManager- Parameters:
sourceFile- source file to remove- Returns:
- true if sourceFile was in the manager
- Throws:
LockException- if invoked without exclusive access
-
containsSourceFile
Description copied from interface:SourceFileManagerReturns true precisely when this manager containssourceFile.- Specified by:
containsSourceFilein interfaceSourceFileManager- Parameters:
sourceFile- source file- Returns:
- true if source file already added
-
removeSourceMapEntry
Description copied from interface:SourceFileManagerRemoves aSourceMapEntryfrom this manager.- Specified by:
removeSourceMapEntryin interfaceSourceFileManager- Parameters:
entry- entry to remove- Returns:
- true if entry was in the manager
- Throws:
LockException- if invoked without exclusive access
-