From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16087 invoked by alias); 3 Apr 2012 23:14:32 -0000 Received: (qmail 16078 invoked by uid 22791); 3 Apr 2012 23:14:30 -0000 X-SWARE-Spam-Status: No, hits=-6.7 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; Tue, 03 Apr 2012 23:14:18 +0000 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q33NEH1t027753 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 3 Apr 2012 19:14:17 -0400 Received: from valrhona.uglyboxes.com (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q33NEE5Q029071 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Tue, 3 Apr 2012 19:14:16 -0400 Message-ID: <4F7B8446.2010004@redhat.com> Date: Tue, 03 Apr 2012 23:14:00 -0000 From: Keith Seitz User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.1) Gecko/20120209 Thunderbird/10.0.1 MIME-Version: 1.0 To: Doug Evans CC: "gdb-patches@sourceware.org ml" Subject: Re: [RFA 1/2] Linespec rewrite (update 2) References: <4F70F8F7.503@redhat.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes 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-04/txt/msg00050.txt.bz2 On 04/03/2012 02:18 PM, Doug Evans wrote: > 1) Replace "_t" suffix with "p" or "_p" or some such. Done. > 2) [enums UPPERCASE & prefixed] > /* No sign */ > line_offset_none, > > /* A plus sign ("+") */ > line_offset_plus, > > /* A minus sign ("-") */ > line_offset_minus, > > /* A special "sign" for unspecified offset. */ > line_offset_unknown > }; > 4) > > /* Token types */ > > enum ls_token_type > { > /* A keyword */ > LSTOKEN_KEYWORD = 0, > > Yay, uppercase enum values. > Can we uppercase all enum values in this file? Done. > 3) struct linespec > The members here need more documentation. > Something like explicitly stating that if the value was absent in the > linespec, then the pointer is NULL and the corresponding values (e.g., expr_pc) > are invalid. I've added some comments. Please review and let me know if you think more is needed. This also elided the fact that find_label_symbols requires its third parameter and it may not be NULL. I've removed the check for non-NULL LABEL_FUNCS_RET in that function (and checked all callers). > 5) > > static char * > skip_quote_char (const char *string, char quote_char) > > Return const char *, and if the cast to char * is necessary, put it in > the caller. Done. > 6) > > /* Special case: Ada operators. */ > if (current_language->la_language == language_ada > && quote_char == '\"') > > So some aspect of ' vs " remains? Ada allows operators named (literally) "+". The quote is part of the actual method name. That's what the check is attempting to ascertain. > Plus, IWBN if the language to use was not taken from a global. > It can start out as a global, but the innards should take it > as a parameter (e.g. record in linespec_parser). Done. I had this in an earlier version. I don't know why I changed it. > 7) > > In parse_linespec: > > /* This token must be LSTOKEN_COLON. */ > if (token.type != LSTOKEN_COLON) > return values; > > It's not clear to me what case this is handling. > Is "must" too strong a word? When will the "then" clause be taken? If the linespec contains a filename, it *must* also have LSTOKEN_COLON. That is the only permitted usage of a filename. Since this case is already dealt with by the optimization earlier (where it checks if the next token is LSTOKEN_COLON before looking for the symtab), this isn't really needed at all. I've removed it. > 8) > > /* Initialize a new linespec parser. */ > static void > linespec_parser_new (linespec_parser *parser, > > Blank line after comment. Added. I've pushed the requested changes to my archer branch. [Tom's asked me to repost it as well.] Thank you very much for taking a look. Keith