Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Yao Qi <qiyaoltc@gmail.com>
To: binutils@sourceware.org,	gdb-patches@sourceware.org
Subject: [PATCH 0/6] Unify the disassembler selection in gdb and objdump
Date: Tue, 16 May 2017 10:49:00 -0000	[thread overview]
Message-ID: <1494931698-15309-1-git-send-email-yao.qi@linaro.org> (raw)

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


             reply	other threads:[~2017-05-16 10:49 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-16 10:49 Yao Qi [this message]
2017-05-16 10:48 ` [PATCH 2/6] Delegate opcodes to select disassembler in GDB Yao Qi
2017-06-30  0:19   ` Maciej W. Rozycki
2017-06-30  7:38     ` Yao Qi
2017-07-05 23:53       ` Maciej W. Rozycki
2017-07-07 16:41         ` Yao Qi
2017-08-01 16:31           ` Maciej W. Rozycki
2017-05-16 10:48 ` [PATCH 5/6] Use disassble.c:disassembler select rs6000 disassembler Yao Qi
2017-05-16 10:48 ` [PATCH 4/6] Use disassble.c:disassembler select rl78 disassembler Yao Qi
2017-05-16 10:49 ` [PATCH 3/6] Use disassble.c:disassembler select h8300 disassembler Yao Qi
2017-05-16 10:49 ` [PATCH 1/6] Refactor disassembler selection Yao Qi
2017-05-16 10:49 ` [RFC 6/6] Move print_insn_XXX to an opcodes internal header Yao Qi
2017-05-17  3:00 ` [PATCH 0/6] Unify the disassembler selection in gdb and objdump Alan Modra
2017-05-24 16:26   ` Yao Qi
2017-05-23  9:19 ` Pedro Alves

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1494931698-15309-1-git-send-email-yao.qi@linaro.org \
    --to=qiyaoltc@gmail.com \
    --cc=binutils@sourceware.org \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox