ROSE  0.11.21.0
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 <featureTests.h>
6 #ifdef ROSE_ENABLE_BINARY_ANALYSIS
7 #include "AsmUnparser.h"
8 
10 ROSE_DLL_API std::string unparseInstruction(SgAsmInstruction*, const Rose::BinaryAnalysis::AsmUnparser::LabelMap *labels=NULL,
11  const Rose::BinaryAnalysis::RegisterDictionary *registers=NULL);
12 
14 ROSE_DLL_API std::string unparseInstructionWithAddress(SgAsmInstruction*,
16  const Rose::BinaryAnalysis::RegisterDictionary *registers=NULL);
17 
19 ROSE_DLL_API std::string unparseMnemonic(SgAsmInstruction*);
20 
23 ROSE_DLL_API std::string unparseExpression(SgAsmExpression*, const Rose::BinaryAnalysis::AsmUnparser::LabelMap *labels,
25 
26 ROSE_DLL_API std::string unparseAsmStatement(SgAsmStatement*);
27 
28 ROSE_DLL_API void unparseAsmStatementToFile(const std::string& filename, SgAsmStatement*);
29 
30 ROSE_DLL_API std::string unparseAsmInterpretation(SgAsmInterpretation*);
31 
32 /*-------------------------------------------------------------------------------------------------------------------------------
33  * X86
34  *-------------------------------------------------------------------------------------------------------------------------------*/
35 
36 std::string unparseX86Mnemonic(SgAsmX86Instruction*);
37 std::string unparseX86Expression(SgAsmExpression*, const Rose::BinaryAnalysis::AsmUnparser::LabelMap*,
39 std::string unparseX86Expression(SgAsmExpression*, const Rose::BinaryAnalysis::AsmUnparser::LabelMap*,
40  const Rose::BinaryAnalysis::RegisterDictionary*, bool leaMode);
42 std::string unparseX86Register(SgAsmInstruction*, Rose::BinaryAnalysis::RegisterDescriptor,
44 
45 /*-------------------------------------------------------------------------------------------------------------------------------
46  * PowerPC
47  *-------------------------------------------------------------------------------------------------------------------------------*/
48 
49 std::string unparsePowerpcMnemonic(SgAsmPowerpcInstruction*);
50 std::string unparsePowerpcExpression(SgAsmExpression*, const Rose::BinaryAnalysis::AsmUnparser::LabelMap*,
52 
53 /*-------------------------------------------------------------------------------------------------------------------------------
54  * MIPS
55  *-------------------------------------------------------------------------------------------------------------------------------*/
56 
57 std::string unparseMipsMnemonic(SgAsmMipsInstruction*);
58 std::string unparseMipsExpression(SgAsmExpression*, const Rose::BinaryAnalysis::AsmUnparser::LabelMap*,
60 
61 /*-------------------------------------------------------------------------------------------------------------------------------
62  * M68k
63  *-------------------------------------------------------------------------------------------------------------------------------*/
64 
65 std::string unparseM68kMnemonic(SgAsmM68kInstruction*);
66 std::string unparseM68kExpression(SgAsmExpression*, const Rose::BinaryAnalysis::AsmUnparser::LabelMap*,
68 
69 /*-------------------------------------------------------------------------------------------------------------------------------
70  * ARM AArch64
71  *-------------------------------------------------------------------------------------------------------------------------------*/
72 #ifdef ROSE_ENABLE_ASM_AARCH64
73 std::string unparseAarch64Mnemonic(SgAsmAarch64Instruction*);
74 std::string unparseAarch64Expression(SgAsmExpression*, const Rose::BinaryAnalysis::AsmUnparser::LabelMap*,
76 #endif
77 
78 /*-------------------------------------------------------------------------------------------------------------------------------
79  * ARM AArch32
80  *-------------------------------------------------------------------------------------------------------------------------------*/
81 #ifdef ROSE_ENABLE_ASM_AARCH32
82 std::string unparseAarch32Mnemonic(SgAsmAarch32Instruction*);
83 std::string unparseAarch32Expression(SgAsmExpression*, const Rose::BinaryAnalysis::AsmUnparser::LabelMap*,
85 #endif
86 
87 #endif
88 #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.
std::map< uint64_t, std::string > LabelMap
Maps integers to labels.
Definition: AsmUnparser.h:900
Defines registers available for a particular architecture.
Definition: Registers.h:38
Represents an interpretation of a binary container.