/src/capstonenext/Mapping.h
Line | Count | Source (jump to first uncovered line) |
1 | | /* Capstone Disassembly Engine */ |
2 | | /* By Nguyen Anh Quynh <aquynh@gmail.com>, 2013-2019 */ |
3 | | /* Rot127 <unisono@quyllur.org>, 2022-2023 */ |
4 | | |
5 | | #ifndef CS_MAPPING_H |
6 | | #define CS_MAPPING_H |
7 | | |
8 | | #if defined(CAPSTONE_HAS_OSXKERNEL) |
9 | | #include <libkern/libkern.h> |
10 | | #else |
11 | | #include "include/capstone/capstone.h" |
12 | | #include <stddef.h> |
13 | | #endif |
14 | | #include "cs_priv.h" |
15 | | #include <assert.h> |
16 | | #include <string.h> |
17 | | |
18 | | // map instruction to its characteristics |
19 | | typedef struct insn_map { |
20 | | unsigned short id; // The LLVM instruction id |
21 | | unsigned short mapid; // The Capstone instruction id |
22 | | #ifndef CAPSTONE_DIET |
23 | | uint16_t regs_use[MAX_IMPL_R_REGS]; ///< list of implicit registers used by |
24 | | ///< this instruction |
25 | | uint16_t regs_mod[MAX_IMPL_W_REGS]; ///< list of implicit registers modified |
26 | | ///< by this instruction |
27 | | unsigned char groups |
28 | | [MAX_NUM_GROUPS]; ///< list of group this instruction belong to |
29 | | bool branch; // branch instruction? |
30 | | bool indirect_branch; // indirect branch instruction? |
31 | | union { |
32 | | ppc_suppl_info ppc; |
33 | | } suppl_info; // Supplementary information for each instruction. |
34 | | #endif |
35 | | } insn_map; |
36 | | |
37 | | // look for @id in @m, given its size in @max. first time call will update |
38 | | // @cache. return 0 if not found |
39 | | unsigned short insn_find(const insn_map *m, unsigned int max, unsigned int id, |
40 | | unsigned short **cache); |
41 | | |
42 | | unsigned int find_cs_id(unsigned MC_Opcode, const insn_map *imap, |
43 | | unsigned imap_size); |
44 | | |
45 | | #define MAX_NO_DATA_TYPES 10 |
46 | | |
47 | | ///< A LLVM<->CS Mapping entry of an MCOperand. |
48 | | typedef struct { |
49 | | uint8_t /* cs_op_type */ type; ///< Operand type (e.g.: reg, imm, mem) |
50 | | uint8_t /* cs_ac_type */ access; ///< The access type (read, write) |
51 | | uint8_t /* cs_data_type */ |
52 | | dtypes[MAX_NO_DATA_TYPES]; ///< List of op types. Terminated by |
53 | | ///< CS_DATA_TYPE_LAST |
54 | | } mapping_op; |
55 | | |
56 | | #define MAX_NO_INSN_MAP_OPS 16 |
57 | | |
58 | | ///< MCOperands of an instruction. |
59 | | typedef struct { |
60 | | mapping_op |
61 | | ops[MAX_NO_INSN_MAP_OPS]; ///< NULL terminated array of insn_op. |
62 | | } map_insn_ops; |
63 | | |
64 | | /// Only usable by `auto-sync` archs! |
65 | | const cs_op_type mapping_get_op_type(MCInst *MI, unsigned OpNum, |
66 | | const map_insn_ops *insn_ops_map, |
67 | | size_t map_size); |
68 | | |
69 | | /// Only usable by `auto-sync` archs! |
70 | | const cs_ac_type mapping_get_op_access(MCInst *MI, unsigned OpNum, |
71 | | const map_insn_ops *insn_ops_map, |
72 | | size_t map_size); |
73 | | |
74 | | /// Macro for easier access of operand types from the map. |
75 | | /// Assumes the istruction operands map is called "insn_operands" |
76 | | /// Only usable by `auto-sync` archs! |
77 | | #define map_get_op_type(MI, OpNum) \ |
78 | 5.23M | mapping_get_op_type(MI, OpNum, (const map_insn_ops *)insn_operands, \ |
79 | 5.23M | sizeof(insn_operands) / sizeof(insn_operands[0])) |
80 | | |
81 | | /// Macro for easier access of operand access flags from the map. |
82 | | /// Assumes the istruction operands map is called "insn_operands" |
83 | | /// Only usable by `auto-sync` archs! |
84 | | #define map_get_op_access(MI, OpNum) \ |
85 | 3.77M | mapping_get_op_access(MI, OpNum, (const map_insn_ops *)insn_operands, \ |
86 | 3.77M | sizeof(insn_operands) / \ |
87 | 3.77M | sizeof(insn_operands[0])) |
88 | | |
89 | | ///< Map for ids to their string |
90 | | typedef struct name_map { |
91 | | unsigned int id; |
92 | | const char *name; |
93 | | } name_map; |
94 | | |
95 | | // map a name to its ID |
96 | | // return 0 if not found |
97 | | int name2id(const name_map *map, int max, const char *name); |
98 | | |
99 | | // map ID to a name |
100 | | // return NULL if not found |
101 | | const char *id2name(const name_map *map, int max, const unsigned int id); |
102 | | |
103 | | void map_add_implicit_write(MCInst *MI, uint32_t Reg); |
104 | | void map_add_implicit_read(MCInst *MI, uint32_t Reg); |
105 | | void map_remove_implicit_write(MCInst *MI, uint32_t Reg); |
106 | | |
107 | | void map_implicit_reads(MCInst *MI, const insn_map *imap); |
108 | | |
109 | | void map_implicit_writes(MCInst *MI, const insn_map *imap); |
110 | | |
111 | | void add_group(MCInst *MI, unsigned /* arch_group */ group); |
112 | | |
113 | | void map_groups(MCInst *MI, const insn_map *imap); |
114 | | |
115 | | void map_cs_id(MCInst *MI, const insn_map *imap, unsigned int imap_size); |
116 | | |
117 | | #define DECL_get_detail_op(arch, ARCH) \ |
118 | | cs_##arch##_op *ARCH##_get_detail_op(MCInst *MI, int offset); |
119 | | |
120 | | DECL_get_detail_op(arm, ARM); |
121 | | DECL_get_detail_op(ppc, PPC); |
122 | | DECL_get_detail_op(tricore, TriCore); |
123 | | |
124 | | /// Increments the detail->arch.op_count by one. |
125 | | #define DEFINE_inc_detail_op_count(arch, ARCH) \ |
126 | | static inline void ARCH##_inc_op_count(MCInst *MI) \ |
127 | 3.41M | { \ |
128 | 3.41M | MI->flat_insn->detail->arch.op_count++; \ |
129 | 3.41M | } ARMMapping.c:ARM_inc_op_count Line | Count | Source | 127 | 3.25M | { \ | 128 | 3.25M | MI->flat_insn->detail->arch.op_count++; \ | 129 | 3.25M | } |
Unexecuted instantiation: ARMMapping.c:PPC_inc_op_count Unexecuted instantiation: ARMMapping.c:TriCore_inc_op_count Unexecuted instantiation: AArch64Mapping.c:ARM_inc_op_count Unexecuted instantiation: AArch64Mapping.c:PPC_inc_op_count Unexecuted instantiation: AArch64Mapping.c:TriCore_inc_op_count Unexecuted instantiation: MipsMapping.c:ARM_inc_op_count Unexecuted instantiation: MipsMapping.c:PPC_inc_op_count Unexecuted instantiation: MipsMapping.c:TriCore_inc_op_count PPCMapping.c:PPC_inc_op_count Line | Count | Source | 127 | 162k | { \ | 128 | 162k | MI->flat_insn->detail->arch.op_count++; \ | 129 | 162k | } |
Unexecuted instantiation: PPCMapping.c:ARM_inc_op_count Unexecuted instantiation: PPCMapping.c:TriCore_inc_op_count Unexecuted instantiation: X86Mapping.c:ARM_inc_op_count Unexecuted instantiation: X86Mapping.c:PPC_inc_op_count Unexecuted instantiation: X86Mapping.c:TriCore_inc_op_count Unexecuted instantiation: SparcMapping.c:ARM_inc_op_count Unexecuted instantiation: SparcMapping.c:PPC_inc_op_count Unexecuted instantiation: SparcMapping.c:TriCore_inc_op_count Unexecuted instantiation: SystemZMapping.c:ARM_inc_op_count Unexecuted instantiation: SystemZMapping.c:PPC_inc_op_count Unexecuted instantiation: SystemZMapping.c:TriCore_inc_op_count Unexecuted instantiation: XCoreMapping.c:ARM_inc_op_count Unexecuted instantiation: XCoreMapping.c:PPC_inc_op_count Unexecuted instantiation: XCoreMapping.c:TriCore_inc_op_count Unexecuted instantiation: M68KInstPrinter.c:ARM_inc_op_count Unexecuted instantiation: M68KInstPrinter.c:PPC_inc_op_count Unexecuted instantiation: M68KInstPrinter.c:TriCore_inc_op_count Unexecuted instantiation: TMS320C64xMapping.c:ARM_inc_op_count Unexecuted instantiation: TMS320C64xMapping.c:PPC_inc_op_count Unexecuted instantiation: TMS320C64xMapping.c:TriCore_inc_op_count Unexecuted instantiation: M680XInstPrinter.c:ARM_inc_op_count Unexecuted instantiation: M680XInstPrinter.c:PPC_inc_op_count Unexecuted instantiation: M680XInstPrinter.c:TriCore_inc_op_count Unexecuted instantiation: EVMMapping.c:ARM_inc_op_count Unexecuted instantiation: EVMMapping.c:PPC_inc_op_count Unexecuted instantiation: EVMMapping.c:TriCore_inc_op_count Unexecuted instantiation: WASMMapping.c:ARM_inc_op_count Unexecuted instantiation: WASMMapping.c:PPC_inc_op_count Unexecuted instantiation: WASMMapping.c:TriCore_inc_op_count Unexecuted instantiation: BPFMapping.c:ARM_inc_op_count Unexecuted instantiation: BPFMapping.c:PPC_inc_op_count Unexecuted instantiation: BPFMapping.c:TriCore_inc_op_count Unexecuted instantiation: RISCVMapping.c:ARM_inc_op_count Unexecuted instantiation: RISCVMapping.c:PPC_inc_op_count Unexecuted instantiation: RISCVMapping.c:TriCore_inc_op_count Unexecuted instantiation: SHInstPrinter.c:ARM_inc_op_count Unexecuted instantiation: SHInstPrinter.c:PPC_inc_op_count Unexecuted instantiation: SHInstPrinter.c:TriCore_inc_op_count Unexecuted instantiation: TriCoreMapping.c:ARM_inc_op_count Unexecuted instantiation: TriCoreMapping.c:PPC_inc_op_count Unexecuted instantiation: TriCoreMapping.c:TriCore_inc_op_count Unexecuted instantiation: Mapping.c:ARM_inc_op_count Unexecuted instantiation: Mapping.c:PPC_inc_op_count Unexecuted instantiation: Mapping.c:TriCore_inc_op_count Unexecuted instantiation: ARMInstPrinter.c:ARM_inc_op_count Unexecuted instantiation: ARMInstPrinter.c:PPC_inc_op_count Unexecuted instantiation: ARMInstPrinter.c:TriCore_inc_op_count Unexecuted instantiation: PPCInstPrinter.c:ARM_inc_op_count Unexecuted instantiation: PPCInstPrinter.c:PPC_inc_op_count Unexecuted instantiation: PPCInstPrinter.c:TriCore_inc_op_count Unexecuted instantiation: TriCoreInstPrinter.c:TriCore_inc_op_count Unexecuted instantiation: TriCoreInstPrinter.c:ARM_inc_op_count Unexecuted instantiation: TriCoreInstPrinter.c:PPC_inc_op_count |
130 | | |
131 | | /// Decrements the detail->arch.op_count by one. |
132 | | #define DEFINE_dec_detail_op_count(arch, ARCH) \ |
133 | | static inline void ARCH##_dec_op_count(MCInst *MI) \ |
134 | 69.7k | { \ |
135 | 69.7k | MI->flat_insn->detail->arch.op_count--; \ |
136 | 69.7k | } ARMMapping.c:ARM_dec_op_count Line | Count | Source | 134 | 69.7k | { \ | 135 | 69.7k | MI->flat_insn->detail->arch.op_count--; \ | 136 | 69.7k | } |
Unexecuted instantiation: ARMMapping.c:PPC_dec_op_count Unexecuted instantiation: ARMMapping.c:TriCore_dec_op_count Unexecuted instantiation: AArch64Mapping.c:ARM_dec_op_count Unexecuted instantiation: AArch64Mapping.c:PPC_dec_op_count Unexecuted instantiation: AArch64Mapping.c:TriCore_dec_op_count Unexecuted instantiation: MipsMapping.c:ARM_dec_op_count Unexecuted instantiation: MipsMapping.c:PPC_dec_op_count Unexecuted instantiation: MipsMapping.c:TriCore_dec_op_count Unexecuted instantiation: PPCMapping.c:ARM_dec_op_count Unexecuted instantiation: PPCMapping.c:PPC_dec_op_count Unexecuted instantiation: PPCMapping.c:TriCore_dec_op_count Unexecuted instantiation: X86Mapping.c:ARM_dec_op_count Unexecuted instantiation: X86Mapping.c:PPC_dec_op_count Unexecuted instantiation: X86Mapping.c:TriCore_dec_op_count Unexecuted instantiation: SparcMapping.c:ARM_dec_op_count Unexecuted instantiation: SparcMapping.c:PPC_dec_op_count Unexecuted instantiation: SparcMapping.c:TriCore_dec_op_count Unexecuted instantiation: SystemZMapping.c:ARM_dec_op_count Unexecuted instantiation: SystemZMapping.c:PPC_dec_op_count Unexecuted instantiation: SystemZMapping.c:TriCore_dec_op_count Unexecuted instantiation: XCoreMapping.c:ARM_dec_op_count Unexecuted instantiation: XCoreMapping.c:PPC_dec_op_count Unexecuted instantiation: XCoreMapping.c:TriCore_dec_op_count Unexecuted instantiation: M68KInstPrinter.c:ARM_dec_op_count Unexecuted instantiation: M68KInstPrinter.c:PPC_dec_op_count Unexecuted instantiation: M68KInstPrinter.c:TriCore_dec_op_count Unexecuted instantiation: TMS320C64xMapping.c:ARM_dec_op_count Unexecuted instantiation: TMS320C64xMapping.c:PPC_dec_op_count Unexecuted instantiation: TMS320C64xMapping.c:TriCore_dec_op_count Unexecuted instantiation: M680XInstPrinter.c:ARM_dec_op_count Unexecuted instantiation: M680XInstPrinter.c:PPC_dec_op_count Unexecuted instantiation: M680XInstPrinter.c:TriCore_dec_op_count Unexecuted instantiation: EVMMapping.c:ARM_dec_op_count Unexecuted instantiation: EVMMapping.c:PPC_dec_op_count Unexecuted instantiation: EVMMapping.c:TriCore_dec_op_count Unexecuted instantiation: WASMMapping.c:ARM_dec_op_count Unexecuted instantiation: WASMMapping.c:PPC_dec_op_count Unexecuted instantiation: WASMMapping.c:TriCore_dec_op_count Unexecuted instantiation: BPFMapping.c:ARM_dec_op_count Unexecuted instantiation: BPFMapping.c:PPC_dec_op_count Unexecuted instantiation: BPFMapping.c:TriCore_dec_op_count Unexecuted instantiation: RISCVMapping.c:ARM_dec_op_count Unexecuted instantiation: RISCVMapping.c:PPC_dec_op_count Unexecuted instantiation: RISCVMapping.c:TriCore_dec_op_count Unexecuted instantiation: SHInstPrinter.c:ARM_dec_op_count Unexecuted instantiation: SHInstPrinter.c:PPC_dec_op_count Unexecuted instantiation: SHInstPrinter.c:TriCore_dec_op_count Unexecuted instantiation: TriCoreMapping.c:ARM_dec_op_count Unexecuted instantiation: TriCoreMapping.c:PPC_dec_op_count Unexecuted instantiation: TriCoreMapping.c:TriCore_dec_op_count Unexecuted instantiation: Mapping.c:ARM_dec_op_count Unexecuted instantiation: Mapping.c:PPC_dec_op_count Unexecuted instantiation: Mapping.c:TriCore_dec_op_count Unexecuted instantiation: ARMInstPrinter.c:ARM_dec_op_count Unexecuted instantiation: ARMInstPrinter.c:PPC_dec_op_count Unexecuted instantiation: ARMInstPrinter.c:TriCore_dec_op_count Unexecuted instantiation: PPCInstPrinter.c:ARM_dec_op_count Unexecuted instantiation: PPCInstPrinter.c:PPC_dec_op_count Unexecuted instantiation: PPCInstPrinter.c:TriCore_dec_op_count Unexecuted instantiation: TriCoreInstPrinter.c:ARM_dec_op_count Unexecuted instantiation: TriCoreInstPrinter.c:PPC_dec_op_count Unexecuted instantiation: TriCoreInstPrinter.c:TriCore_dec_op_count |
137 | | |
138 | | DEFINE_inc_detail_op_count(arm, ARM); |
139 | | DEFINE_dec_detail_op_count(arm, ARM); |
140 | | DEFINE_inc_detail_op_count(ppc, PPC); |
141 | | DEFINE_dec_detail_op_count(ppc, PPC); |
142 | | DEFINE_inc_detail_op_count(tricore, TriCore); |
143 | | DEFINE_dec_detail_op_count(tricore, TriCore); |
144 | | |
145 | | /// Returns true if a memory operand is currently edited. |
146 | | static inline bool doing_mem(const MCInst *MI) |
147 | 2.63M | { |
148 | 2.63M | return MI->csh->doing_mem; |
149 | 2.63M | } Line | Count | Source | 147 | 2.29M | { | 148 | 2.29M | return MI->csh->doing_mem; | 149 | 2.29M | } |
Unexecuted instantiation: AArch64Mapping.c:doing_mem Unexecuted instantiation: MipsMapping.c:doing_mem Line | Count | Source | 147 | 335k | { | 148 | 335k | return MI->csh->doing_mem; | 149 | 335k | } |
Unexecuted instantiation: X86Mapping.c:doing_mem Unexecuted instantiation: SparcMapping.c:doing_mem Unexecuted instantiation: SystemZMapping.c:doing_mem Unexecuted instantiation: XCoreMapping.c:doing_mem Unexecuted instantiation: M68KInstPrinter.c:doing_mem Unexecuted instantiation: TMS320C64xMapping.c:doing_mem Unexecuted instantiation: M680XInstPrinter.c:doing_mem Unexecuted instantiation: EVMMapping.c:doing_mem Unexecuted instantiation: WASMMapping.c:doing_mem Unexecuted instantiation: BPFMapping.c:doing_mem Unexecuted instantiation: RISCVMapping.c:doing_mem Unexecuted instantiation: SHInstPrinter.c:doing_mem Unexecuted instantiation: TriCoreMapping.c:doing_mem Unexecuted instantiation: Mapping.c:doing_mem Unexecuted instantiation: ARMInstPrinter.c:doing_mem Unexecuted instantiation: PPCInstPrinter.c:doing_mem Unexecuted instantiation: TriCoreInstPrinter.c:doing_mem |
150 | | |
151 | | /// Sets the doing_mem flag to @status. |
152 | | static inline void set_doing_mem(const MCInst *MI, bool status) |
153 | 761k | { |
154 | 761k | MI->csh->doing_mem = status; |
155 | 761k | } ARMMapping.c:set_doing_mem Line | Count | Source | 153 | 727k | { | 154 | 727k | MI->csh->doing_mem = status; | 155 | 727k | } |
Unexecuted instantiation: AArch64Mapping.c:set_doing_mem Unexecuted instantiation: MipsMapping.c:set_doing_mem PPCMapping.c:set_doing_mem Line | Count | Source | 153 | 33.6k | { | 154 | 33.6k | MI->csh->doing_mem = status; | 155 | 33.6k | } |
Unexecuted instantiation: X86Mapping.c:set_doing_mem Unexecuted instantiation: SparcMapping.c:set_doing_mem Unexecuted instantiation: SystemZMapping.c:set_doing_mem Unexecuted instantiation: XCoreMapping.c:set_doing_mem Unexecuted instantiation: M68KInstPrinter.c:set_doing_mem Unexecuted instantiation: TMS320C64xMapping.c:set_doing_mem Unexecuted instantiation: M680XInstPrinter.c:set_doing_mem Unexecuted instantiation: EVMMapping.c:set_doing_mem Unexecuted instantiation: WASMMapping.c:set_doing_mem Unexecuted instantiation: BPFMapping.c:set_doing_mem Unexecuted instantiation: RISCVMapping.c:set_doing_mem Unexecuted instantiation: SHInstPrinter.c:set_doing_mem Unexecuted instantiation: TriCoreMapping.c:set_doing_mem Unexecuted instantiation: Mapping.c:set_doing_mem Unexecuted instantiation: ARMInstPrinter.c:set_doing_mem Unexecuted instantiation: PPCInstPrinter.c:set_doing_mem Unexecuted instantiation: TriCoreInstPrinter.c:set_doing_mem |
156 | | |
157 | | /// Returns detail->arch |
158 | | #define DEFINE_get_arch_detail(arch, ARCH) \ |
159 | | static inline cs_##arch *ARCH##_get_detail(const MCInst *MI) \ |
160 | 59.0M | { \ |
161 | 59.0M | assert(MI && MI->flat_insn && MI->flat_insn->detail); \ |
162 | 59.0M | return &MI->flat_insn->detail->arch; \ |
163 | 59.0M | } ARMMapping.c:ARM_get_detail Line | Count | Source | 160 | 58.5M | { \ | 161 | 58.5M | assert(MI && MI->flat_insn && MI->flat_insn->detail); \ | 162 | 58.5M | return &MI->flat_insn->detail->arch; \ | 163 | 58.5M | } |
Unexecuted instantiation: ARMMapping.c:PPC_get_detail Unexecuted instantiation: ARMMapping.c:TriCore_get_detail Unexecuted instantiation: AArch64Mapping.c:ARM_get_detail Unexecuted instantiation: AArch64Mapping.c:PPC_get_detail Unexecuted instantiation: AArch64Mapping.c:TriCore_get_detail Unexecuted instantiation: MipsMapping.c:ARM_get_detail Unexecuted instantiation: MipsMapping.c:PPC_get_detail Unexecuted instantiation: MipsMapping.c:TriCore_get_detail PPCMapping.c:PPC_get_detail Line | Count | Source | 160 | 570k | { \ | 161 | 570k | assert(MI && MI->flat_insn && MI->flat_insn->detail); \ | 162 | 570k | return &MI->flat_insn->detail->arch; \ | 163 | 570k | } |
Unexecuted instantiation: PPCMapping.c:ARM_get_detail Unexecuted instantiation: PPCMapping.c:TriCore_get_detail Unexecuted instantiation: X86Mapping.c:ARM_get_detail Unexecuted instantiation: X86Mapping.c:PPC_get_detail Unexecuted instantiation: X86Mapping.c:TriCore_get_detail Unexecuted instantiation: SparcMapping.c:ARM_get_detail Unexecuted instantiation: SparcMapping.c:PPC_get_detail Unexecuted instantiation: SparcMapping.c:TriCore_get_detail Unexecuted instantiation: SystemZMapping.c:ARM_get_detail Unexecuted instantiation: SystemZMapping.c:PPC_get_detail Unexecuted instantiation: SystemZMapping.c:TriCore_get_detail Unexecuted instantiation: XCoreMapping.c:ARM_get_detail Unexecuted instantiation: XCoreMapping.c:PPC_get_detail Unexecuted instantiation: XCoreMapping.c:TriCore_get_detail Unexecuted instantiation: M68KInstPrinter.c:ARM_get_detail Unexecuted instantiation: M68KInstPrinter.c:PPC_get_detail Unexecuted instantiation: M68KInstPrinter.c:TriCore_get_detail Unexecuted instantiation: TMS320C64xMapping.c:ARM_get_detail Unexecuted instantiation: TMS320C64xMapping.c:PPC_get_detail Unexecuted instantiation: TMS320C64xMapping.c:TriCore_get_detail Unexecuted instantiation: M680XInstPrinter.c:ARM_get_detail Unexecuted instantiation: M680XInstPrinter.c:PPC_get_detail Unexecuted instantiation: M680XInstPrinter.c:TriCore_get_detail Unexecuted instantiation: EVMMapping.c:ARM_get_detail Unexecuted instantiation: EVMMapping.c:PPC_get_detail Unexecuted instantiation: EVMMapping.c:TriCore_get_detail Unexecuted instantiation: WASMMapping.c:ARM_get_detail Unexecuted instantiation: WASMMapping.c:PPC_get_detail Unexecuted instantiation: WASMMapping.c:TriCore_get_detail Unexecuted instantiation: BPFMapping.c:ARM_get_detail Unexecuted instantiation: BPFMapping.c:PPC_get_detail Unexecuted instantiation: BPFMapping.c:TriCore_get_detail Unexecuted instantiation: RISCVMapping.c:ARM_get_detail Unexecuted instantiation: RISCVMapping.c:PPC_get_detail Unexecuted instantiation: RISCVMapping.c:TriCore_get_detail Unexecuted instantiation: SHInstPrinter.c:ARM_get_detail Unexecuted instantiation: SHInstPrinter.c:PPC_get_detail Unexecuted instantiation: SHInstPrinter.c:TriCore_get_detail Unexecuted instantiation: TriCoreMapping.c:ARM_get_detail Unexecuted instantiation: TriCoreMapping.c:PPC_get_detail Unexecuted instantiation: TriCoreMapping.c:TriCore_get_detail Unexecuted instantiation: Mapping.c:ARM_get_detail Unexecuted instantiation: Mapping.c:PPC_get_detail Unexecuted instantiation: Mapping.c:TriCore_get_detail Unexecuted instantiation: ARMInstPrinter.c:ARM_get_detail Unexecuted instantiation: ARMInstPrinter.c:PPC_get_detail Unexecuted instantiation: ARMInstPrinter.c:TriCore_get_detail Unexecuted instantiation: PPCInstPrinter.c:ARM_get_detail Unexecuted instantiation: PPCInstPrinter.c:PPC_get_detail Unexecuted instantiation: PPCInstPrinter.c:TriCore_get_detail Unexecuted instantiation: TriCoreInstPrinter.c:TriCore_get_detail Unexecuted instantiation: TriCoreInstPrinter.c:ARM_get_detail Unexecuted instantiation: TriCoreInstPrinter.c:PPC_get_detail |
164 | | |
165 | | DEFINE_get_arch_detail(arm, ARM); |
166 | | DEFINE_get_arch_detail(ppc, PPC); |
167 | | DEFINE_get_arch_detail(tricore, TriCore); |
168 | | |
169 | | static inline bool detail_is_set(const MCInst *MI) |
170 | 18.8M | { |
171 | 18.8M | assert(MI && MI->flat_insn); |
172 | 18.8M | return MI->flat_insn->detail != NULL && MI->csh->detail_opt & CS_OPT_ON; |
173 | 18.8M | } ARMMapping.c:detail_is_set Line | Count | Source | 170 | 17.8M | { | 171 | 17.8M | assert(MI && MI->flat_insn); | 172 | 17.8M | return MI->flat_insn->detail != NULL && MI->csh->detail_opt & CS_OPT_ON; | 173 | 17.8M | } |
Unexecuted instantiation: AArch64Mapping.c:detail_is_set Unexecuted instantiation: MipsMapping.c:detail_is_set PPCMapping.c:detail_is_set Line | Count | Source | 170 | 856k | { | 171 | 856k | assert(MI && MI->flat_insn); | 172 | 856k | return MI->flat_insn->detail != NULL && MI->csh->detail_opt & CS_OPT_ON; | 173 | 856k | } |
Unexecuted instantiation: X86Mapping.c:detail_is_set Unexecuted instantiation: SparcMapping.c:detail_is_set Unexecuted instantiation: SystemZMapping.c:detail_is_set Unexecuted instantiation: XCoreMapping.c:detail_is_set Unexecuted instantiation: M68KInstPrinter.c:detail_is_set Unexecuted instantiation: TMS320C64xMapping.c:detail_is_set Unexecuted instantiation: M680XInstPrinter.c:detail_is_set Unexecuted instantiation: EVMMapping.c:detail_is_set Unexecuted instantiation: WASMMapping.c:detail_is_set Unexecuted instantiation: BPFMapping.c:detail_is_set Unexecuted instantiation: RISCVMapping.c:detail_is_set Unexecuted instantiation: SHInstPrinter.c:detail_is_set Unexecuted instantiation: TriCoreMapping.c:detail_is_set Line | Count | Source | 170 | 114k | { | 171 | 114k | assert(MI && MI->flat_insn); | 172 | 114k | return MI->flat_insn->detail != NULL && MI->csh->detail_opt & CS_OPT_ON; | 173 | 114k | } |
Unexecuted instantiation: ARMInstPrinter.c:detail_is_set Unexecuted instantiation: PPCInstPrinter.c:detail_is_set Unexecuted instantiation: TriCoreInstPrinter.c:detail_is_set |
174 | | |
175 | | static inline cs_detail *get_detail(const MCInst *MI) |
176 | 2.57M | { |
177 | 2.57M | assert(MI && MI->flat_insn); |
178 | 2.57M | return MI->flat_insn->detail; |
179 | 2.57M | } Line | Count | Source | 176 | 2.44M | { | 177 | 2.44M | assert(MI && MI->flat_insn); | 178 | 2.44M | return MI->flat_insn->detail; | 179 | 2.44M | } |
Unexecuted instantiation: AArch64Mapping.c:get_detail Unexecuted instantiation: MipsMapping.c:get_detail Line | Count | Source | 176 | 129k | { | 177 | 129k | assert(MI && MI->flat_insn); | 178 | 129k | return MI->flat_insn->detail; | 179 | 129k | } |
Unexecuted instantiation: X86Mapping.c:get_detail Unexecuted instantiation: SparcMapping.c:get_detail Unexecuted instantiation: SystemZMapping.c:get_detail Unexecuted instantiation: XCoreMapping.c:get_detail Unexecuted instantiation: M68KInstPrinter.c:get_detail Unexecuted instantiation: TMS320C64xMapping.c:get_detail Unexecuted instantiation: M680XInstPrinter.c:get_detail Unexecuted instantiation: EVMMapping.c:get_detail Unexecuted instantiation: WASMMapping.c:get_detail Unexecuted instantiation: BPFMapping.c:get_detail Unexecuted instantiation: RISCVMapping.c:get_detail Unexecuted instantiation: SHInstPrinter.c:get_detail Unexecuted instantiation: TriCoreMapping.c:get_detail Unexecuted instantiation: Mapping.c:get_detail Unexecuted instantiation: ARMInstPrinter.c:get_detail Unexecuted instantiation: PPCInstPrinter.c:get_detail Unexecuted instantiation: TriCoreInstPrinter.c:get_detail |
180 | | |
181 | | static inline bool set_detail_ops(const MCInst *MI) |
182 | 0 | { |
183 | 0 | assert(MI && MI->flat_insn); |
184 | 0 | return MI->fillDetailOps; |
185 | 0 | } Unexecuted instantiation: ARMMapping.c:set_detail_ops Unexecuted instantiation: AArch64Mapping.c:set_detail_ops Unexecuted instantiation: MipsMapping.c:set_detail_ops Unexecuted instantiation: PPCMapping.c:set_detail_ops Unexecuted instantiation: X86Mapping.c:set_detail_ops Unexecuted instantiation: SparcMapping.c:set_detail_ops Unexecuted instantiation: SystemZMapping.c:set_detail_ops Unexecuted instantiation: XCoreMapping.c:set_detail_ops Unexecuted instantiation: M68KInstPrinter.c:set_detail_ops Unexecuted instantiation: TMS320C64xMapping.c:set_detail_ops Unexecuted instantiation: M680XInstPrinter.c:set_detail_ops Unexecuted instantiation: EVMMapping.c:set_detail_ops Unexecuted instantiation: WASMMapping.c:set_detail_ops Unexecuted instantiation: BPFMapping.c:set_detail_ops Unexecuted instantiation: RISCVMapping.c:set_detail_ops Unexecuted instantiation: SHInstPrinter.c:set_detail_ops Unexecuted instantiation: TriCoreMapping.c:set_detail_ops Unexecuted instantiation: Mapping.c:set_detail_ops Unexecuted instantiation: ARMInstPrinter.c:set_detail_ops Unexecuted instantiation: PPCInstPrinter.c:set_detail_ops Unexecuted instantiation: TriCoreInstPrinter.c:set_detail_ops |
186 | | |
187 | | /// Returns if the given instruction is an alias instruction. |
188 | | #define RETURN_IF_INSN_IS_ALIAS(MI) \ |
189 | | do { \ |
190 | | if (MI->isAliasInstr) \ |
191 | | return; \ |
192 | | } while(0) |
193 | | |
194 | | void map_set_fill_detail_ops(MCInst *MI, bool Val); |
195 | | |
196 | 193k | static inline bool map_fill_detail_ops(MCInst *MI) { |
197 | 193k | assert(MI); |
198 | 193k | return MI->fillDetailOps; |
199 | 193k | } Unexecuted instantiation: ARMMapping.c:map_fill_detail_ops Unexecuted instantiation: AArch64Mapping.c:map_fill_detail_ops Unexecuted instantiation: MipsMapping.c:map_fill_detail_ops PPCMapping.c:map_fill_detail_ops Line | Count | Source | 196 | 193k | static inline bool map_fill_detail_ops(MCInst *MI) { | 197 | 193k | assert(MI); | 198 | 193k | return MI->fillDetailOps; | 199 | 193k | } |
Unexecuted instantiation: X86Mapping.c:map_fill_detail_ops Unexecuted instantiation: SparcMapping.c:map_fill_detail_ops Unexecuted instantiation: SystemZMapping.c:map_fill_detail_ops Unexecuted instantiation: XCoreMapping.c:map_fill_detail_ops Unexecuted instantiation: M68KInstPrinter.c:map_fill_detail_ops Unexecuted instantiation: TMS320C64xMapping.c:map_fill_detail_ops Unexecuted instantiation: M680XInstPrinter.c:map_fill_detail_ops Unexecuted instantiation: EVMMapping.c:map_fill_detail_ops Unexecuted instantiation: WASMMapping.c:map_fill_detail_ops Unexecuted instantiation: BPFMapping.c:map_fill_detail_ops Unexecuted instantiation: RISCVMapping.c:map_fill_detail_ops Unexecuted instantiation: SHInstPrinter.c:map_fill_detail_ops Unexecuted instantiation: TriCoreMapping.c:map_fill_detail_ops Unexecuted instantiation: Mapping.c:map_fill_detail_ops Unexecuted instantiation: ARMInstPrinter.c:map_fill_detail_ops Unexecuted instantiation: PPCInstPrinter.c:map_fill_detail_ops Unexecuted instantiation: TriCoreInstPrinter.c:map_fill_detail_ops |
200 | | |
201 | | void map_set_is_alias_insn(MCInst *MI, bool Val, uint64_t Alias); |
202 | | |
203 | | bool map_use_alias_details(const MCInst *MI); |
204 | | |
205 | | void map_set_alias_id(MCInst *MI, const SStream *O, const name_map *alias_mnem_id_map, int map_size); |
206 | | |
207 | | #endif // CS_MAPPING_H |