Package ghidra.app.util.bin.format.dwarf
Record Class DWARFSourceInfo
java.lang.Object
java.lang.Record
ghidra.app.util.bin.format.dwarf.DWARFSourceInfo
- Record Components:
filename
- String filenamelineNum
- int line number
Represents the filename and line number info values from DWARF
DIEs
.-
Constructor Summary
ConstructorDescriptionDWARFSourceInfo
(String filename, int lineNum) Creates an instance of aDWARFSourceInfo
record class. -
Method Summary
Modifier and TypeMethodDescriptionstatic DWARFSourceInfo
create
(DIEAggregate diea) Creates a newDWARFSourceInfo
instance from the suppliedDIEAggregate
if the info is present, otherwise returns null;final boolean
Indicates whether some other object is "equal to" this one.filename()
Returns the value of thefilename
record component.Returns the source location info as a string formatted as "filename:linenum"static String
Returns the source file and line number info attached to the specifiedDIEAggregate
formatted asgetDescriptionStr()
, or null if not present.static DWARFSourceInfo
Creates a newDWARFSourceInfo
instance from the suppliedDIEAggregate
, falling back to the parent containing DIE record if the first record did not have any source info.final int
hashCode()
Returns a hash code value for this object.int
lineNum()
Returns the value of thelineNum
record component.toString()
Returns a string representation of this record class.
-
Constructor Details
-
Method Details
-
create
Creates a newDWARFSourceInfo
instance from the suppliedDIEAggregate
if the info is present, otherwise returns null;- Parameters:
diea
-DIEAggregate
to query for source info- Returns:
- new
DWARFSourceInfo
with filename:linenum info, or null if no info present in DIEA.
-
getSourceInfoWithFallbackToParent
Creates a newDWARFSourceInfo
instance from the suppliedDIEAggregate
, falling back to the parent containing DIE record if the first record did not have any source info.- Parameters:
diea
-DIEAggregate
to query for source info.- Returns:
- new
DWARFSourceInfo
with filename:linenum info, or null if no info present in the specified DIEA and its parent.
-
getDescriptionStr
Returns the source file and line number info attached to the specifiedDIEAggregate
formatted asgetDescriptionStr()
, or null if not present.- Parameters:
diea
-DIEAggregate
to query- Returns:
- string, see
getDescriptionStr()
-
getDescriptionStr
Returns the source location info as a string formatted as "filename:linenum"- Returns:
- "filename:linenum"
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object)
; primitive components are compared with '=='. -
filename
Returns the value of thefilename
record component.- Returns:
- the value of the
filename
record component
-
lineNum
public int lineNum()Returns the value of thelineNum
record component.- Returns:
- the value of the
lineNum
record component
-