2 * Dump disassembly as text, for processing by scripts/disas-objdump.pl.
3 * SPDX-License-Identifier: GPL-2.0-or-later
6 #include "qemu/osdep.h"
7 #include "disas-internal.h"
10 static int print_insn_objdump(bfd_vma pc
, disassemble_info
*info
,
13 int i
, n
= info
->buffer_length
;
14 g_autofree
uint8_t *buf
= g_malloc(n
);
16 if (info
->read_memory_func(pc
, buf
, n
, info
) == 0) {
17 for (i
= 0; i
< n
; ++i
) {
19 info
->fprintf_func(info
->stream
, "\n%s: ", prefix
);
21 info
->fprintf_func(info
->stream
, "%02x", buf
[i
]);
24 info
->fprintf_func(info
->stream
, "unable to read memory");
29 int print_insn_od_host(bfd_vma pc
, disassemble_info
*info
)
31 return print_insn_objdump(pc
, info
, "OBJD-H");
34 int print_insn_od_target(bfd_vma pc
, disassemble_info
*info
)
36 return print_insn_objdump(pc
, info
, "OBJD-T");