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: Markus Metzger <markus dot t dot metzger at intel dot com>, gdb-patches at sourceware dot org
- Date: Wed, 22 Jun 2016 13:14:19 -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>
On 06/20/2016 07:33 AM, Markus Metzger wrote:
> The gdb.decode_line python function is documented to support the same location
> expressions as the "break" command. It currently expects a linespec location.
>
> Instead of creating a linespec location directly, create the location via
> string_to_event_location_basic.
>
I must have missed python when Joel asked me to take a look at this.
Your patch is correct (with the language correction below).
> 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.
Keith