From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20893 invoked by alias); 30 Sep 2014 15:36:06 -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 20879 invoked by uid 89); 30 Sep 2014 15:36:05 -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,SPF_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:36:04 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s8UFZv0v031369 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 30 Sep 2014 11:35:57 -0400 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s8UFZuM3020943; Tue, 30 Sep 2014 11:35:56 -0400 Message-ID: <542ACDDB.2080202@redhat.com> Date: Tue, 30 Sep 2014 15:36: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> <542AC5A9.7060101@redhat.com> <542AC6CE.3070700@imgtec.com> In-Reply-To: <542AC6CE.3070700@imgtec.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SW-Source: 2014-09/txt/msg00906.txt.bz2 On 09/30/2014 04:05 PM, James Hogan wrote: > On 30/09/14 16:00, Pedro Alves wrote: >> 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" ? > > I don't think that's possible, because the check is: > if (*(gdbarch_register_name (gdbarch, regnum)) == '\0') > > So any such register already has no name by which to refer to it. Indeed. :-) I'll leave it to Maciej to approve. I see that sh64-tdep.c:sh64_media_print_registers_info has the same problem. A bit silly that we force each arch backend to do this. I guess the loop in registers_info could/should already skip empty-named registers, like default_print_registers_info does. Thanks, Pedro Alves