From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2298 invoked by alias); 13 Feb 2013 14:42:15 -0000 Received: (qmail 2282 invoked by uid 22791); 13 Feb 2013 14:42:13 -0000 X-SWARE-Spam-Status: No, hits=-3.0 required=5.0 tests=BAYES_00,KHOP_SPAMHAUS_DROP,KHOP_THREADED,RP_MATCHES_RCVD,TW_EG,TW_RB X-Spam-Check-By: sourceware.org Received: from usmamail.tilera.com (HELO USMAMAIL.TILERA.COM) (12.216.194.151) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 13 Feb 2013 14:41:28 +0000 Received: from [10.201.5.184] (61.139.126.180) by USMAExch2.tad.internal.tilera.com (10.3.0.33) with Microsoft SMTP Server (TLS) id 14.0.694.0; Wed, 13 Feb 2013 09:41:26 -0500 Message-ID: <511BA611.40900@tilera.com> Date: Wed, 13 Feb 2013 14:42:00 -0000 From: Jiong Wang User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:17.0) Gecko/20130107 Thunderbird/17.0.2 MIME-Version: 1.0 To: Pedro Alves CC: Joel Brobecker , , 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> <51156968.4080408@redhat.com> In-Reply-To: <51156968.4080408@redhat.com> Content-Type: text/plain; charset="ISO-8859-1"; format=flowed 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/msg00306.txt.bz2 Hi all, thanks for all these comments, happy Chinese lunar new year! >>> + 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. the reason why we do not use val_print is because, for a zero value, for x86, the default output is: rax 0x7ffff7bd5f60 140737349771104 rbx 0x0 0 rcx 0x0 0 while I think it's better that the output is padded with zero which is MIPS's approach, for example: rax 0x00007FFFF7BD5F60 rbx 0x000000000000000 rcx 0x000000000000000 > How about just exporting and > calling default_print_one_register_info? You get consistency > with other archs for free, and unavailable values handled too. good, I find some code is factored out as "default_print_one_register_info" since Aug, 2012, but it always print a '\n' for each register , so it can not used for multi column output. and this function print register value in both hex format and natural format, it consumes extra width that there is no enough space left for multi columns. all these are quite subjective, I think this patch do not affect the correctness of tilegx gdb, so I do not insist on it. thanks. --- Regards, Jiong