|
decompiler 1.0.0
|
The base class for compiling p-code expressions from SLEIGH syntax. More...
#include <pcodecompile.hh>
Public Member Functions | |
| PcodeCompile (void) | |
| Constructor. | |
| virtual | ~PcodeCompile (void) |
| Destructor. | |
| virtual const Location * | getLocation (SleighSymbol *sym) const =0 |
| Get the parse location associated with the given symbol. More... | |
| virtual void | reportError (const Location *loc, const string &msg)=0 |
| Report a fatal error in parsing. More... | |
| virtual void | reportWarning (const Location *loc, const string &msg)=0 |
| Report a non-fatal issue encountered during parsing. More... | |
| void | resetLabelCount (void) |
| Reset labels. The next label generated will have id 0. | |
| void | setDefaultSpace (AddrSpace *spc) |
| Set the SLEIGH default address space. | |
| void | setConstantSpace (AddrSpace *spc) |
| Set the SLEIGH constant address space. | |
| void | setUniqueSpace (AddrSpace *spc) |
| Set the SLEIGH unique address space. | |
| void | setEnforceLocalKey (bool val) |
| Toggle whether use of the 'local' key is enforced. | |
| AddrSpace * | getDefaultSpace (void) const |
| Get the default address space. | |
| AddrSpace * | getConstantSpace (void) const |
| Get the constant address space. | |
| VarnodeTpl * | buildTemporary (void) |
| Create a temporary register (with 0 size) More... | |
| LabelSymbol * | defineLabel (string *name) |
| Create a SLEIGH label symbol. More... | |
| vector< OpTpl * > * | placeLabel (LabelSymbol *sym) |
| Create a raw expression containing the given label. More... | |
| vector< OpTpl * > * | newOutput (bool usesLocalKey, ExprTree *rhs, string *varname, uint4 size=0) |
| Create a new output VarnodeTpl for an expression. More... | |
| void | newLocalDefinition (string *varname, uint4 size=0) |
| Create a new temporary symbol (without generating any p-code) More... | |
| ExprTree * | createOp (OpCode opc, ExprTree *vn) |
| Add a new unary operation to the given expression. More... | |
| ExprTree * | createOp (OpCode opc, ExprTree *vn1, ExprTree *vn2) |
| Create a new binary operation combining the given expressions. More... | |
| ExprTree * | createOpOut (VarnodeTpl *outvn, OpCode opc, ExprTree *vn1, ExprTree *vn2) |
| Create a new binary operation combining the given input expressions and an explicit output VarnodeTpl. More... | |
| ExprTree * | createOpOutUnary (VarnodeTpl *outvn, OpCode opc, ExprTree *vn) |
| Create a new unary operation with the given expression as input and an explicit output VarnodeTpl. More... | |
| vector< OpTpl * > * | createOpNoOut (OpCode opc, ExprTree *vn) |
| Create a new unary operation with the given expression as input and no output. More... | |
| vector< OpTpl * > * | createOpNoOut (OpCode opc, ExprTree *vn1, ExprTree *vn2) |
| Create a new binary operation with the given expressions as input and no output. More... | |
| vector< OpTpl * > * | createOpConst (OpCode opc, uintb val) |
| Create a new unary operation with the given constant as input and no output. More... | |
| ExprTree * | createLoad (StarQuality *qual, ExprTree *ptr) |
| Create a new LOAD operation with the given pointer expression as input. More... | |
| vector< OpTpl * > * | createStore (StarQuality *qual, ExprTree *ptr, ExprTree *val) |
| Create a new STORE operation with the given expressions as inputs. More... | |
| ExprTree * | createUserOp (UserOpSymbol *sym, vector< ExprTree * > *param) |
| Create a CALLOTHER p-code op with temporary output, given a symbol and parameter expressions. More... | |
| vector< OpTpl * > * | createUserOpNoOut (UserOpSymbol *sym, vector< ExprTree * > *param) |
| Create a CALLOTHER p-code op, given a symbol and parameter expressions. More... | |
| ExprTree * | createVariadic (OpCode opc, vector< ExprTree * > *param) |
| Create a new operation with a variable number of inputs and a temporary output. More... | |
| void | appendOp (OpCode opc, ExprTree *res, uintb constval, int4 constsz) |
| Append a binary operation to the given expression. More... | |
| VarnodeTpl * | buildTruncatedVarnode (VarnodeTpl *basevn, uint4 bitoffset, uint4 numbits) |
| Build a truncated VarnodeTpl, if possible, from the given bit range. More... | |
| vector< OpTpl * > * | assignBitRange (VarnodeTpl *vn, uint4 bitoffset, uint4 numbits, ExprTree *rhs) |
| Assign an expression to a bit range within a given VarnodeTpl. More... | |
| ExprTree * | createBitRange (SpecificSymbol *sym, uint4 bitoffset, uint4 numbits) |
| Create an expression computing the indicated bit range of a symbol. More... | |
| VarnodeTpl * | addressOf (VarnodeTpl *var, uint4 size) |
| Produce a constant VarnodeTpl that is the offset of the storage address of the given VarnodeTpl. More... | |
Static Public Member Functions | |
| static void | force_size (VarnodeTpl *vt, const ConstTpl &size, const vector< OpTpl * > &ops) |
| Force a size on a specific VarnodeTpl if possible. More... | |
| static void | matchSize (int4 j, OpTpl *op, bool inputonly, const vector< OpTpl * > &ops) |
| Try to propagate a known size across a p-code operation to zero size inputs and outputs. More... | |
| static void | fillinZero (OpTpl *op, const vector< OpTpl * > &ops) |
| Try to deduce the size of all input and output VarnodeTpl for the given OpTpl. More... | |
| static bool | propagateSize (ConstructTpl *ct) |
| Propagate a size to all VarnodeTpl whose size is unknown. More... | |
Private Member Functions | |
| virtual uint4 | allocateTemp (void)=0 |
| Get the offset for the next available temporary register. More... | |
| virtual void | addSymbol (SleighSymbol *sym)=0 |
| Add a new symbol to the current scope. More... | |
Private Attributes | |
| AddrSpace * | defaultspace |
| SLEIGH's default address space. | |
| AddrSpace * | constantspace |
| SLEIGH's constant address space. | |
| AddrSpace * | uniqspace |
| SLEIGH's unique address space. | |
| uint4 | local_labelcount |
| Number of labels in current constructor. | |
| bool | enforceLocalKey |
| If true, force specification to use 'local' keyword when defining temporary varnodes. | |
The base class for compiling p-code expressions from SLEIGH syntax.
This is essentially a utility class for building OpTpl, VarnodeTpl, and their associated expressions. Address spaces must be provided via the setXXXSpace() methods, so that the class can model the corresponding SLEIGH concepts.
| VarnodeTpl * ghidra::PcodeCompile::addressOf | ( | VarnodeTpl * | var, |
| uint4 | size | ||
| ) |
Produce a constant VarnodeTpl that is the offset of the storage address of the given VarnodeTpl.
| var | is the given VarnodeTpl to take the address of |
| size | is the size of the resulting pointer constant (may be 0) |
References ghidra::AddrSpace::byteToAddress(), constantspace, ghidra::AddrSpace::getAddrSize(), ghidra::VarnodeTpl::getOffset(), ghidra::ConstTpl::getReal(), ghidra::ConstTpl::getSpace(), ghidra::VarnodeTpl::getSpace(), ghidra::ConstTpl::getType(), ghidra::AddrSpace::getWordSize(), ghidra::ConstTpl::real, and ghidra::ConstTpl::spaceid.
|
privatepure virtual |
Add a new symbol to the current scope.
| sym | is the symbol being added |
Implemented in ghidra::SleighPcode.
Referenced by defineLabel(), newLocalDefinition(), and newOutput().
|
privatepure virtual |
Get the offset for the next available temporary register.
A fixed number of bytes in the unique space is consumed.
Implemented in ghidra::SleighPcode.
Referenced by buildTemporary(), and newLocalDefinition().
Append a binary operation to the given expression.
A new operation is appended to the end of the expression. The root VarnodeTpl of the expression becomes the first input to the operation. The given constant value and size becomes the second input.
| opc | is the binary operation code |
| res | is the expression being modified and the first input |
| constval | is the second input value |
| constsz | is the second input size |
References ghidra::OpTpl::addInput(), buildTemporary(), constantspace, ghidra::ExprTree::ops, ghidra::ExprTree::outvn, ghidra::ConstTpl::real, and ghidra::OpTpl::setOutput().
Referenced by assignBitRange(), and createBitRange().
| vector< OpTpl * > * ghidra::PcodeCompile::assignBitRange | ( | VarnodeTpl * | vn, |
| uint4 | bitoffset, | ||
| uint4 | numbits, | ||
| ExprTree * | rhs | ||
| ) |
Assign an expression to a bit range within a given VarnodeTpl.
Other bits of the VarnodeTpl are preserved. The value assigned is taken from the root VarnodeTpl of the expression, which is assumed to have zero bits in any position greater than or equal to numbits. If the bit range falls on byte boundaries, the assignment is accomplished with byte based truncation operations. Otherwise mask and shift operations (INT_AND, INT_OR, and INT_LEFT) are used.
| vn | is the given VarnodeTpl being assigned to |
| bitoffset | is the starting bit of the range (0 indicates the least significant bit) |
| numbits | is the number of bits in the range |
| rhs | is the expression being assigned |
References appendOp(), buildTruncatedVarnode(), ghidra::CPUI_COPY, ghidra::CPUI_INT_AND, ghidra::CPUI_INT_LEFT, ghidra::CPUI_INT_OR, ghidra::CPUI_INT_ZEXT, createOp(), createOpOut(), createOpOutUnary(), force_size(), ghidra::ConstTpl::getReal(), ghidra::VarnodeTpl::getSize(), ghidra::ConstTpl::getType(), ghidra::ExprTree::ops, ghidra::ExprTree::outvn, ghidra::ConstTpl::real, and reportError().
| VarnodeTpl * ghidra::PcodeCompile::buildTemporary | ( | void | ) |
Create a temporary register (with 0 size)
Space for the register is allocated in the unique address space.
References allocateTemp(), ghidra::ConstTpl::real, ghidra::VarnodeTpl::setUnnamed(), and uniqspace.
Referenced by appendOp(), createLoad(), createOp(), createUserOp(), createVariadic(), and newOutput().
| VarnodeTpl * ghidra::PcodeCompile::buildTruncatedVarnode | ( | VarnodeTpl * | basevn, |
| uint4 | bitoffset, | ||
| uint4 | numbits | ||
| ) |
Build a truncated VarnodeTpl, if possible, from the given bit range.
The bit range must be on byte boundaries or NULL is returned. The VarnodeTpl being must already have fixed dimensions or be a handle. For a handle, the truncation is built using ConstTpl::v_offset_plus mechanics, allowing the truncation for exported values to be computed in the context of a specific instruction.
| basevn | is the VarnodeTpl to be truncated |
| bitoffset | is the starting bit of the range (0 indicates the least significant bit) |
| numbits | is the number of bits in the range |
References defaultspace, ghidra::ConstTpl::getHandleIndex(), ghidra::VarnodeTpl::getOffset(), ghidra::ConstTpl::getReal(), ghidra::VarnodeTpl::getSize(), ghidra::VarnodeTpl::getSpace(), ghidra::ConstTpl::getType(), ghidra::ConstTpl::handle, ghidra::AddrSpace::isBigEndian(), ghidra::ConstTpl::real, and ghidra::ConstTpl::v_offset_plus.
Referenced by assignBitRange(), and createBitRange().
| ExprTree * ghidra::PcodeCompile::createBitRange | ( | SpecificSymbol * | sym, |
| uint4 | bitoffset, | ||
| uint4 | numbits | ||
| ) |
Create an expression computing the indicated bit range of a symbol.
The result is truncated to the smallest byte size that can contain the indicated number of bits, with the desired bits shifted into the least significant positions. If the bit range is on byte boundaries, the truncation is accomplished with byte based truncation operations. Otherwise masks and shifts (INT_AND and INT_RIGHT) are used.
| sym | is the symbol representing the VarnodeTpl to truncate |
| bitoffset | is the starting bit of the range (0 indicates the least significant bit) |
| numbits | is the number of bits in the range |
References appendOp(), buildTruncatedVarnode(), ghidra::CPUI_INT_AND, ghidra::CPUI_INT_RIGHT, ghidra::CPUI_SUBPIECE, force_size(), getLocation(), ghidra::ConstTpl::getReal(), ghidra::VarnodeTpl::getSize(), ghidra::VarnodeTpl::getSpace(), ghidra::ConstTpl::getType(), ghidra::ConstTpl::handle, ghidra::VarnodeTpl::isZeroSize(), ghidra::ExprTree::ops, ghidra::ExprTree::outvn, ghidra::ConstTpl::real, reportError(), and ghidra::VarnodeTpl::setSize().
| ExprTree * ghidra::PcodeCompile::createLoad | ( | StarQuality * | qual, |
| ExprTree * | ptr | ||
| ) |
Create a new LOAD operation with the given pointer expression as input.
A new expression is created ending in a LOAD operation. The input pointer is the root VarnodeTpl of the given expression. The output is a new temporary register.
| qual | provides the address space and any knowledge of the size being LOADed |
| ptr | is the given pointer expression |
References ghidra::OpTpl::addInput(), buildTemporary(), constantspace, ghidra::CPUI_LOAD, force_size(), ghidra::StarQuality::id, ghidra::ExprTree::ops, ghidra::ExprTree::outvn, ghidra::ConstTpl::real, ghidra::OpTpl::setOutput(), and ghidra::StarQuality::size.
Add a new unary operation to the given expression.
A new expression is created ending in a unary operation. The input to the operation is the root VarnodeTpl of the given expression, and the output is a new temporary register.
| opc | is the unary operation code |
| vn | is the given input expression |
References ghidra::OpTpl::addInput(), buildTemporary(), ghidra::ExprTree::ops, ghidra::ExprTree::outvn, and ghidra::OpTpl::setOutput().
Referenced by assignBitRange().
Create a new binary operation combining the given expressions.
A new expression is created ending in a binary operation. Inputs to the operation are the root VarnodeTpl from the two given expressions, and the output is a new temporary register.
| opc | is the binary operation code |
| vn1 | is the first input expression |
| vn2 | is the second input expression |
References ghidra::OpTpl::addInput(), buildTemporary(), ghidra::ExprTree::ops, ghidra::ExprTree::outvn, and ghidra::OpTpl::setOutput().
Create a new unary operation with the given constant as input and no output.
A new expression is created ending in a unary operation. A new constant VarnodeTpl is created as input.
| opc | is the unary operation code |
| val | is the constant value of the input |
References ghidra::OpTpl::addInput(), constantspace, and ghidra::ConstTpl::real.
Create a new unary operation with the given expression as input and no output.
A new expression is created ending in a unary operation. The input to the operation is the root VarnodeTpl of the given expression.
| opc | is the unary operation code |
| vn | is the input expression |
References ghidra::OpTpl::addInput(), ghidra::ExprTree::ops, and ghidra::ExprTree::outvn.
| vector< OpTpl * > * ghidra::PcodeCompile::createOpNoOut | ( | OpCode | opc, |
| ExprTree * | vn1, | ||
| ExprTree * | vn2 | ||
| ) |
Create a new binary operation with the given expressions as input and no output.
A new expression is created ending in a binary operation. Inputs are the root VarnodeTpl of the given expressions.
| opc | is the binary operation code |
| vn1 | is the first input expression |
| vn2 | is the second input expression |
References ghidra::OpTpl::addInput(), ghidra::ExprTree::ops, and ghidra::ExprTree::outvn.
| ExprTree * ghidra::PcodeCompile::createOpOut | ( | VarnodeTpl * | outvn, |
| OpCode | opc, | ||
| ExprTree * | vn1, | ||
| ExprTree * | vn2 | ||
| ) |
Create a new binary operation combining the given input expressions and an explicit output VarnodeTpl.
A new expression is created ending in a binary operation. Inputs are the root VarnodeTpl from the two given expressions.
| outvn | is the explicit output of the new operation |
| opc | is the binary operation code |
| vn1 | is the first input expression |
| vn2 | is the second input expression |
References ghidra::OpTpl::addInput(), ghidra::ExprTree::ops, ghidra::ExprTree::outvn, and ghidra::OpTpl::setOutput().
Referenced by assignBitRange().
| ExprTree * ghidra::PcodeCompile::createOpOutUnary | ( | VarnodeTpl * | outvn, |
| OpCode | opc, | ||
| ExprTree * | vn | ||
| ) |
Create a new unary operation with the given expression as input and an explicit output VarnodeTpl.
A new expression is created ending in a unary operation. The input to the operation is the root VarnodeTpl of the given expression.
| outvn | is the explicit output of the new operation |
| opc | is the unary operation code |
| vn | is the input expression |
References ghidra::OpTpl::addInput(), ghidra::ExprTree::ops, ghidra::ExprTree::outvn, and ghidra::OpTpl::setOutput().
Referenced by assignBitRange().
| vector< OpTpl * > * ghidra::PcodeCompile::createStore | ( | StarQuality * | qual, |
| ExprTree * | ptr, | ||
| ExprTree * | val | ||
| ) |
Create a new STORE operation with the given expressions as inputs.
A new expression is created ending in a STORE operation. The inputs are the root VarnodeTpl of the given expressions.
| qual | provides the address space and any knowledge of the size being STOREed |
| ptr | is the pointer expression |
| val | is the value being STOREd |
References ghidra::OpTpl::addInput(), constantspace, ghidra::CPUI_STORE, force_size(), ghidra::StarQuality::id, ghidra::ExprTree::ops, ghidra::ExprTree::outvn, ghidra::ConstTpl::real, and ghidra::StarQuality::size.
Create a CALLOTHER p-code op with temporary output, given a symbol and parameter expressions.
A new expression is created ending in a CALLOTHER operation. Inputs are the root VarnodeTpl from the given array of expressions. The output is a new temporary register.
| sym | is the symbol to associate with CALLOTHER |
| param | is the array of input expressions |
References buildTemporary(), createUserOpNoOut(), ghidra::ExprTree::ops, and ghidra::ExprTree::outvn.
| vector< OpTpl * > * ghidra::PcodeCompile::createUserOpNoOut | ( | UserOpSymbol * | sym, |
| vector< ExprTree * > * | param | ||
| ) |
Create a CALLOTHER p-code op, given a symbol and parameter expressions.
A new expression is created ending in a CALLOTHER operation, with no output. Inputs are the root VarnodeTpl from the given array of expressions.
| sym | is the symbol to associate with the CALLOTHER |
| param | is the array of input expressions |
References ghidra::OpTpl::addInput(), ghidra::ExprTree::appendParams(), constantspace, ghidra::CPUI_CALLOTHER, and ghidra::ConstTpl::real.
Referenced by createUserOp().
Create a new operation with a variable number of inputs and a temporary output.
A new expression is created ending in the new operation. Inputs are the root VarnodeTpl from the given array of expressions. The output is a new temporary register.
| opc | is the variadic operation code |
| param | is the array of input expressions |
References ghidra::ExprTree::appendParams(), buildTemporary(), ghidra::ExprTree::ops, and ghidra::ExprTree::outvn.
| LabelSymbol * ghidra::PcodeCompile::defineLabel | ( | string * | name | ) |
Create a SLEIGH label symbol.
The parsed name and the next available id are assigned to the label. The symbol is assigned to the current scope.
| name | is the parsed name of the label |
References addSymbol(), and local_labelcount.
Try to deduce the size of all input and output VarnodeTpl for the given OpTpl.
For any VarnodeTpl whose size is not known (isZeroSize() returns true), an attempt is made to fill in the size from another input or output of the OpTpl.
References ghidra::CPUI_BOOL_AND, ghidra::CPUI_BOOL_NEGATE, ghidra::CPUI_BOOL_OR, ghidra::CPUI_BOOL_XOR, ghidra::CPUI_COPY, ghidra::CPUI_CPOOLREF, ghidra::CPUI_FLOAT_ABS, ghidra::CPUI_FLOAT_ADD, ghidra::CPUI_FLOAT_CEIL, ghidra::CPUI_FLOAT_DIV, ghidra::CPUI_FLOAT_EQUAL, ghidra::CPUI_FLOAT_FLOOR, ghidra::CPUI_FLOAT_LESS, ghidra::CPUI_FLOAT_LESSEQUAL, ghidra::CPUI_FLOAT_MULT, ghidra::CPUI_FLOAT_NAN, ghidra::CPUI_FLOAT_NEG, ghidra::CPUI_FLOAT_NOTEQUAL, ghidra::CPUI_FLOAT_ROUND, ghidra::CPUI_FLOAT_SQRT, ghidra::CPUI_FLOAT_SUB, ghidra::CPUI_INT_2COMP, ghidra::CPUI_INT_ADD, ghidra::CPUI_INT_AND, ghidra::CPUI_INT_CARRY, ghidra::CPUI_INT_DIV, ghidra::CPUI_INT_EQUAL, ghidra::CPUI_INT_LEFT, ghidra::CPUI_INT_LESS, ghidra::CPUI_INT_LESSEQUAL, ghidra::CPUI_INT_MULT, ghidra::CPUI_INT_NEGATE, ghidra::CPUI_INT_NOTEQUAL, ghidra::CPUI_INT_OR, ghidra::CPUI_INT_REM, ghidra::CPUI_INT_RIGHT, ghidra::CPUI_INT_SBORROW, ghidra::CPUI_INT_SCARRY, ghidra::CPUI_INT_SDIV, ghidra::CPUI_INT_SLESS, ghidra::CPUI_INT_SLESSEQUAL, ghidra::CPUI_INT_SREM, ghidra::CPUI_INT_SRIGHT, ghidra::CPUI_INT_SUB, ghidra::CPUI_INT_XOR, ghidra::CPUI_SUBPIECE, force_size(), ghidra::OpTpl::getIn(), ghidra::OpTpl::getOpcode(), ghidra::OpTpl::getOut(), ghidra::VarnodeTpl::getSize(), ghidra::VarnodeTpl::isZeroSize(), matchSize(), ghidra::OpTpl::numInput(), and ghidra::ConstTpl::real.
Referenced by propagateSize().
|
static |
Force a size on a specific VarnodeTpl if possible.
If the VarnodeTpl already has a fixed size, this method does nothing. If the VarnodeTpl is a temporary register then all other temporaries with the same offset in the same expression are also adjusted.
| vt | is the specific VarnodeTpl to adjust |
| size | is the size constant to assign |
| ops | is the array of OpTpl in the expression |
References ghidra::OpTpl::getIn(), ghidra::VarnodeTpl::getOffset(), ghidra::OpTpl::getOut(), ghidra::ConstTpl::getReal(), ghidra::VarnodeTpl::getSize(), ghidra::ConstTpl::getType(), ghidra::VarnodeTpl::isLocalTemp(), ghidra::OpTpl::numInput(), ghidra::ConstTpl::real, and ghidra::VarnodeTpl::setSize().
Referenced by assignBitRange(), createBitRange(), createLoad(), createStore(), fillinZero(), and matchSize().
|
pure virtual |
Get the parse location associated with the given symbol.
This is generally where the symbol is first defined.
| sym | is the given symbol |
Implemented in ghidra::SleighPcode.
Referenced by createBitRange(), newOutput(), and placeLabel().
|
static |
Try to propagate a known size across a p-code operation to zero size inputs and outputs.
If the OpTpl has an input (or output) VarnodeTpl with a know non-zero size, try to force this size onto the VarnodeTpl in the indicated slot.
| j | is the slot we are trying to fill (-1=output) |
| op | is the p-code operation to propagate the size across |
| inputonly | indicates, if true, whether the size propagates only between inputs of the operation. |
| ops | is an array of all operations in the sequence |
References force_size(), ghidra::OpTpl::getIn(), ghidra::OpTpl::getOut(), ghidra::VarnodeTpl::getSize(), ghidra::VarnodeTpl::isZeroSize(), and ghidra::OpTpl::numInput().
Referenced by fillinZero().
| void ghidra::PcodeCompile::newLocalDefinition | ( | string * | varname, |
| uint4 | size = 0 |
||
| ) |
Create a new temporary symbol (without generating any p-code)
A temporary register is allocated, and the symbol is added to the current scope.
| varname | is the parsed symbol name |
| size | is the size of the new register (0 indicates the size is initially unknown) |
References addSymbol(), allocateTemp(), and uniqspace.
| vector< OpTpl * > * ghidra::PcodeCompile::newOutput | ( | bool | usesLocalKey, |
| ExprTree * | rhs, | ||
| string * | varname, | ||
| uint4 | size = 0 |
||
| ) |
Create a new output VarnodeTpl for an expression.
A new named temporary register is created and assigned as the root of the given expression. A symbol representing the register is added to the current scope.
| usesLocalKey | is true if the name was defined with the 'local' keyword |
| rhs | is the given expression |
| varname | is the parsed symbol name to associate with the new register |
| size | is non-zero if an explicit size was provided in the parsed definition |
References addSymbol(), buildTemporary(), enforceLocalKey, getLocation(), ghidra::VarnodeTpl::getOffset(), ghidra::ConstTpl::getReal(), ghidra::ExprTree::getSize(), ghidra::VarnodeTpl::getSize(), ghidra::ConstTpl::getSpace(), ghidra::VarnodeTpl::getSpace(), ghidra::ConstTpl::getType(), ghidra::ConstTpl::real, reportError(), ghidra::ExprTree::setOutput(), ghidra::VarnodeTpl::setSize(), and ghidra::ExprTree::toVector().
| vector< OpTpl * > * ghidra::PcodeCompile::placeLabel | ( | LabelSymbol * | labsym | ) |
Create a raw expression containing the given label.
A placeholder OpTpl for the label is created and returned, as an array.
| labsym | is the given label |
References ghidra::OpTpl::addInput(), constantspace, getLocation(), LABELBUILD, ghidra::ConstTpl::real, and reportError().
|
static |
Propagate a size to all VarnodeTpl whose size is unknown.
Size information is propagated across operations and expressions as far as possible. If there are any remaining VarnodeTpl whose size is unknown, return false.
| ct | is the set of p-code operations to propagate across |
References fillinZero(), and ghidra::ConstructTpl::getOpvec().
Referenced by ghidra::SleighCompile::buildMacro(), and ghidra::SleighCompile::finalizeSections().
|
pure virtual |
Report a fatal error in parsing.
Parsing may continue, but a final output is not produced.
| loc | is the location of the error |
| msg | is a description of the error |
Implemented in ghidra::SleighPcode.
Referenced by assignBitRange(), createBitRange(), newOutput(), and placeLabel().
|
pure virtual |
Report a non-fatal issue encountered during parsing.
| loc | is the location of the issue |
| msg | is a description of the issue |
Implemented in ghidra::SleighPcode.