1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20#include "qemu/osdep.h"
21#include "qemu-common.h"
22#include "disas/bfd.h"
23#include "tcg/tcg.h"
24
25
26int print_insn_tci(bfd_vma addr, disassemble_info *info)
27{
28 int length;
29 uint8_t byte;
30 int status;
31 TCGOpcode op;
32
33 status = info->read_memory_func(addr, &byte, 1, info);
34 if (status != 0) {
35 info->memory_error_func(status, addr, info);
36 return -1;
37 }
38 op = byte;
39
40 addr++;
41 status = info->read_memory_func(addr, &byte, 1, info);
42 if (status != 0) {
43 info->memory_error_func(status, addr, info);
44 return -1;
45 }
46 length = byte;
47
48 if (op >= tcg_op_defs_max) {
49 info->fprintf_func(info->stream, "illegal opcode %d", op);
50 } else {
51 const TCGOpDef *def = &tcg_op_defs[op];
52 int nb_oargs = def->nb_oargs;
53 int nb_iargs = def->nb_iargs;
54 int nb_cargs = def->nb_cargs;
55
56 info->fprintf_func(info->stream, "%s\to=%d i=%d c=%d",
57 def->name, nb_oargs, nb_iargs, nb_cargs);
58 }
59
60 return length;
61}
62