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 TypeMethodDescriptionboolean
addSourceFile
(SourceFile sourceFile) Adds aSourceFile
to this manager.addSourceMapEntry
(SourceFile sourceFile, int lineNumber, Address baseAddr, long length) Creates aSourceMapEntry
withSourceFile
sourceFile
, line numberlineNumber
, and non-negative lengthlength
and adds it to the program database.boolean
containsSourceFile
(SourceFile sourceFile) Returns true precisely when this manager containssourceFile
.Returns aList
containing allSourceFile
s of the program.Returns aList
containingSourceFile
s which are mapped to at least one address in the programgetSourceMapEntries
(SourceFile sourceFile, int minLine, int maxLine) Returns the sorted list ofSourceMapEntry
s forsourceFile
with line number betweenminLine
andmaxLine
, inclusive.getSourceMapEntries
(Address addr) Returns a sorted list ofSourceMapEntry
s associated with an addressaddr
.getSourceMapEntryIterator
(Address address, boolean forward) Returns aSourceMapEntryIterator
starting ataddress
.boolean
boolean
removeSourceFile
(SourceFile sourceFile) Removes aSourceFile
from this manager.boolean
Removes aSourceMapEntry
from this manager.void
transferSourceMapEntries
(SourceFile source, SourceFile target) Changes the source map so that anySourceMapEntry
associated withsource
is associated withtarget
instead.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface ghidra.program.model.sourcemap.SourceFileManager
addSourceMapEntry, getSourceMapEntries, getSourceMapEntries
-
Constructor Details
-
DummySourceFileManager
public DummySourceFileManager()
-
-
Method Details
-
getSourceMapEntries
Description copied from interface:SourceFileManager
Returns a sorted list ofSourceMapEntry
s associated with an addressaddr
.- Specified by:
getSourceMapEntries
in 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:SourceFileManager
Creates aSourceMapEntry
withSourceFile
sourceFile
, line numberlineNumber
, and non-negative lengthlength
and adds it to the program database.Entries with non-zero lengths must either cover the same address range or be disjoint.
- Specified by:
addSourceMapEntry
in 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:
intersectsSourceMapEntry
in interfaceSourceFileManager
- Parameters:
addrs
- addresses to check- Returns:
- true when at least one address has source map info
-
getAllSourceFiles
Description copied from interface:SourceFileManager
Returns aList
containing allSourceFile
s of the program.- Specified by:
getAllSourceFiles
in interfaceSourceFileManager
- Returns:
- source file list
-
getMappedSourceFiles
Description copied from interface:SourceFileManager
Returns aList
containingSourceFile
s which are mapped to at least one address in the program- Specified by:
getMappedSourceFiles
in interfaceSourceFileManager
- Returns:
- mapped source file list
-
transferSourceMapEntries
Description copied from interface:SourceFileManager
Changes the source map so that anySourceMapEntry
associated withsource
is associated withtarget
instead. Any entries associated withtarget
before invocation will still be associated withtarget
after invocation.source
will not be associated with any entries after invocation (unlesssource
andtarget
are the same). Line number information is not changed.- Specified by:
transferSourceMapEntries
in interfaceSourceFileManager
- Parameters:
source
- source file to get info fromtarget
- source file to move info to
-
getSourceMapEntryIterator
Description copied from interface:SourceFileManager
Returns aSourceMapEntryIterator
starting ataddress
.- Specified by:
getSourceMapEntryIterator
in interfaceSourceFileManager
- Parameters:
address
- starting addressforward
- direction of iterator (true = forward)- Returns:
- iterator
-
getSourceMapEntries
Description copied from interface:SourceFileManager
Returns the sorted list ofSourceMapEntry
s forsourceFile
with line number betweenminLine
andmaxLine
, inclusive.- Specified by:
getSourceMapEntries
in interfaceSourceFileManager
- Parameters:
sourceFile
- source fileminLine
- minimum line numbermaxLine
- maximum line number- Returns:
- source map entries
-
addSourceFile
Description copied from interface:SourceFileManager
Adds aSourceFile
to this manager. A SourceFile must be added before it can be associated with any source map information.- Specified by:
addSourceFile
in 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:SourceFileManager
Removes aSourceFile
from this manager. Any associatedSourceMapEntry
s will also be removed.- Specified by:
removeSourceFile
in 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:SourceFileManager
Returns true precisely when this manager containssourceFile
.- Specified by:
containsSourceFile
in interfaceSourceFileManager
- Parameters:
sourceFile
- source file- Returns:
- true if source file already added
-
removeSourceMapEntry
Description copied from interface:SourceFileManager
Removes aSourceMapEntry
from this manager.- Specified by:
removeSourceMapEntry
in interfaceSourceFileManager
- Parameters:
entry
- entry to remove- Returns:
- true if entry was in the manager
- Throws:
LockException
- if invoked without exclusive access
-