gdb/disasm: combine the no printing disassembler setup code

We have three places in gdb where we initialise a disassembler that
will not print anything (used for figuring out the length of
instructions, or collecting other information from the disassembler).

Each of these places has its own stub function to act as a print like
callback, the stub function is identical in each case, and just does
nothing.

In this commit I create a new function to initialise a disassembler
that doesn't print anything, and have all three locations use this new
function.  There's now only one non-printing stub function.

There should be no user visible changes after this commit.
This commit is contained in:
Andrew Burgess
2022-02-04 16:51:45 +00:00
parent 61fb73769a
commit 59091b1280
4 changed files with 23 additions and 20 deletions

View File

@@ -174,4 +174,10 @@ extern char *get_disassembler_options (struct gdbarch *gdbarch);
extern void set_disassembler_options (const char *options);
/* Setup DINFO with its output function and output stream setup so that
nothing is printed while disassembling. */
extern void init_disassemble_info_for_no_printing
(struct disassemble_info *dinfo);
#endif