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
ConstructorsConstructorDescriptionDWARFSourceInfo(String filename, int lineNum) Creates an instance of aDWARFSourceInforecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic DWARFSourceInfocreate(DIEAggregate diea) Creates a newDWARFSourceInfoinstance from the suppliedDIEAggregateif the info is present, otherwise returns null;final booleanIndicates whether some other object is "equal to" this one.filename()Returns the value of thefilenamerecord component.Returns the source location info as a string formatted as "filename:linenum"static StringReturns the source file and line number info attached to the specifiedDIEAggregateformatted asgetDescriptionStr(), or null if not present.static DWARFSourceInfoCreates a newDWARFSourceInfoinstance from the suppliedDIEAggregate, falling back to the parent containing DIE record if the first record did not have any source info.final inthashCode()Returns a hash code value for this object.intlineNum()Returns the value of thelineNumrecord component.toString()Returns a string representation of this record class.
-
Constructor Details
-
Method Details
-
create
Creates a newDWARFSourceInfoinstance from the suppliedDIEAggregateif the info is present, otherwise returns null;- Parameters:
diea-DIEAggregateto query for source info- Returns:
- new
DWARFSourceInfowith filename:linenum info, or null if no info present in DIEA.
-
getSourceInfoWithFallbackToParent
Creates a newDWARFSourceInfoinstance from the suppliedDIEAggregate, falling back to the parent containing DIE record if the first record did not have any source info.- Parameters:
diea-DIEAggregateto query for source info.- Returns:
- new
DWARFSourceInfowith 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 specifiedDIEAggregateformatted asgetDescriptionStr(), or null if not present.- Parameters:
diea-DIEAggregateto 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 thefilenamerecord component.- Returns:
- the value of the
filenamerecord component
-
lineNum
public int lineNum()Returns the value of thelineNumrecord component.- Returns:
- the value of the
lineNumrecord component
-