diff options
author | Andrew Burgess <aburgess@redhat.com> | 2022-02-04 16:51:45 +0000 |
---|---|---|
committer | Andrew Burgess <aburgess@redhat.com> | 2022-02-07 09:59:16 +0000 |
commit | 59091b1280b4ba301a2f147fbe51ea4816246ba2 (patch) | |
tree | 81fedf649c177123e8efcd6d14b380765928845b /gdb/s12z-tdep.c | |
parent | 61fb73769a0168afa466bb2245a1a233942203bb (diff) | |
download | gdb-59091b1280b4ba301a2f147fbe51ea4816246ba2.zip gdb-59091b1280b4ba301a2f147fbe51ea4816246ba2.tar.gz gdb-59091b1280b4ba301a2f147fbe51ea4816246ba2.tar.bz2 |
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.
Diffstat (limited to 'gdb/s12z-tdep.c')
-rw-r--r-- | gdb/s12z-tdep.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/gdb/s12z-tdep.c b/gdb/s12z-tdep.c index 3f9740f..659adf4 100644 --- a/gdb/s12z-tdep.c +++ b/gdb/s12z-tdep.c @@ -140,19 +140,15 @@ s12z_dwarf_reg_to_regnum (struct gdbarch *gdbarch, int num) /* Support functions for frame handling. */ -/* Copy of gdb_buffered_insn_length_fprintf from disasm.c. */ -static int ATTRIBUTE_PRINTF (2, 3) -s12z_fprintf_disasm (void *stream, const char *format, ...) -{ - return 0; -} +/* Return a disassemble_info initialized for s12z disassembly, however, + the disassembler will not actually print anything. */ static struct disassemble_info s12z_disassemble_info (struct gdbarch *gdbarch) { struct disassemble_info di; - init_disassemble_info (&di, &null_stream, s12z_fprintf_disasm); + init_disassemble_info_for_no_printing (&di); di.arch = gdbarch_bfd_arch_info (gdbarch)->arch; di.mach = gdbarch_bfd_arch_info (gdbarch)->mach; di.endian = gdbarch_byte_order (gdbarch); |