This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH 0/6] Unify the disassembler selection in gdb and objdump


Nowadays, we have opcodes library which provides disassembler for each
architecture (print_insn_XX functions), and gdb, objdump and sim use
them.  However, they (at least gdb and objdump) select disassembler
in different places, so this causes some duplicated code and
inconsistencies.

This patch series change gdb selecting disassembler through
opcodes/disassemble.c:disassembler in default, but there are still
some targets select their disassemblers in their own way (AFAICS,
they can be changed to disassemble.c:disassembler too in the
follow up patches).

Patch #1 refactor the code.  Patch #2 does the major change in this
series, but only apply to the obvious places.  Patch #3-4 do the
similar changes too, but not as obvious as patch #2.  Patch #5
fixes the inconsistency of rs6000 disassembler selection.  As a
result of these changes, a lot of print_insn_XXX functions are no
longer needed out side of opcodes library, so patch #6, as an RFC,
moves these function declarations from include/dis-asm.h to an
internal header in opcodes/.

If this series is on the right track, I'll change the rest of gdb
ports (like arm, mips, aarch64, etc) to default disassembler
selection.

The series is tested for gdb on x86_64-linux and ppc64-linux (gcc110).
It is also tested for binutils/ld/gas on x86_64-linux with all targets
enabled.

*** BLURB HERE ***

Yao Qi (6):
  Refactor disassembler selection
  Delegate opcodes to select disassembler in GDB
  Use disassble.c:disassembler select h8300 disassembler
  Use disassble.c:disassembler select rl78 disassembler
  Use disassble.c:disassembler select rs6000 disassembler
  Move print_insn_XXX to an opcodes internal header

 binutils/objdump.c       |   4 +-
 gdb/alpha-tdep.c         |   3 --
 gdb/arc-tdep.c           |   2 -
 gdb/arch-utils.c         |  20 ++++++++++
 gdb/arch-utils.h         |   2 +
 gdb/avr-tdep.c           |   1 -
 gdb/bfin-tdep.c          |   1 -
 gdb/cris-tdep.c          |  18 ---------
 gdb/frv-tdep.c           |   1 -
 gdb/ft32-tdep.c          |   2 -
 gdb/gdbarch.c            |   4 +-
 gdb/gdbarch.sh           |   2 +-
 gdb/h8300-tdep.c         |   4 --
 gdb/hppa-tdep.c          |   2 -
 gdb/iq2000-tdep.c        |   1 -
 gdb/lm32-tdep.c          |   3 --
 gdb/m32c-tdep.c          |   3 --
 gdb/m32r-tdep.c          |   2 -
 gdb/m68hc11-tdep.c       |  11 -----
 gdb/m68k-tdep.c          |   4 --
 gdb/m88k-tdep.c          |   2 -
 gdb/microblaze-tdep.c    |   2 -
 gdb/mn10300-tdep.c       |   2 -
 gdb/moxie-tdep.c         |   2 -
 gdb/msp430-tdep.c        |   3 --
 gdb/mt-tdep.c            |   1 -
 gdb/nds32-tdep.c         |   2 -
 gdb/nios2-tdep.c         |  14 -------
 gdb/rl78-tdep.c          |   3 --
 gdb/rs6000-tdep.c        |  14 -------
 gdb/rx-tdep.c            |   2 -
 gdb/s390-linux-tdep.c    |   2 -
 gdb/score-tdep.c         |  10 -----
 gdb/sh-tdep.c            |   1 -
 gdb/sh64-tdep.c          |   2 -
 gdb/sparc-tdep.c         |   2 -
 gdb/tic6x-tdep.c         |  10 -----
 gdb/tilegx-tdep.c        |   2 -
 gdb/v850-tdep.c          |   2 -
 gdb/vax-tdep.c           |   2 -
 gdb/xstormy16-tdep.c     |   2 -
 gdb/xtensa-tdep.c        |   2 -
 include/dis-asm.h        |  88 ++++------------------------------------
 opcodes/alpha-dis.c      |   2 +-
 opcodes/avr-dis.c        |   2 +-
 opcodes/bfin-dis.c       |   2 +-
 opcodes/cr16-dis.c       |   2 +-
 opcodes/crx-dis.c        |   2 +-
 opcodes/d10v-dis.c       |   2 +-
 opcodes/d30v-dis.c       |   2 +-
 opcodes/disassemble.c    |  43 ++++++++++++--------
 opcodes/disassemble.h    | 102 +++++++++++++++++++++++++++++++++++++++++++++++
 opcodes/dlx-dis.c        |   2 +-
 opcodes/epiphany-dis.c   |   2 +-
 opcodes/fr30-dis.c       |   2 +-
 opcodes/frv-dis.c        |   2 +-
 opcodes/ft32-dis.c       |   2 +-
 opcodes/h8300-dis.c      |   2 +-
 opcodes/h8500-dis.c      |   2 +-
 opcodes/hppa-dis.c       |   2 +-
 opcodes/i370-dis.c       |   2 +-
 opcodes/i386-dis.c       |   2 +-
 opcodes/i860-dis.c       |   2 +-
 opcodes/i960-dis.c       |   2 +-
 opcodes/ip2k-dis.c       |   2 +-
 opcodes/iq2000-dis.c     |   2 +-
 opcodes/lm32-dis.c       |   2 +-
 opcodes/m10200-dis.c     |   2 +-
 opcodes/m10300-dis.c     |   2 +-
 opcodes/m32r-dis.c       |   2 +-
 opcodes/m68hc11-dis.c    |   2 +-
 opcodes/m68k-dis.c       |   2 +-
 opcodes/m88k-dis.c       |   2 +-
 opcodes/mcore-dis.c      |   2 +-
 opcodes/metag-dis.c      |   2 +-
 opcodes/microblaze-dis.c |   2 +-
 opcodes/mmix-dis.c       |   2 +-
 opcodes/moxie-dis.c      |   2 +-
 opcodes/msp430-dis.c     |   2 +-
 opcodes/mt-dis.c         |   2 +-
 opcodes/nds32-dis.c      |   2 +-
 opcodes/nios2-dis.c      |   2 +-
 opcodes/ns32k-dis.c      |   2 +-
 opcodes/or1k-dis.c       |   2 +-
 opcodes/pdp11-dis.c      |   2 +-
 opcodes/pj-dis.c         |   2 +-
 opcodes/ppc-dis.c        |   2 +-
 opcodes/pru-dis.c        |   2 +-
 opcodes/riscv-dis.c      |   2 +-
 opcodes/rl78-dis.c       |   8 +++-
 opcodes/s390-dis.c       |   2 +-
 opcodes/score-dis.c      |   2 +-
 opcodes/sh-dis.c         |   2 +-
 opcodes/sh64-dis.c       |   2 +-
 opcodes/tic30-dis.c      |   2 +-
 opcodes/tic4x-dis.c      |   2 +-
 opcodes/tic54x-dis.c     |   2 +-
 opcodes/tic6x-dis.c      |   2 +-
 opcodes/tic80-dis.c      |   2 +-
 opcodes/tilegx-dis.c     |   2 +-
 opcodes/tilepro-dis.c    |   2 +-
 opcodes/v850-dis.c       |   2 +-
 opcodes/vax-dis.c        |   2 +-
 opcodes/visium-dis.c     |   2 +-
 opcodes/w65-dis.c        |   2 +-
 opcodes/wasm32-dis.c     |   2 +-
 opcodes/xc16x-dis.c      |   2 +-
 opcodes/xgate-dis.c      |   2 +-
 opcodes/xstormy16-dis.c  |   2 +-
 opcodes/xtensa-dis.c     |   2 +-
 opcodes/z80-dis.c        |   2 +-
 opcodes/z8k-dis.c        |   2 +-
 sim/common/sim-trace.c   |   6 ++-
 113 files changed, 242 insertions(+), 311 deletions(-)
 create mode 100644 opcodes/disassemble.h

-- 
1.9.1


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]