On 02/01/2017 08:31 PM, Pedro Alves wrote:
reuse both. Which suggests creating a new struct to hold
whatever should survive across calls. And then we can
go the step further, and make that a class, with
pretty_print_insn a method of _that_ class instead of
of gdb_disassembler. Like:
I can try that, but I think I'd rather do it after
string_file is in already.
Here's what it looks like, on top of the v4 series.
diff --git a/gdb/disasm.h b/gdb/disasm.h
index dffe9cd..a03eba6 100644
--- a/gdb/disasm.h
+++ b/gdb/disasm.h
@@ -97,11 +97,34 @@ extern void gdb_disassembly (struct gdbarch
*gdbarch, struct ui_out *uiout,
extern int gdb_print_insn (struct gdbarch *gdbarch, CORE_ADDR memaddr,
struct ui_file *stream, int *branch_delay_insns);
-/* Prints the instruction INSN into UIOUT and returns the length of
- the printed instruction in bytes. */
+/* Class used to pretty-print an instruction. */