From patchwork Tue Sep 30 14:43:06 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Hogan X-Patchwork-Id: 3035 Received: (qmail 2834 invoked by alias); 30 Sep 2014 14:43:24 -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 2818 invoked by uid 89); 30 Sep 2014 14:43:23 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RP_MATCHES_RCVD, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mailapp01.imgtec.com Received: from mailapp01.imgtec.com (HELO mailapp01.imgtec.com) (195.59.15.196) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 30 Sep 2014 14:43:22 +0000 Received: from KLMAIL01.kl.imgtec.org (unknown [192.168.5.35]) by Websense Email Security Gateway with ESMTPS id D4AC3D2B12D26 for ; Tue, 30 Sep 2014 15:43:15 +0100 (IST) Received: from KLMAIL02.kl.imgtec.org (10.40.60.222) by KLMAIL01.kl.imgtec.org (192.168.5.35) with Microsoft SMTP Server (TLS) id 14.3.195.1; Tue, 30 Sep 2014 15:43:18 +0100 Received: from LEMAIL01.le.imgtec.org (192.168.152.62) by klmail02.kl.imgtec.org (10.40.60.222) with Microsoft SMTP Server (TLS) id 14.3.195.1; Tue, 30 Sep 2014 15:43:18 +0100 Received: from jhogan-linux.le.imgtec.org (192.168.154.101) by LEMAIL01.le.imgtec.org (192.168.152.62) with Microsoft SMTP Server (TLS) id 14.3.195.1; Tue, 30 Sep 2014 15:43:18 +0100 From: James Hogan To: CC: James Hogan Subject: [PATCH] MIPS: Ignore invalid regs during info registers all Date: Tue, 30 Sep 2014 15:43:06 +0100 Message-ID: <1412088186-26402-1-git-send-email-james.hogan@imgtec.com> MIME-Version: 1.0 X-IsSubscribed: yes The "info registers all" command causes mips_print_registers_info () to be called for all register numbers, including invalid ones such as unused DSP register numbers. This triggers an error () call which prevents further register values being printed. Just silently return without printing anything or erroring, so that all valid registers can be printed. For example, before this patch: (gdb) info registers all zero: 0x0 ... fir: 0x30f30320 Not a valid register for the current processor type (gdb) After this patch: (gdb) info registers all zero: 0x0 ... fir: 0x30f30320 restart: 0x0 (gdb) gdb/ChangeLog: * mips-tdep.c (mips_print_registers_info): Replace error for single invalid register with silent return. --- gdb/ChangeLog | 5 +++++ gdb/mips-tdep.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index f3282144c303..5da8415c3ca0 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2014-09-30 James Hogan + + * mips-tdep.c (mips_print_registers_info): Replace error for + single invalid register with silent return. + 2014-09-30 Andreas Arnez * gdbarch.sh (regset_from_core_section): Remove gdbarch method. diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c index 188580f2ebdc..3c4665457552 100644 --- a/gdb/mips-tdep.c +++ b/gdb/mips-tdep.c @@ -6332,7 +6332,7 @@ mips_print_registers_info (struct gdbarch *gdbarch, struct ui_file *file, { gdb_assert (regnum >= gdbarch_num_regs (gdbarch)); if (*(gdbarch_register_name (gdbarch, regnum)) == '\0') - error (_("Not a valid register for the current processor type")); + return; mips_print_register (file, frame, regnum); fprintf_filtered (file, "\n");