From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21513 invoked by alias); 28 Jun 2012 21:01:11 -0000 Received: (qmail 21500 invoked by uid 22791); 28 Jun 2012 21:01:10 -0000 X-SWARE-Spam-Status: No, hits=-6.5 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,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; Thu, 28 Jun 2012 21:00:55 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q5SL0sTJ000862 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 28 Jun 2012 17:00:54 -0400 Received: from barimba (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q5SL0rIV022945 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Thu, 28 Jun 2012 17:00:54 -0400 From: Tom Tromey To: dje@google.com (Doug Evans) Cc: gdb-patches@sourceware.org Subject: Re: [RFA] decode_line_spec_* cleanup References: <20120628195537.3B6D01E13A1@ruffy2.mtv.corp.google.com> Date: Thu, 28 Jun 2012 21:01:00 -0000 In-Reply-To: <20120628195537.3B6D01E13A1@ruffy2.mtv.corp.google.com> (Doug Evans's message of "Thu, 28 Jun 2012 12:55:37 -0700 (PDT)") Message-ID: <87fw9f40e2.fsf@fleche.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain 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-06/txt/msg00865.txt.bz2 >>>>> "Doug" == Doug Evans writes: Doug> First: Yes, I know these function names are really long :-). Yeah. I think they make the code harder to read. Doug> I'm happy to change them, but decode_line_spec and decode_line_spec_1 Doug> just don't work for me. I think "spec" and "as_default" don't add much value. Then you would have decode_line_with_current_source and decode_line_with_last_displayed. That is better but still on the long side. Perhaps "with" is also not needed. Another approach would be to separate the defaults-getting from decode_line in general. Doug> +struct symtabs_and_lines Doug> +decode_line_spec_with_current_source_as_default (char *string, int flags) Doug> +{ [...] Doug> + /* We use whatever is set as the current source line. We do not try Doug> + and get a default or it will recursively call us! */ Doug> + cursal = get_current_source_symtab_and_line (); This seems a little weird since this is already the default. In a way this makes the "with_current_source_as_default" more confusing, since that does not actually name the difference between this function and decode_line_1. Tom