From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 114459 invoked by alias); 23 Jun 2016 15:27:59 -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 114444 invoked by uid 89); 23 Jun 2016 15:27:59 -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=HContent-Transfer-Encoding:8bit 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; Thu, 23 Jun 2016 15:27:58 +0000 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) (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 D7E6FC049D5A; Thu, 23 Jun 2016 15:27:56 +0000 (UTC) Received: from valrhona.uglyboxes.com (ovpn03.gateway.prod.ext.phx2.redhat.com [10.5.9.3]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u5NFRtDZ016755 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 23 Jun 2016 11:27:56 -0400 Subject: Re: [PATCH] python: accept address and explicit locations in gdb.decode_line To: "Metzger, Markus T" , "gdb-patches@sourceware.org" References: <1466433185-29434-1-git-send-email-markus.t.metzger@intel.com> <576AF19B.1090804@redhat.com> From: Keith Seitz Message-ID: <576BFFFB.1050304@redhat.com> Date: Thu, 23 Jun 2016 15:27: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: Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit X-IsSubscribed: yes X-SW-Source: 2016-06/txt/msg00381.txt.bz2 On 06/23/2016 02:15 AM, Metzger, Markus T wrote: > /* Architecture and language to be used in callbacks from > the Python interpreter. */ > struct gdbarch *python_gdbarch; > const struct language_defn *python_language; > > > The function this patch is modifying is: > > /* A Python function which is a wrapper for decode_line_1. */ > > static PyObject * > gdbpy_decode_line (PyObject *self, PyObject *args) > > > I'd say this qualifies as a callback from the Python interpreter. I see what's happening. The code is littered with calls to ensure_python_env (..., current_language), which saves current_language into a structure. This gets saved and restored every time the interpreter is entered/left. "python_language" is really the "current_language_used_by_python." :-) So I'd say I was incorrect and your original patch is correct. Good job keeping me "honest!" Keith