From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 106092 invoked by alias); 30 Sep 2015 13:48:53 -0000 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 Received: (qmail 106077 invoked by uid 89); 30 Sep 2015 13:48:52 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Wed, 30 Sep 2015 13:48:47 +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 (Postfix) with ESMTPS id 6E51F2FAA81; Wed, 30 Sep 2015 13:48:46 +0000 (UTC) Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t8UDmi1J022564; Wed, 30 Sep 2015 09:48:45 -0400 Message-ID: <560BE83C.9030202@redhat.com> Date: Wed, 30 Sep 2015 13:48:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: Andrew Burgess , gdb-patches@sourceware.org Subject: Re: [PATCH 6/9] gdb: Avoid unneeded calls to parse_frame_specification. References: In-Reply-To: Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SW-Source: 2015-09/txt/msg00661.txt.bz2 On 09/11/2015 07:49 PM, Andrew Burgess wrote: > Within the stack command there are a couple of places where fixed > strings are passed into functions that are really intended for > processing user input. These fixed strings are then processed and the > result returned. > > Given that the input strings in these cases are fixed, and are always > "0", then the result will always be the same, the current frame. By > switching to using get_current_frame instead the code can be simplified, > and the intention of the code is clearer. > > gdb/ChangeLog: > > * stack.c (parse_frame_specification): Delete. > (parse_frame_specification_1): Rename to > parse_frame_specification. > (frame_info): Use parse_frame_specification. > (select_frame_command): Likewise. > (return_command): Use select_frame and print_stack_frame rather > than frame_command and select_frame_command. > (func_command): Use get_current_frame rather than > parse_frame_specification. OK. Nice clean up. Thanks, Pedro Alves