125 void buildTypeStack(
const Datatype *ct,vector<const Datatype *> &typestack);
126 void pushPrototypeInputs(
const FuncProto *proto);
127 virtual void pushTypeStart(
const Datatype *ct,
bool noident);
128 virtual void pushTypeEnd(
const Datatype *ct);
139 virtual bool doEmitWideCharPrefix(
void)
const;
141 bool checkArrayDeref(
const Varnode *vn)
const;
142 void emitStructDefinition(
const TypeStruct *ct);
143 void emitEnumDefinition(
const TypeEnum *ct);
145 void emitPrototypeInputs(
const FuncProto *proto);
146 void emitGlobalVarDeclsRecursive(
Scope *scope);
147 void emitLocalVarDecls(
const Funcdata *fd);
148 void emitStatement(
const PcodeOp *inst);
149 bool emitInplaceOp(
const PcodeOp *op);
151 void emitSwitchCase(int4 casenum,
const BlockSwitch *switchbl);
153 void emitLabelStatement(
const FlowBlock *bl);
154 void emitAnyLabelStatement(
const FlowBlock *bl);
155 void emitCommentGroup(
const PcodeOp *inst);
156 void emitCommentFuncHeader(
const Funcdata *fd);
157 void opFunc(
const PcodeOp *op);
158 void opTypeCast(
const PcodeOp *op);
159 void opHiddenFunc(
const PcodeOp *op);
160 static bool hasCharTerminator(uint1 *buffer,int4 size,int4 charsize);
161 bool printCharacterConstant(ostream &s,
const Address &addr,int4 charsize)
const;
162 virtual void pushConstant(uintb val,
const Datatype *ct,
164 virtual bool pushEquate(uintb val,int4 sz,
const EquateSymbol *sym,
169 virtual void pushUnnamedLocation(
const Address &addr,
171 virtual void pushPartialSymbol(
const Symbol *sym,int4 off,int4 sz,
173 virtual void pushMismatchSymbol(
const Symbol *sym,int4 off,int4 sz,
175 virtual void push_integer(uintb val,int4 sz,
bool sign,
178 virtual void push_float(uintb val,int4 sz,
const Varnode *vn,
180 virtual void printUnicode(ostream &s,int4 onechar)
const;
181 virtual void pushType(
const Datatype *ct);
182 virtual string genericFunctionName(
const Address &addr);
183 virtual string genericTypeName(
const Datatype *ct);
185 virtual void emitExpression(
const PcodeOp *op);
186 virtual void emitVarDecl(
const Symbol *sym);
187 virtual void emitVarDeclStatement(
const Symbol *sym);
188 virtual bool emitScopeVarDecls(
const Scope *scope,int4 cat);
189 virtual void emitFunctionDeclaration(
const Funcdata *fd);
190 virtual void emitTypeDefinition(
const Datatype *ct);
191 virtual bool checkPrintNegation(
const Varnode *vn);
203 virtual void adjustTypeOperators(
void);
204 virtual void setCommentStyle(
const string &nm);
205 virtual bool isCharacterConstant(
const uint1 *buf,int4 size,int4 charsize)
const;
206 virtual void docTypeDefinitions(
const TypeFactory *typegrp);
207 virtual void docAllGlobals(
void);
208 virtual void docSingleGlobal(
const Symbol *sym);
209 virtual void docFunction(
const Funcdata *fd);
211 virtual void emitBlockBasic(
const BlockBasic *bb);
212 virtual void emitBlockGraph(
const BlockGraph *bl);
213 virtual void emitBlockCopy(
const BlockCopy *bl);
214 virtual void emitBlockGoto(
const BlockGoto *bl);
215 virtual void emitBlockLs(
const BlockList *bl);
217 virtual void emitBlockIf(
const BlockIf *bl);
221 virtual void emitBlockSwitch(
const BlockSwitch *bl);
223 virtual void opCopy(
const PcodeOp *op);
224 virtual void opLoad(
const PcodeOp *op);
225 virtual void opStore(
const PcodeOp *op);
226 virtual void opBranch(
const PcodeOp *op);
227 virtual void opCbranch(
const PcodeOp *op);
228 virtual void opBranchind(
const PcodeOp *op);
229 virtual void opCall(
const PcodeOp *op);
230 virtual void opCallind(
const PcodeOp *op);
231 virtual void opCallother(
const PcodeOp *op);
232 virtual void opConstructor(
const PcodeOp *op,
bool withNew);
233 virtual void opReturn(
const PcodeOp *op);
260 virtual void opBoolNegate(
const PcodeOp *op);
285 virtual void opSubpiece(
const PcodeOp *op);
287 virtual void opPtradd(
const PcodeOp *op);
288 virtual void opPtrsub(
const PcodeOp *op);
289 virtual void opSegmentOp(
const PcodeOp *op);
290 virtual void opCpoolRefOp(
const PcodeOp *op);
291 virtual void opNewOp(
const PcodeOp *op);
292 virtual void opInsertOp(
const PcodeOp *op);
293 virtual void opExtractOp(
const PcodeOp *op);
virtual void opIntMult(const PcodeOp *op)
Emit a INT_MULT operator.
Definition: printc.hh:255
static OpToken pointer_member
The points to member operator.
Definition: printc.hh:68
static OpToken leftequal
The in-place left shift operator.
Definition: printc.hh:105
Description of a control-flow block containing PcodeOps.
Definition: block.hh:60
virtual void opFloatTrunc(const PcodeOp *op)
Emit a FLOAT_TRUNC operator.
Definition: printc.hh:278
static OpToken bitwise_xor
The logical xor operator.
Definition: printc.hh:92
virtual void opFloatAdd(const PcodeOp *op)
Emit a FLOAT_ADD operator.
Definition: printc.hh:269
The base datatype class for the decompiler.
Definition: type.hh:62
A loop structure where the condition is checked at the bottom.
Definition: block.hh:599
virtual void opFloatMult(const PcodeOp *op)
Emit a FLOAT_MULT operator.
Definition: printc.hh:271
virtual void opIntLessEqual(const PcodeOp *op)
Emit a INT_LESSEQUAL operator.
Definition: printc.hh:239
static OpToken divequal
The in-place division operator.
Definition: printc.hh:101
Classes for printing tokens in a high-level language.
A composite Datatype object: A "structure" with component "fields".
Definition: type.hh:301
virtual void opPopcountOp(const PcodeOp *op)
Emit a POPCOUNT operator.
Definition: printc.hh:294
string fieldname
The name of the field.
Definition: printc.hh:49
virtual void opFloatEqual(const PcodeOp *op)
Emit a FLOAT_EQUAL operator.
Definition: printc.hh:264
Base class for the fundamental atomic types.
Definition: type.hh:158
static OpToken bitwise_and
The logical and operator.
Definition: printc.hh:91
Container for data structures associated with a single function.
Definition: funcdata.hh:45
static OpToken greater_equal
The greater than or equal operator.
Definition: printc.hh:88
static OpToken andequal
The in-place logical and operator.
Definition: printc.hh:107
virtual void opBoolAnd(const PcodeOp *op)
Emit a BOOL_AND operator.
Definition: printc.hh:262
virtual void opFloatSqrt(const PcodeOp *op)
Emit a FLOAT_SQRT operator.
Definition: printc.hh:275
static OpToken function_call
The function call operator.
Definition: printc.hh:70
static OpToken boolean_not
The boolean not operator.
Definition: printc.hh:72
static OpToken boolean_or
The boolean or operator.
Definition: printc.hh:95
static OpToken new_op
The new operator.
Definition: printc.hh:99
virtual void opIntEqual(const PcodeOp *op)
Emit a INT_EQUAL operator.
Definition: printc.hh:234
Datatype object representing a pointer.
Definition: type.hh:219
A structure for pushing nested fields to the RPN stack.
Definition: printc.hh:45
virtual void opIntSrem(const PcodeOp *op)
Emit a INT_SREM operator.
Definition: printc.hh:259
virtual void opIntAdd(const PcodeOp *op)
Emit a INT_ADD operator.
Definition: printc.hh:242
A loop structure where the condition is checked at the top.
Definition: block.hh:583
static OpToken plusequal
The in-place addition operator.
Definition: printc.hh:103
virtual void opFloatLess(const PcodeOp *op)
Emit a FLOAT_LESS operator.
Definition: printc.hh:266
static OpToken unary_minus
The unary minus operator.
Definition: printc.hh:73
Specifies subfields of a structure or what a pointer points to.
Definition: type.hh:124
static OpToken minusequal
The in-place subtraction operator.
Definition: printc.hh:104
bool option_hide_exts
Set to true if we should hide implied extension operations.
Definition: printc.hh:120
static OpToken ptr_expr
Pointer adornment for a type declaration.
Definition: printc.hh:112
static OpToken assignment
The assignment operator.
Definition: printc.hh:97
static OpToken multequal
The in-place multiplication operator.
Definition: printc.hh:100
EmitXml::syntax_highlight hilite
Highlight information for the field token.
Definition: printc.hh:50
virtual void opIntSright(const PcodeOp *op)
Emit a INT_SRIGHT operator.
Definition: printc.hh:254
virtual void opFloatAbs(const PcodeOp *op)
Emit a FLOAT_ABS operator.
Definition: printc.hh:274
virtual void opIntOr(const PcodeOp *op)
Emit a INT_OR operator.
Definition: printc.hh:251
static OpToken divide
The division operator.
Definition: printc.hh:79
void setNULLPrinting(bool val)
Toggle the printing of a 'NULL' token.
Definition: printc.hh:194
virtual PrintLanguage * buildLanguage(Architecture *glb)
Build the main PrintLanguage object corresponding to this capability.
Definition: printc.cc:86
virtual void opBoolXor(const PcodeOp *op)
Emit a BOOL_XOR operator.
Definition: printc.hh:261
static OpToken bitwise_or
The logical or operator.
Definition: printc.hh:93
An infinite loop structure.
Definition: block.hh:613
void setInplaceOps(bool val)
Toggle the printing of in-place operators.
Definition: printc.hh:195
static OpToken type_expr_space
Type declaration involving a space (identifier or adornment)
Definition: printc.hh:110
void setHideImpliedExts(bool val)
Toggle whether implied extensions are hidden.
Definition: printc.hh:201
static OpToken not_equal
The not equal operator.
Definition: printc.hh:90
CommentSorter commsorter
Container/organizer for comments in the current function.
Definition: printc.hh:122
static OpToken binary_plus
The binary addition operator.
Definition: printc.hh:81
static OpToken boolean_and
The boolean and operator.
Definition: printc.hh:94
static OpToken shift_left
The left shift operator.
Definition: printc.hh:83
A token representing an operator in the high-level language.
Definition: printlanguage.hh:81
static OpToken subscript
The array subscript operator.
Definition: printc.hh:69
void setDisplayUnplaced(bool val)
Toggle whether unplaced comments are displayed in the header.
Definition: printc.hh:200
virtual void opIntSub(const PcodeOp *op)
Emit a INT_SUB operator.
Definition: printc.hh:243
virtual void opFloatFloat2Float(const PcodeOp *op)
Emit a FLOAT_FLOAT2FLOAT operator.
Definition: printc.hh:277
Lowest level operation of the p-code language.
Definition: op.hh:58
static OpToken remequal
The in-place modulo operator.
Definition: printc.hh:102
A low-level machine address for labelling bytes and data.
Definition: address.hh:46
static OpToken bitwise_not
The bitwise negate operator.
Definition: printc.hh:71
virtual void opFloatFloor(const PcodeOp *op)
Emit a FLOAT_FLOOR operator.
Definition: printc.hh:280
A basic "if" block.
Definition: block.hh:553
virtual void opFloatDiv(const PcodeOp *op)
Emit a FLOAT_DIV operator.
Definition: printc.hh:270
bool option_unplaced
Set to true if we should display unplaced comments.
Definition: printc.hh:119
virtual void opIntRem(const PcodeOp *op)
Emit a INT_REM operator.
Definition: printc.hh:258
virtual void opFloatNeg(const PcodeOp *op)
Emit a FLOAT_NEG operator.
Definition: printc.hh:273
syntax_highlight
Possible types of syntax highlighting.
Definition: prettyprint.hh:87
bool option_inplace_ops
Set to true if we should use '+=' '&=' etc.
Definition: printc.hh:116
virtual void opPiece(const PcodeOp *op)
Emit a PIECE operator.
Definition: printc.hh:284
Manager for all the major decompiler subsystems.
Definition: architecture.hh:117
static OpToken shift_right
The right shift operator.
Definition: printc.hh:84
const Datatype * parent
The parent data-type owning the field.
Definition: printc.hh:48
The c-language token emitter.
Definition: printc.hh:63
A control-flow block built out of sub-components.
Definition: block.hh:270
void setCPlusPlusStyleComments(void)
Set c++-style "//" comment delimiters.
Definition: printc.hh:199
virtual void opIntNotEqual(const PcodeOp *op)
Emit a INT_NOTEQUAL operator.
Definition: printc.hh:235
virtual void opFloatSub(const PcodeOp *op)
Emit a FLOAT_SUB operator.
Definition: printc.hh:272
virtual void opIntSdiv(const PcodeOp *op)
Emit a INT_SDIV operator.
Definition: printc.hh:257
A low-level variable or contiguous set of bytes described by an Address and a size.
Definition: varnode.hh:65
void setConvention(bool val)
Toggle whether calling conventions are printed.
Definition: printc.hh:196
A basic block for p-code operations.
Definition: block.hh:363
static OpToken type_expr_nospace
Type declaration with no space.
Definition: printc.hh:111
static OpToken less_than
The less than operator.
Definition: printc.hh:85
Factory and static initializer for the "c-language" back-end to the decompiler.
Definition: printc.hh:32
virtual void opIntCarry(const PcodeOp *op)
Emit a INT_CARRY operator.
Definition: printc.hh:244
virtual void opFloatRound(const PcodeOp *op)
Emit a FLOAT_ROUND operator.
Definition: printc.hh:281
A map from values to control-flow targets within a function.
Definition: jumptable.hh:499
static OpToken equal
The equal operator.
Definition: printc.hh:89
static OpToken modulo
The modulo operator.
Definition: printc.hh:80
virtual void opFloatNan(const PcodeOp *op)
Emit a FLOAT_NAN operator.
Definition: printc.hh:268
virtual void opIntSlessEqual(const PcodeOp *op)
Emit a INT_SLESSEQUAL operator.
Definition: printc.hh:237
static OpToken rightequal
The in-place right shift operator.
Definition: printc.hh:106
bool option_nocasts
Don't print a cast if true.
Definition: printc.hh:118
A series of blocks that execute in sequence.
Definition: block.hh:495
virtual void opIntSborrow(const PcodeOp *op)
Emit a INT_SBORROW operator.
Definition: printc.hh:246
static OpToken object_member
The member operator.
Definition: printc.hh:67
static OpToken array_expr
Array adornment for a type declaration.
Definition: printc.hh:113
virtual void opCast(const PcodeOp *op)
Emit a CAST operator.
Definition: printc.hh:286
static OpToken typecast
The type cast operator.
Definition: printc.hh:77
virtual void opIntXor(const PcodeOp *op)
Emit a INT_XOR operator.
Definition: printc.hh:249
virtual void opIntNegate(const PcodeOp *op)
Emit a INT_NEGATE operator.
Definition: printc.hh:248
virtual void opIntLess(const PcodeOp *op)
Emit a INT_LESS operator.
Definition: printc.hh:238
const OpToken * token
Operator used to drill-down to the field.
Definition: printc.hh:46
A Symbol that holds equate information for a constant.
Definition: database.hh:270
A block that terminates with an unstructured (goto) branch to another block.
Definition: block.hh:442
static OpToken greater_than
The greater than operator.
Definition: printc.hh:87
virtual void opIntDiv(const PcodeOp *op)
Emit a INT_DIV operator.
Definition: printc.hh:256
virtual void opIndirect(const PcodeOp *op)
Emit a INDIRECT operator.
Definition: printc.hh:283
void setCStyleComments(void)
Set c-style "/* */" comment delimiters.
Definition: printc.hh:198
virtual void opIntLeft(const PcodeOp *op)
Emit a INT_LEFT operator.
Definition: printc.hh:252
virtual void opIntRight(const PcodeOp *op)
Emit a INT_RIGHT operator.
Definition: printc.hh:253
A structured switch construction.
Definition: block.hh:630
bool option_NULL
Set to true if we should emit NULL keyword.
Definition: printc.hh:115
A function prototype.
Definition: fspec.hh:1147
Container class for all Datatype objects in an Architecture.
Definition: type.hh:380
static OpToken hidden
Hidden functional (that may force parentheses)
Definition: printc.hh:65
static OpToken orequal
The in-place logical or operator.
Definition: printc.hh:108
The base class for a symbol in a symbol table or scope.
Definition: database.hh:153
static OpToken boolean_xor
The boolean xor operator.
Definition: printc.hh:96
static OpToken multiply
The multiplication operator.
Definition: printc.hh:78
virtual void opMultiequal(const PcodeOp *op)
Emit a MULTIEQUAL operator.
Definition: printc.hh:282
virtual void opIntSless(const PcodeOp *op)
Emit a INT_SLESS operator.
Definition: printc.hh:236
static OpToken less_equal
The less than or equal operator.
Definition: printc.hh:86
Base type for character data-types: i.e. char.
Definition: type.hh:174
static OpToken enum_cat
The concatenation operator for enumerated values.
Definition: printc.hh:114
virtual void opFloatInt2Float(const PcodeOp *op)
Emit a FLOAT_INT2FLOAT operator.
Definition: printc.hh:276
static OpToken scope
The sub-scope/namespace operator.
Definition: printc.hh:66
const TypeField * field
The component object describing the field.
Definition: printc.hh:47
string nullToken
Token to use for 'null'.
Definition: printc.hh:121
static OpToken dereference
The pointer dereference operator.
Definition: printc.hh:76
virtual void opIntScarry(const PcodeOp *op)
Emit a INT_SCARRY operator.
Definition: printc.hh:245
virtual void opIntAnd(const PcodeOp *op)
Emit a INT_AND operator.
Definition: printc.hh:250
virtual void opFloatNotEqual(const PcodeOp *op)
Emit a FLOAT_NOTEQUAL operator.
Definition: printc.hh:265
virtual void opFloatCeil(const PcodeOp *op)
Emit a FLOAT_CEIL operator.
Definition: printc.hh:279
bool option_convention
Set to true if we should print calling convention.
Definition: printc.hh:117
An enumerated Datatype object: an integer with named values.
Definition: type.hh:277
virtual void opFloatLessEqual(const PcodeOp *op)
Emit a FLOAT_LESSEQUAL operator.
Definition: printc.hh:267
Two conditional blocks combined into one conditional using BOOL_AND or BOOL_OR.
Definition: block.hh:516
virtual void opBoolOr(const PcodeOp *op)
Emit a BOOL_OR operator.
Definition: printc.hh:263
static OpToken unary_plus
The unary plus operator.
Definition: printc.hh:74
static OpToken addressof
The address of operator.
Definition: printc.hh:75
The base class API for emitting a high-level language.
Definition: printlanguage.hh:134
static OpToken comma
The comma operator (for parameter lists)
Definition: printc.hh:98
static OpToken binary_minus
The binary subtraction operator.
Definition: printc.hh:82
Base class for high-level language capabilities.
Definition: printlanguage.hh:39
This class is used to mirror the BlockBasic objects in the fixed control-flow graph for a function...
Definition: block.hh:417
void setNoCastPrinting(bool val)
Toggle whether casts should not be printed.
Definition: printc.hh:197
static OpToken xorequal
The in-place logical xor operator.
Definition: printc.hh:109
virtual void opInt2Comp(const PcodeOp *op)
Emit a INT_2COMP operator.
Definition: printc.hh:247
A collection of Symbol objects within a single (namespace or functional) scope.
Definition: database.hh:413