From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 860 invoked by alias); 8 Feb 2013 21:09:08 -0000 Received: (qmail 850 invoked by uid 22791); 8 Feb 2013 21:09:07 -0000 X-SWARE-Spam-Status: No, hits=-7.6 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_SPAMHAUS_DROP,KHOP_THREADED,RCVD_IN_DNSWL_HI,RCVD_IN_HOSTKARMA_W,RP_MATCHES_RCVD,SPF_HELO_PASS,TW_EG 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; Fri, 08 Feb 2013 21:09:01 +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 r18L8wD3008763 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 8 Feb 2013 16:08:59 -0500 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 r18L8ul4028486; Fri, 8 Feb 2013 16:08:57 -0500 Message-ID: <51156968.4080408@redhat.com> Date: Fri, 08 Feb 2013 21:09:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130110 Thunderbird/17.0.2 MIME-Version: 1.0 To: Joel Brobecker CC: Jiong Wang , gdb-patches@sourceware.org, Walter Lee , Tom Tromey Subject: Re: [RFC/TileGX 5/6]show registers in columns References: <50F91633.6000704@tilera.com> <20130118135039.GI3564@adacore.com> <50F97326.3040709@tilera.com> <20130208190946.GD17107@adacore.com> In-Reply-To: <20130208190946.GD17107@adacore.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: 2013-02/txt/msg00229.txt.bz2 On 02/08/2013 07:09 PM, Joel Brobecker wrote: >>>> + else >>>> + { >>>> + fprintf_filtered (file, "0x"); >>>> + for (k = 0; k < tilegx_reg_size; k++) >>>> + { >>>> + int idx; >>>> + if (gdbarch_byte_order (gdbarch) == BFD_ENDIAN_BIG) >>>> + idx = k; >>>> + else >>>> + idx = tilegx_reg_size - 1 - k; >>>> + fprintf_filtered (file, "%02x", (unsigned char) buffer[idx]); > > I do not think that this is the right way of printing the register > value, by doing all the work yourself. I am not completely sure > what the best solution would be, though. The other Global Maintainers > may have a more definitive answer, but perhaps plongest (value_as_long > (register_value)). My suggestion is a little iffy because it assumes > for instance that all register values are signed / or unsigned. Usually you'd use val_print. How about just exporting and calling default_print_one_register_info? You get consistency with other archs for free, and unavailable values handled too. -- Pedro Alves