From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8468 invoked by alias); 1 Aug 2012 20:20:31 -0000 Received: (qmail 8455 invoked by uid 22791); 1 Aug 2012 20:20:29 -0000 X-SWARE-Spam-Status: No, hits=-7.5 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_DNSWL_HI,RCVD_IN_HOSTKARMA_W,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 01 Aug 2012 20:20:16 +0000 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q71KKERQ030365 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 1 Aug 2012 16:20:14 -0400 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id q71KKCeR000818; Wed, 1 Aug 2012 16:20:12 -0400 Message-ID: <50198F7B.1080903@redhat.com> Date: Wed, 01 Aug 2012 20:20:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:14.0) Gecko/20120717 Thunderbird/14.0 MIME-Version: 1.0 To: Ulrich Weigand CC: Sergio Durigan Junior , GDB Patches , Tom Tromey , Jan Kratochvil Subject: info registers output References: <201208011940.q71Jeksr002407@d06av02.portsmouth.uk.ibm.com> In-Reply-To: <201208011940.q71Jeksr002407@d06av02.portsmouth.uk.ibm.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit 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 X-SW-Source: 2012-08/txt/msg00039.txt.bz2 On 08/01/2012 08:40 PM, Ulrich Weigand wrote: > Pedro Alves wrote: >> Why is the output format different? It looks like consistency here would be good. > > The problem is that "pc", "fp", etc can refer to different things under > the covers: either a register defined by the target code, or else a > "user register" defined by GDB common code. > > On many targets (but not Intel), "pc" is the name of a register defined > by the target. In this case, registers_info uses the standard > gdbarch_print_registers_info routine to output its content; this gives > a larger space between register name and value, and outputs the > contents both in hex and in the register's default type, usually a > function pointer type. > > On targets where "pc" is *not* the name of a register defined by the > target, registers_info still recognizes the name as "user register", > and uses a separate code path to print its value. This results in > a different (shorter) output ... Ah. I wonder if that's been made on purpose. You get this on amd64: (gdb) info registers rip pc rip 0x390f407e68 0x390f407e68 pc: 0x390f407e68 GDB knows the type of "pc", and so should be able to print "pc" like "rip". Would that be a good idea? -- Pedro Alves