MCPcopy Create free account
hub / github.com/capstone-engine/capstone / map_groups

Function map_groups

Mapping.c:140–159  ·  view source on GitHub ↗

Copies the groups from @imap to @MI->flat_insn. Already present groups will be preserved.

Source from the content-addressed store, hash-verified

138/// Copies the groups from @imap to @MI->flat_insn.
139/// Already present groups will be preserved.
140void map_groups(MCInst *MI, const insn_map *imap)
141{
142#ifndef CAPSTONE_DIET
143 if (!MI->flat_insn->detail)
144 return;
145
146 cs_detail *detail = MI->flat_insn->detail;
147 unsigned Opcode = MCInst_getOpcode(MI);
148 unsigned i = 0;
149 uint16_t group = imap[Opcode].groups[i];
150 while (group != 0) {
151 if (detail->groups_count >= MAX_NUM_GROUPS) {
152 printf("ERROR: Too many groups defined in instruction mapping.\n");
153 return;
154 }
155 detail->groups[detail->groups_count++] = group;
156 group = imap[Opcode].groups[++i];
157 }
158#endif // CAPSTONE_DIET
159}
160
161// Search for the CS instruction id for the given @MC_Opcode in @imap.
162// return -1 if none is found.

Callers 1

Calls 2

MCInst_getOpcodeFunction · 0.85
printfFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…