Class DWARFSourceInfo
- java.lang.Object
-
- ghidra.app.util.bin.format.dwarf4.next.DWARFSourceInfo
-
public class DWARFSourceInfo extends java.lang.Object
Small class to hold the filename and line number info values from DWARFDIEs
.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static DWARFSourceInfo
create(DIEAggregate diea)
Creates a newDWARFSourceInfo
instance from the suppliedDIEAggregate
if the info is present, otherwise returns null;boolean
equals(java.lang.Object obj)
java.lang.String
getDescriptionStr()
Returns the source location info as a string formatted as "filename:linenum"static java.lang.String
getDescriptionStr(DIEAggregate diea)
Returns the source file and line number info attached to the specifiedDIEAggregate
formatted asgetDescriptionStr()
, or null if not present.java.lang.String
getDescriptionStr2()
Returns the source location info as a string formatted as "File: filename Line: linenum"java.lang.String
getFilename()
Returns the filenamestatic DWARFSourceInfo
getSourceInfoWithFallbackToParent(DIEAggregate diea)
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.int
hashCode()
java.lang.String
toString()
-
-
-
Method Detail
-
create
public static DWARFSourceInfo create(DIEAggregate diea)
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
public static DWARFSourceInfo getSourceInfoWithFallbackToParent(DIEAggregate diea)
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
public static java.lang.String getDescriptionStr(DIEAggregate diea)
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()
-
getFilename
public java.lang.String getFilename()
Returns the filename- Returns:
- string filename.
-
getDescriptionStr
public java.lang.String getDescriptionStr()
Returns the source location info as a string formatted as "filename:linenum"- Returns:
- "filename:linenum"
-
getDescriptionStr2
public java.lang.String getDescriptionStr2()
Returns the source location info as a string formatted as "File: filename Line: linenum"- Returns:
- "File: filename Line: linenum"
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-