This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] python: accept address and explicit locations in gdb.decode_line


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]