Class StringTable

java.lang.Object
ghidra.app.util.bin.format.dwarf.StringTable

public class StringTable extends Object
Represents a DWARF string table, backed by a memory section like .debug_str.

Strings are read from the section the first time requested, and then cached in a weak lookup table.

  • Field Details

  • Constructor Details

    • StringTable

      public StringTable(BinaryReader reader)
      Creates a StringTable
      Parameters:
      reader - BinaryReader .debug_str or .debug_line_str
  • Method Details

    • of

      public static StringTable of(BinaryReader reader)
      Creates a StringTable instance, if the supplied BinaryReader is non-null.
      Parameters:
      reader - BinaryReader
      Returns:
      new instance, or null if reader is null
    • isValid

      public boolean isValid(long offset)
      Returns true if the specified offset is a valid offset for this string table.

      Parameters:
      offset - location of possible string
      Returns:
      boolean true if location is valid
    • clear

      public void clear()
    • getStringAtOffset

      public String getStringAtOffset(long offset) throws IOException
      Returns the string found at offset, or throws an IOException if the offset is out of bounds.
      Parameters:
      offset - location of string
      Returns:
      a string, never null
      Throws:
      IOException - if not valid location