From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22362 invoked by alias); 26 Feb 2013 18:08:21 -0000 Received: (qmail 22353 invoked by uid 22791); 26 Feb 2013 18:08:19 -0000 X-SWARE-Spam-Status: No, hits=-8.0 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; Tue, 26 Feb 2013 18:08:11 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r1QI8AbV014606 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 26 Feb 2013 13:08:10 -0500 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r1QI88Ce021093; Tue, 26 Feb 2013 13:08:09 -0500 Message-ID: <512CFA08.6060507@redhat.com> Date: Tue, 26 Feb 2013 18:08: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: Jiong Wang CC: gdb-patches@sourceware.org, Walter Lee Subject: Re: [RFC/TileGX 2/2] fix gdbserver bug for 32bit elf References: <5110E21A.2060308@tilera.com> In-Reply-To: <5110E21A.2060308@tilera.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/msg00659.txt.bz2 On 02/05/2013 10:42 AM, Jiong Wang wrote: > for tilegx, all general registers are 64bit, while the pseudo 'pc' is 32bit under tilegx32. You mention the 'pc' as a pseudo register. At the hardware/kernel level, on tilegx32, is 'pc' 32-bit or 64-bit? I thought Tile-GX was always 64-bit, and tilegx32 was just an ABI. Is the kernel already trimming the PC? I'm a bit ambivalent in these cases. On the one hand, I tend to think it'd be better to send the whole 64 bits to GDB, and have GDB trim to 32-bits. There's always the possibility the bug the user is debugging is caused by the PC register ending up loaded with >32-bit (say, bad asm, or a bad function pointer?), and a design that trims at such a low level leaves no chance of gdb diagnosing it. If you look at the x32 support, you'll find we still send a 64-bit RIP down to GDB. OTOH, I don't care that much about Tile-GX to argue, so I won't and this is fine with me. ;-) > gdb client treat 'pc' correctly in > > static struct type * > tilegx_register_type (struct gdbarch *gdbarch, int regnum) > { > if (regnum == TILEGX_PC_REGNUM) > return builtin_type (gdbarch)->builtin_func_ptr; > > > while gdbserver always treat it as 64bit, there > is mismatch. > > gdb/ChangeLog: > * gdbserver/Makefile.in: Add rule for reg-tilegx32.c > * gdbserver/configure.srv: Add rule for reg-tilegx32.o gdbserver has it's own ChangeLog. Move these entries there, and drop the "gdbserver/" prefix. Missing period at end of sentences. > * gdbserver/linux-tile-low.c: Add tile_arch_setup and > init_registers_tilegx32, tile_arch_setup will register > different register info according to elf class. also, Double space after '.'. "also" should be capitalized, but, just remove it altogether and start with "Use". > use "uint_reg_t" to represent register size. > * regformats/reg-tilegx.dat: Change abi name to "tilegx. Missing ". > * regformats/reg-tilegx32.dat: New. Most of these entries are missing the "(context)" bits. Please see the numerous entries in gdbserver/ChangeLog touching similar code. Other than that, it looks good. Thanks, -- Pedro Alves