ROSE  0.9.9.109
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 RegisterDictionary *registers=NULL);
10 
12 ROSE_DLL_API std::string unparseInstructionWithAddress(SgAsmInstruction*,
14  const 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,
22  const RegisterDictionary *registers);
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*, const RegisterDictionary*);
36 std::string unparseX86Expression(SgAsmExpression*, const Rose::BinaryAnalysis::AsmUnparser::LabelMap*,
37  const RegisterDictionary*, bool leaMode);
38 std::string unparseX86Register(RegisterDescriptor, const RegisterDictionary*);
39 std::string unparseX86Register(SgAsmInstruction*, RegisterDescriptor, const RegisterDictionary*);
40 
41 /*-------------------------------------------------------------------------------------------------------------------------------
42  * ARM
43  *-------------------------------------------------------------------------------------------------------------------------------*/
44 enum ArmSignForExpressionUnparsing
45 {
46  arm_sign_none,
47  arm_sign_plus,
48  arm_sign_minus
49 } ;
50 
51 std::string unparseArmMnemonic(SgAsmArmInstruction*);
52 std::string unparseArmExpression(SgAsmExpression*, const Rose::BinaryAnalysis::AsmUnparser::LabelMap*, const RegisterDictionary*);
53 
54 /*-------------------------------------------------------------------------------------------------------------------------------
55  * PowerPC
56  *-------------------------------------------------------------------------------------------------------------------------------*/
57 
58 std::string unparsePowerpcMnemonic(SgAsmPowerpcInstruction*);
59 std::string unparsePowerpcExpression(SgAsmExpression*, const Rose::BinaryAnalysis::AsmUnparser::LabelMap*,
60  const RegisterDictionary*);
61 
62 /*-------------------------------------------------------------------------------------------------------------------------------
63  * MIPS
64  *-------------------------------------------------------------------------------------------------------------------------------*/
65 
66 std::string unparseMipsMnemonic(SgAsmMipsInstruction*);
67 std::string unparseMipsExpression(SgAsmExpression*, const Rose::BinaryAnalysis::AsmUnparser::LabelMap*, const RegisterDictionary*);
68 
69 /*-------------------------------------------------------------------------------------------------------------------------------
70  * M68k
71  *-------------------------------------------------------------------------------------------------------------------------------*/
72 
73 std::string unparseM68kMnemonic(SgAsmM68kInstruction*);
74 std::string unparseM68kExpression(SgAsmExpression*, const Rose::BinaryAnalysis::AsmUnparser::LabelMap*, const RegisterDictionary*);
75 
76 
77 #endif
Base class for machine instructions.
Describes (part of) a physical CPU register.
Represents one PowerPC machine instruction.
Represents one Intel x86 machine instruction.
Defines registers available for a particular architecture.
Definition: Registers.h:32
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
Represents an interpretation of a binary container.