Package ghidra.app.util.bin.format.dwarf
Class StringTable
java.lang.Object
ghidra.app.util.bin.format.dwarf.StringTable
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 Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
getStringAtOffset
(long offset) Returns the string found atoffset
, or throws anIOException
if the offset is out of bounds.boolean
isValid
(long offset) Returns true if the specified offset is a valid offset for this string table.static StringTable
of
(BinaryReader reader) Creates a StringTable instance, if the supplied BinaryReader is non-null.
-
Field Details
-
reader
-
cache
-
-
Constructor Details
-
StringTable
Creates a StringTable- Parameters:
reader
-BinaryReader
.debug_str or .debug_line_str
-
-
Method Details
-
of
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
Returns the string found atoffset
, or throws anIOException
if the offset is out of bounds.- Parameters:
offset
- location of string- Returns:
- a string, never null
- Throws:
IOException
- if not valid location
-