Class DWARFSourceInfo

java.lang.Object
ghidra.app.util.bin.format.dwarf4.next.DWARFSourceInfo

public class DWARFSourceInfo extends Object
Small class to hold the filename and line number info values from DWARF DIEs.
  • Method Details

    • create

      public static DWARFSourceInfo create(DIEAggregate diea)
      Creates a new DWARFSourceInfo instance from the supplied DIEAggregate 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 new DWARFSourceInfo instance from the supplied DIEAggregate, 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 String getDescriptionStr(DIEAggregate diea)
      Returns the source file and line number info attached to the specified DIEAggregate formatted as getDescriptionStr(), or null if not present.
      Parameters:
      diea - DIEAggregate to query
      Returns:
      string, see getDescriptionStr()
    • getFilename

      public String getFilename()
      Returns the filename
      Returns:
      string filename.
    • getDescriptionStr

      public String getDescriptionStr()
      Returns the source location info as a string formatted as "filename:linenum"
      Returns:
      "filename:linenum"
    • getDescriptionStr2

      public 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 class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object