From patchwork Tue May 16 10:48:15 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yao Qi X-Patchwork-Id: 20462 Received: (qmail 75949 invoked by alias); 16 May 2017 10:49:00 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 75358 invoked by uid 89); 16 May 2017 10:48:36 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.7 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, RCVD_IN_SORBS_SPAM, SPF_PASS autolearn=ham version=3.3.2 spammy= X-Spam-User: qpsmtpd, 2 recipients X-HELO: mail-pf0-f174.google.com Received: from mail-pf0-f174.google.com (HELO mail-pf0-f174.google.com) (209.85.192.174) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 16 May 2017 10:48:34 +0000 Received: by mail-pf0-f174.google.com with SMTP id n23so73506761pfb.2; Tue, 16 May 2017 03:48:29 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=hr0IPolvQw7Yx3iKVco+ldBh3ddy+D9LywS42nZOQYg=; b=TQn9mZUpQD4rf4/0S861GyfpgAeZ03FMtmhHrO5lntfGXPGsb7IFH/+kIg21kh/diW ThlhVM9jG2l2eP5ycudJRTOOJeRbllOZOmdTDfqcP7gBXjjw1Uya3maPTBR9O/r8C5Ma pJW1kK7Poaw2wukQZ2wyB63/oBa1Zz7ioU3NAu4/9AxERKASLZJPLOy/1NBGoNGCPkbN Ox7xw4YWyb79zIRsrawgCnejA5L8a4iO8bRJ5TUfN+fBNOmgOzo6wwOCa+sQf2jA2cSP pZ9cynswK95yHtNdzKGBaPISmkhWdQQe7/no1izOvuKdWm/vLSdqFy5efdOCtPVfabkf paHQ== X-Gm-Message-State: AODbwcDIqE2OoVk8pto16LnjMDLPcLzj4F9rWZ7Axj5/vcjO2OISbpsf 65j+0OkiRjnLrDs8 X-Received: by 10.98.202.68 with SMTP id n65mr11496096pfg.158.1494931707984; Tue, 16 May 2017 03:48:27 -0700 (PDT) Received: from E107787-LIN.cambridge.arm.com (gcc114.osuosl.org. [140.211.9.72]) by smtp.gmail.com with ESMTPSA id e64sm26559372pfl.49.2017.05.16.03.48.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 16 May 2017 03:48:27 -0700 (PDT) From: Yao Qi X-Google-Original-From: Yao Qi To: binutils@sourceware.org, gdb-patches@sourceware.org Subject: [PATCH 3/6] Use disassble.c:disassembler select h8300 disassembler Date: Tue, 16 May 2017 11:48:15 +0100 Message-Id: <1494931698-15309-4-git-send-email-yao.qi@linaro.org> In-Reply-To: <1494931698-15309-1-git-send-email-yao.qi@linaro.org> References: <1494931698-15309-1-git-send-email-yao.qi@linaro.org> X-IsSubscribed: yes opcodes/disassble.c:disassembler select h8300 disassembler like this, if (mach == bfd_mach_h8300h || mach == bfd_mach_h8300hn) disassemble = print_insn_h8300h; else if (mach == bfd_mach_h8300s || mach == bfd_mach_h8300sn || mach == bfd_mach_h8300sx || mach == bfd_mach_h8300sxn) disassemble = print_insn_h8300s; else disassemble = print_insn_h8300; which is the same as what gdb/h8300-tdpe.c does, switch (info.bfd_arch_info->mach) { case bfd_mach_h8300: ... set_gdbarch_print_insn (gdbarch, print_insn_h8300); case bfd_mach_h8300h: case bfd_mach_h8300hn: ... set_gdbarch_print_insn (gdbarch, print_insn_h8300h); case bfd_mach_h8300s: case bfd_mach_h8300sn: ... set_gdbarch_print_insn (gdbarch, print_insn_h8300s); so we can leave disassble.c:disassembler doing the selection. gdb: 2017-05-15 Yao Qi * h8300-tdep.c (h8300_gdbarch_init): Don't call set_gdbarch_print_insn. --- gdb/h8300-tdep.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/gdb/h8300-tdep.c b/gdb/h8300-tdep.c index 7b260b1..1e8bde1 100644 --- a/gdb/h8300-tdep.c +++ b/gdb/h8300-tdep.c @@ -1275,7 +1275,6 @@ h8300_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_ptr_bit (gdbarch, 2 * TARGET_CHAR_BIT); set_gdbarch_addr_bit (gdbarch, 2 * TARGET_CHAR_BIT); set_gdbarch_return_value (gdbarch, h8300_return_value); - set_gdbarch_print_insn (gdbarch, print_insn_h8300); break; case bfd_mach_h8300h: case bfd_mach_h8300hn: @@ -1296,7 +1295,6 @@ h8300_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_addr_bit (gdbarch, 2 * TARGET_CHAR_BIT); } set_gdbarch_return_value (gdbarch, h8300h_return_value); - set_gdbarch_print_insn (gdbarch, print_insn_h8300h); break; case bfd_mach_h8300s: case bfd_mach_h8300sn: @@ -1317,7 +1315,6 @@ h8300_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_addr_bit (gdbarch, 2 * TARGET_CHAR_BIT); } set_gdbarch_return_value (gdbarch, h8300h_return_value); - set_gdbarch_print_insn (gdbarch, print_insn_h8300s); break; case bfd_mach_h8300sx: case bfd_mach_h8300sxn: @@ -1338,7 +1335,6 @@ h8300_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_addr_bit (gdbarch, 2 * TARGET_CHAR_BIT); } set_gdbarch_return_value (gdbarch, h8300h_return_value); - set_gdbarch_print_insn (gdbarch, print_insn_h8300s); break; }