From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 98734 invoked by alias); 23 Jun 2016 09:15:43 -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 98717 invoked by uid 89); 23 Jun 2016 09:15:42 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.0 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 spammy=Keith, *args, Hx-languages-length:1716, commercial X-HELO: mga04.intel.com Received: from mga04.intel.com (HELO mga04.intel.com) (192.55.52.120) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 23 Jun 2016 09:15:32 +0000 Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga104.fm.intel.com with ESMTP; 23 Jun 2016 02:15:31 -0700 X-ExtLoop1: 1 Received: from irsmsx106.ger.corp.intel.com ([163.33.3.31]) by orsmga002.jf.intel.com with ESMTP; 23 Jun 2016 02:15:29 -0700 Received: from irsmsx104.ger.corp.intel.com ([169.254.5.117]) by IRSMSX106.ger.corp.intel.com ([169.254.8.145]) with mapi id 14.03.0248.002; Thu, 23 Jun 2016 10:15:28 +0100 From: "Metzger, Markus T" To: Keith Seitz , "gdb-patches@sourceware.org" Subject: RE: [PATCH] python: accept address and explicit locations in gdb.decode_line Date: Thu, 23 Jun 2016 09:15:00 -0000 Message-ID: References: <1466433185-29434-1-git-send-email-markus.t.metzger@intel.com> <576AF19B.1090804@redhat.com> In-Reply-To: <576AF19B.1090804@redhat.com> Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2016-06/txt/msg00375.txt.bz2 Hi Keith, Thanks for your quick review. > > It's not clear to me whether I should use python_language or > current_language, > > though. Is there some comment that explains it? >=20 > 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! >=20 > The correct language to use is the language in which the linespec is to > be evaluated. Most typically, that is current_language. I found this comment in gdb/python/python.c: /* 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 don't see how this is intended to work when those callbacks call GDB functions. As long as language and gdbarch are passed as arguments, we're fine. But making sure to not add an implicit use of current_language or target_gdbarch () that ends up being used by the Python layer sounds a bit tricky to me. Maybe I got the whole idea behind it wrong. Regards, Markus. Intel Deutschland GmbH Registered Address: Am Campeon 10-12, 85579 Neubiberg, Germany Tel: +49 89 99 8853-0, www.intel.de Managing Directors: Christin Eisenschmid, Christian Lamprechter Chairperson of the Supervisory Board: Nicole Lau Registered Office: Munich Commercial Register: Amtsgericht Muenchen HRB 186928