From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 83466 invoked by alias); 22 Jun 2016 20:14:29 -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 83428 invoked by uid 89); 22 Jun 2016 20:14:23 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.3 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=keith 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, 22 Jun 2016 20:14:22 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D428183F45; Wed, 22 Jun 2016 20:14:20 +0000 (UTC) Received: from valrhona.uglyboxes.com (ovpn03.gateway.prod.ext.phx2.redhat.com [10.5.9.3]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u5MKEJ5R025702 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 22 Jun 2016 16:14:20 -0400 Subject: Re: [PATCH] python: accept address and explicit locations in gdb.decode_line To: Markus Metzger , gdb-patches@sourceware.org References: <1466433185-29434-1-git-send-email-markus.t.metzger@intel.com> From: Keith Seitz Message-ID: <576AF19B.1090804@redhat.com> Date: Wed, 22 Jun 2016 20:14:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 MIME-Version: 1.0 In-Reply-To: <1466433185-29434-1-git-send-email-markus.t.metzger@intel.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2016-06/txt/msg00374.txt.bz2 On 06/20/2016 07:33 AM, Markus Metzger wrote: > The gdb.decode_line python function is documented to support the same location > expressions as the "break" command. It currently expects a linespec location. > > Instead of creating a linespec location directly, create the location via > string_to_event_location_basic. > I must have missed python when Joel asked me to take a look at this. Your patch is correct (with the language correction below). > It's not clear to me whether I should use python_language or current_language, > though. Is there some comment that explains it? Although string_to_event_location_basic does not use the language parameter, I kept it for parallelism with string_to_event_location. What can I say? I really dislike using globals! The correct language to use is the language in which the linespec is to be evaluated. Most typically, that is current_language. Keith