ROSE  0.9.11.42
AsmUnparser_compat.h
1 /* Old functions for backward compatitility, reimplemented in terms of AsmUnparser. */
2 #ifndef ROSE_ASM_UNPARSER_COMPAT_H
3 #define ROSE_ASM_UNPARSER_COMPAT_H
4 
5 #include "AsmUnparser.h"
6 
8 ROSE_DLL_API std::string unparseInstruction(SgAsmInstruction*, const Rose::BinaryAnalysis::AsmUnparser::LabelMap *labels=NULL,
9  const Rose::BinaryAnalysis::RegisterDictionary *registers=NULL);
10 
12 ROSE_DLL_API std::string unparseInstructionWithAddress(SgAsmInstruction*,
14  const Rose::BinaryAnalysis::RegisterDictionary *registers=NULL);
15 
17 ROSE_DLL_API std::string unparseMnemonic(SgAsmInstruction*);
18 
21 ROSE_DLL_API std::string unparseExpression(SgAsmExpression*, const Rose::BinaryAnalysis::AsmUnparser::LabelMap *labels,
23 
24 ROSE_DLL_API std::string unparseAsmStatement(SgAsmStatement*);
25 
26 ROSE_DLL_API void unparseAsmStatementToFile(const std::string& filename, SgAsmStatement*);
27 
28 ROSE_DLL_API std::string unparseAsmInterpretation(SgAsmInterpretation*);
29 
30 /*-------------------------------------------------------------------------------------------------------------------------------
31  * X86
32  *-------------------------------------------------------------------------------------------------------------------------------*/
33 
34 std::string unparseX86Mnemonic(SgAsmX86Instruction*);
35 std::string unparseX86Expression(SgAsmExpression*, const Rose::BinaryAnalysis::AsmUnparser::LabelMap*,
37 std::string unparseX86Expression(SgAsmExpression*, const Rose::BinaryAnalysis::AsmUnparser::LabelMap*,
38  const Rose::BinaryAnalysis::RegisterDictionary*, bool leaMode);
40 std::string unparseX86Register(SgAsmInstruction*, Rose::BinaryAnalysis::RegisterDescriptor,
42 
43 /*-------------------------------------------------------------------------------------------------------------------------------
44  * ARM
45  *-------------------------------------------------------------------------------------------------------------------------------*/
46 enum ArmSignForExpressionUnparsing
47 {
48  arm_sign_none,
49  arm_sign_plus,
50  arm_sign_minus
51 } ;
52 
53 std::string unparseArmMnemonic(SgAsmArmInstruction*);
54 std::string unparseArmExpression(SgAsmExpression*, const Rose::BinaryAnalysis::AsmUnparser::LabelMap*,
56 
57 /*-------------------------------------------------------------------------------------------------------------------------------
58  * PowerPC
59  *-------------------------------------------------------------------------------------------------------------------------------*/
60 
61 std::string unparsePowerpcMnemonic(SgAsmPowerpcInstruction*);
62 std::string unparsePowerpcExpression(SgAsmExpression*, const Rose::BinaryAnalysis::AsmUnparser::LabelMap*,
64 
65 /*-------------------------------------------------------------------------------------------------------------------------------
66  * MIPS
67  *-------------------------------------------------------------------------------------------------------------------------------*/
68 
69 std::string unparseMipsMnemonic(SgAsmMipsInstruction*);
70 std::string unparseMipsExpression(SgAsmExpression*, const Rose::BinaryAnalysis::AsmUnparser::LabelMap*,
72 
73 /*-------------------------------------------------------------------------------------------------------------------------------
74  * M68k
75  *-------------------------------------------------------------------------------------------------------------------------------*/
76 
77 std::string unparseM68kMnemonic(SgAsmM68kInstruction*);
78 std::string unparseM68kExpression(SgAsmExpression*, const Rose::BinaryAnalysis::AsmUnparser::LabelMap*,
80 
81 
82 #endif
Base class for machine instructions.
Describes (part of) a physical CPU register.
Represents one PowerPC machine instruction.
Represents one Intel x86 machine instruction.
Base class for statement-like subclasses.
Base class for expressions.
Represents one MIPS machine instruction.
Represents one ARM machine instruction.
std::map< uint64_t, std::string > LabelMap
Maps integers to labels.
Definition: AsmUnparser.h:897
Defines registers available for a particular architecture.
Definition: Registers.h:35
Represents an interpretation of a binary container.