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/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


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