From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32017 invoked by alias); 9 Mar 2011 03:46:47 -0000 Received: (qmail 32009 invoked by uid 22791); 9 Mar 2011 03:46:47 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 09 Mar 2011 03:46:36 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 4E4772BADF3; Tue, 8 Mar 2011 22:46:34 -0500 (EST) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 0HqIbNFTwEzg; Tue, 8 Mar 2011 22:46:34 -0500 (EST) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 9C1692BADF2; Tue, 8 Mar 2011 22:46:33 -0500 (EST) Received: by joel.gnat.com (Postfix, from userid 1000) id 2E4321459AD; Wed, 9 Mar 2011 07:46:08 +0400 (RET) Date: Wed, 09 Mar 2011 03:51:00 -0000 From: Joel Brobecker To: Maxim Grigoriev Cc: "gdb-patches@sourceware.org" Subject: Re: [commit] Take into account Xtensa TX Message-ID: <20110309034608.GP30306@adacore.com> References: <4D76CDB9.8070902@tensilica.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4D76CDB9.8070902@tensilica.com> User-Agent: Mutt/1.5.20 (2009-06-14) 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: 2011-03/txt/msg00580.txt.bz2 > 2011-03-08 Maxim Grigoriev > > * xtensa-tdep.c (TX_PS): New. > (windowing_enabled): Update to count for Call0 ABI. > (xtensa_hextochar): New. > (xtensa_init_reggroups): Make algorithm generic. > (xtensa_frame_cache): Use TX_PS on Tiny Xtensa. Just a few minor comments... > +/* On TX, hardware can be configured without Exception Option. > + There is no PS register in this case. Inside XT-GDB, let us treat > + it as a virtual read-only register always holding the same value. */ Not really an issue, but we don't need 2 spaces after commas, only after periods. > +static inline char xtensa_hextochar (int xdigit) Formatting: static inline char xtensa_hextochar (int xdigit) Also, we really would like to have every function documented. While we can't go back and document everything that already exists, we can try to make an effort for new functions... > +{ > + static char hex[]="0123456789abcdef"; space around '='. > + return hex[xdigit & 0x0f]; Why do you need the 0xf? Just a precaution? I would use a gdb_assert, if you are about this. Note that instead of using a character array, you can also return '0' + xdigit. > + ps = (ps_regnum >= 0) > + ? get_frame_register_unsigned (this_frame, ps_regnum) : TX_PS; The GNU coding style recommends the use of parentheses in this case (and the parens around ps_regnum >= 0 are superfluous. Thus: ps = (ps_regnum >= 0 ? get_frame_register_unsigned (this_frame, ps_regnum) : TX_PS) > if (gdbarch_tdep (gdbarch)->call_abi != CallAbiCall0Only) > { > + ULONGEST val; > ra = (bp_addr & 0x3fffffff) | 0x40000000; > - regcache_raw_read (regcache, gdbarch_ps_regnum (gdbarch), buf); Empty line between variable declarations and the first statement. (this is a GDB convention) -- Joel