ROSE  0.11.2.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 "AsmUnparser.h"
6 #ifdef ROSE_BUILD_BINARY_ANALYSIS_SUPPORT
7 
9 ROSE_DLL_API std::string unparseInstruction(SgAsmInstruction*, const Rose::BinaryAnalysis::AsmUnparser::LabelMap *labels=NULL,
10  const Rose::BinaryAnalysis::RegisterDictionary *registers=NULL);
11 
13 ROSE_DLL_API std::string unparseInstructionWithAddress(SgAsmInstruction*,
15  const Rose::BinaryAnalysis::RegisterDictionary *registers=NULL);
16 
18 ROSE_DLL_API std::string unparseMnemonic(SgAsmInstruction*);
19 
22 ROSE_DLL_API std::string unparseExpression(SgAsmExpression*, const Rose::BinaryAnalysis::AsmUnparser::LabelMap *labels,
24 
25 ROSE_DLL_API std::string unparseAsmStatement(SgAsmStatement*);
26 
27 ROSE_DLL_API void unparseAsmStatementToFile(const std::string& filename, SgAsmStatement*);
28 
29 ROSE_DLL_API std::string unparseAsmInterpretation(SgAsmInterpretation*);
30 
31 /*-------------------------------------------------------------------------------------------------------------------------------
32  * X86
33  *-------------------------------------------------------------------------------------------------------------------------------*/
34 
35 std::string unparseX86Mnemonic(SgAsmX86Instruction*);
36 std::string unparseX86Expression(SgAsmExpression*, const Rose::BinaryAnalysis::AsmUnparser::LabelMap*,
38 std::string unparseX86Expression(SgAsmExpression*, const Rose::BinaryAnalysis::AsmUnparser::LabelMap*,
39  const Rose::BinaryAnalysis::RegisterDictionary*, bool leaMode);
41 std::string unparseX86Register(SgAsmInstruction*, Rose::BinaryAnalysis::RegisterDescriptor,
43 
44 /*-------------------------------------------------------------------------------------------------------------------------------
45  * PowerPC
46  *-------------------------------------------------------------------------------------------------------------------------------*/
47 
48 std::string unparsePowerpcMnemonic(SgAsmPowerpcInstruction*);
49 std::string unparsePowerpcExpression(SgAsmExpression*, const Rose::BinaryAnalysis::AsmUnparser::LabelMap*,
51 
52 /*-------------------------------------------------------------------------------------------------------------------------------
53  * MIPS
54  *-------------------------------------------------------------------------------------------------------------------------------*/
55 
56 std::string unparseMipsMnemonic(SgAsmMipsInstruction*);
57 std::string unparseMipsExpression(SgAsmExpression*, const Rose::BinaryAnalysis::AsmUnparser::LabelMap*,
59 
60 /*-------------------------------------------------------------------------------------------------------------------------------
61  * M68k
62  *-------------------------------------------------------------------------------------------------------------------------------*/
63 
64 std::string unparseM68kMnemonic(SgAsmM68kInstruction*);
65 std::string unparseM68kExpression(SgAsmExpression*, const Rose::BinaryAnalysis::AsmUnparser::LabelMap*,
67 
68 /*-------------------------------------------------------------------------------------------------------------------------------
69  * A64
70  *-------------------------------------------------------------------------------------------------------------------------------*/
71 #ifdef ROSE_ENABLE_ASM_A64
72 std::string unparseA64Mnemonic(SgAsmA64Instruction*);
73 std::string unparseA64Expression(SgAsmExpression*, const Rose::BinaryAnalysis::AsmUnparser::LabelMap*,
75 #endif
76 
77 #endif
78 #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.