|
decompiler 1.0.0
|
A storage location for a particular Symbol. More...
#include <database.hh>
Public Member Functions | |
| SymbolEntry (Symbol *sym) | |
| Construct an uninitialized SymbolEntry. More... | |
| SymbolEntry (Symbol *sym, uint4 exflags, int4 sz, int4 off, const RangeList &use) | |
| Constructor. More... | |
| bool | isPiece (void) const |
| Is this a proper piece of the whole Symbol. | |
| bool | isDynamic (void) const |
| Is storage dynamic. | |
| bool | isConflict (void) const |
| Does storage have potential Symbol conflicts. | |
| virtual Datatype * | getSizedType (const Address &addr, int4 sz) const =0 |
| Get the data-type associated with (a piece of) this. More... | |
| virtual void | printEntry (ostream &s) const =0 |
| Print a one-line description of this to a debug stream. More... | |
| virtual void | encode (Encoder &encoder) const =0 |
| Encode storage element internal to <mapsym> More... | |
| virtual void | decode (Decoder &decoder)=0 |
| Decode storage element internal to <mapsym> More... | |
| uint4 | getAllFlags (void) const |
| Get all Varnode flags for this storage. More... | |
| int4 | getOffset (void) const |
| Get offset of this within the Symbol. | |
| Symbol * | getSymbol (void) const |
| Get the Symbol associated with this. | |
| int4 | getSize (void) const |
| Get the number of bytes consumed by this storage. | |
| bool | inUse (const Address &usepoint) const |
| Is this storage valid for the given code address. More... | |
| const RangeList & | getUseLimit (void) const |
| Get the set of valid code addresses for this storage. | |
| Address | getFirstUseAddress (void) const |
| Get the first code address where this storage is valid. | |
| void | setUseLimit (const RangeList &uselim) |
| Set the range of code addresses where this is valid. | |
| bool | isAddrTied (void) const |
| Is this storage address tied. | |
| bool | updateType (Varnode *vn) const |
| Update a Varnode data-type from this. More... | |
Protected Types | |
| enum | { map_entry = 0 , conflict_entry = 1 , dynamic_entry = 2 } |
| The type (derived class) of SymbolEntry. More... | |
Protected Attributes | |
| Symbol * | symbol |
| Symbol object being mapped. | |
| RangeList | uselimit |
| Code address ranges where this storage is valid. | |
| uint4 | extraflags |
| Varnode flags specific to this storage location. | |
| int4 | offset |
| Offset into the Symbol that this covers. | |
| int4 | size |
| Number of bytes consumed by this (piece of the) storage. | |
| uint2 | entrytype |
| Type of SymbolEntry. | |
| bool | is_piece |
| Is this a piece of the whole symbol. | |
Friends | |
| class | Scope |
| class | ScopeInternal |
A storage location for a particular Symbol.
Storage can be a fixed Address or a dynamically located Varnode representing the Symbol. Storage may get recycled for different Symbols at different points in the code. The uselimit object defines the range of instruction addresses over which a particular SymbolEntry does represent a Symbol, with the convention that an empty uselimit indicates the storage holds the Symbol across all code.
|
protected |
The type (derived class) of SymbolEntry.
| Enumerator | |
|---|---|
| map_entry | Is a MapEntry. |
| conflict_entry | Is a MapEntryConflict. |
| dynamic_entry | Is a DynamicEntry. |
| ghidra::SymbolEntry::SymbolEntry | ( | Symbol * | sym | ) |
Construct an uninitialized SymbolEntry.
For use with decode().
| sym | is the Symbol this will be a map for |
References entrytype, extraflags, is_piece, map_entry, offset, and size.
| ghidra::SymbolEntry::SymbolEntry | ( | Symbol * | sym, |
| uint4 | exflags, | ||
| int4 | sz, | ||
| int4 | off, | ||
| const RangeList & | use | ||
| ) |
Constructor.
| sym | is the Symbol this will be a map for |
| exflags | are Varnode flags to be associated with the Symbol |
| sz | is the number of bytes needed to store the Symbol (or this part of the Symbol) in memory |
| off | is the byte offset into the Symbol, if this represents a piece |
| use | is the range of code addresses where this mapping applies |
References entrytype, extraflags, is_piece, map_entry, offset, size, symbol, and uselimit.
|
pure virtual |
Decode storage element internal to <mapsym>
Implemented in ghidra::MapEntry, ghidra::MapEntryConflict, and ghidra::DynamicEntry.
|
pure virtual |
Encode storage element internal to <mapsym>
Implemented in ghidra::MapEntry, ghidra::MapEntryConflict, and ghidra::DynamicEntry.
|
inline |
Get all Varnode flags for this storage.
Retrieve the (union of) Varnode flags specific to the Symbol and specific to this storage.
References extraflags, ghidra::Symbol::getFlags(), and symbol.
Referenced by ghidra::Scope::queryProperties(), ghidra::Varnode::setSymbolProperties(), and ghidra::Funcdata::syncVarnodesWithSymbols().
|
pure virtual |
Get the data-type associated with (a piece of) this.
Return the data-type that matches the given size and address within this storage. NULL is returned if there is no valid sub-type matching the size.
| addr | is the given address |
| sz | is the given size (in bytes) |
Implemented in ghidra::MapEntry, and ghidra::DynamicEntry.
Referenced by ghidra::VolatileWriteOp::getInputLocal(), ghidra::VolatileReadOp::getOutputLocal(), ghidra::Funcdata::syncVarnodesWithSymbols(), and updateType().
| bool ghidra::SymbolEntry::inUse | ( | const Address & | usepoint | ) | const |
Is this storage valid for the given code address.
This storage location may only hold the Symbol value for a limited portion of the code.
| usepoint | is the given code address to test |
References ghidra::RangeList::inRange(), isAddrTied(), ghidra::Address::isInvalid(), and uselimit.
Referenced by ghidra::ScopeInternal::findAddr(), ghidra::ScopeInternal::findClosestFit(), ghidra::ScopeInternal::findCodeLabel(), ghidra::ScopeInternal::findContainer(), ghidra::Funcdata::findLinkedVarnode(), and ghidra::Funcdata::findLinkedVarnodes().
|
pure virtual |
Print a one-line description of this to a debug stream.
Implemented in ghidra::MapEntry, ghidra::MapEntryConflict, and ghidra::DynamicEntry.
| bool ghidra::SymbolEntry::updateType | ( | Varnode * | vn | ) | const |
Update a Varnode data-type from this.
If the Symbol associated with this is type-locked, change the given Varnode's attached data-type to match the Symbol
| vn | is the Varnode to modify |
References ghidra::Varnode::getAddr(), ghidra::Symbol::getFlags(), ghidra::Varnode::getSize(), getSizedType(), symbol, ghidra::Varnode::typelock, and ghidra::Varnode::updateType().
Referenced by ghidra::Varnode::setSymbolProperties().