From: "Metzger, Markus T" <markus.t.metzger@intel.com>
To: Keith Seitz <keiths@redhat.com>,
"gdb-patches@sourceware.org" <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 [thread overview]
Message-ID: <A78C989F6D9628469189715575E55B23332EFA94@IRSMSX104.ger.corp.intel.com> (raw)
In-Reply-To: <576AF19B.1090804@redhat.com>
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?
>
> 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.
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
next prev parent reply other threads:[~2016-06-23 9:15 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-20 14:33 Markus Metzger
2016-06-22 20:14 ` Keith Seitz
2016-06-23 9:15 ` Metzger, Markus T [this message]
2016-06-23 15:27 ` Keith Seitz
2016-06-29 14:15 ` Metzger, Markus T
2016-10-06 17:42 ` Pedro Alves
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=A78C989F6D9628469189715575E55B23332EFA94@IRSMSX104.ger.corp.intel.com \
--to=markus.t.metzger@intel.com \
--cc=gdb-patches@sourceware.org \
--cc=keiths@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox