From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24074 invoked by alias); 30 Sep 2014 15:01:16 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 24062 invoked by uid 89); 30 Sep 2014 15:01:15 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Tue, 30 Sep 2014 15:01:14 +0000 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s8UF0xmU024764 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 30 Sep 2014 11:01:00 -0400 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s8UF0vn7019540; Tue, 30 Sep 2014 11:00:58 -0400 Message-ID: <542AC5A9.7060101@redhat.com> Date: Tue, 30 Sep 2014 15:01:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.1.1 MIME-Version: 1.0 To: James Hogan , gdb-patches@sourceware.org Subject: Re: [PATCH] MIPS: Ignore invalid regs during info registers all References: <1412088186-26402-1-git-send-email-james.hogan@imgtec.com> In-Reply-To: <1412088186-26402-1-git-send-email-james.hogan@imgtec.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SW-Source: 2014-09/txt/msg00903.txt.bz2 On 09/30/2014 03:43 PM, James Hogan wrote: > 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. What happens when the user does "info registers that-unused-register" ? Thanks, Pedro Alves > > 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"); >