This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] python: accept address and explicit locations in gdb.decode_line
- From: Keith Seitz <keiths at redhat dot com>
- To: "Metzger, Markus T" <markus dot t dot metzger at intel dot com>, "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>
- Date: Thu, 23 Jun 2016 08:27:55 -0700
- Subject: Re: [PATCH] python: accept address and explicit locations in gdb.decode_line
- Authentication-results: sourceware.org; auth=none
- References: <1466433185-29434-1-git-send-email-markus dot t dot metzger at intel dot com> <576AF19B dot 1090804 at redhat dot com> <A78C989F6D9628469189715575E55B23332EFA94 at IRSMSX104 dot ger dot corp dot intel dot com>
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