Package ghidra.program.model.sourcemap
Interface SourceMapEntry
- All Superinterfaces:
Comparable<SourceMapEntry>
- All Known Implementing Classes:
SourceMapEntryDB
A SourceMapEntry consists of a
SourceFile
, a line number, a base address,
and a length. If the length is positive, the base address and the length determine
an AddressRange
. In this case, the length of a SourceMapEntry
is the
length of the associated AddressRange
, i.e., the number of Address
es in
the range (see AddressRange.getLength()
). The intent is that the range
contains all of the bytes corresponding to a given line of source. The length of a
SourceMapEntry
can be 0, in which case the associated range is null. Negative
lengths are not allowed.
The baseAddress of a range must occur within a memory block of the program, as must each
address within the range of a SourceMapEntry
. A range may span multiple
(contiguous) memory blocks.
If the ranges of two entries (with non-zero lengths) intersect, then the ranges must be
identical. The associated SourceFile
s and/or line numbers can be different.
Entries with length zero do not conflict with other entries and may occur within the range of another entry.
For a fixed source file, line number, base address, and length, there must be only one SourceMapEntry.
SourceMapEntry objects are created using the SourceFileManager
for a program,
which must enforce the restrictions listed above.
-
Method Summary
Modifier and TypeMethodDescriptionReturns the base address of the entrylong
Returns the length of the range (number of addresses)int
Returns the line number.getRange()
Returns the address range, or null for length 0 entriesReturns the source fileMethods inherited from interface java.lang.Comparable
compareTo
-
Method Details
-
getLineNumber
int getLineNumber()Returns the line number.- Returns:
- line number
-
getSourceFile
SourceFile getSourceFile()Returns the source file- Returns:
- source file
-
getBaseAddress
Address getBaseAddress()Returns the base address of the entry- Returns:
- base address
-
getLength
long getLength()Returns the length of the range (number of addresses)- Returns:
- length
-
getRange
AddressRange getRange()Returns the address range, or null for length 0 entries- Returns:
- address range or null
-