This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH v1 05/13] script language API for GDB: breakpoint changes
- From: Doug Evans <xdje42 at gmail dot com>
- To: Phil Muldoon <pmuldoon at redhat dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Fri, 06 Dec 2013 09:25:19 -0800
- Subject: Re: [PATCH v1 05/13] script language API for GDB: breakpoint changes
- Authentication-results: sourceware.org; auth=none
- References: <52a16634 dot 43da440a dot 47b4 dot ffffb9a3 at mx dot google dot com> <52A1C7B2 dot 8050505 at redhat dot com>
Phil Muldoon <pmuldoon@redhat.com> writes:
> On 06/12/13 05:52, xdje42@gmail.com wrote:
>
>> diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
>> index 111660f..4064e7b 100644
>> --- a/gdb/breakpoint.c
>> +++ b/gdb/breakpoint.c
>> @@ -1052,10 +1052,11 @@ condition_command (char *arg, int from_tty)
>> it, and if it has a definition of the "stop"
>> method. This method and conditions entered into GDB from
>> the CLI are mutually exclusive. */
>> - if (b->py_bp_object
>> - && gdbpy_breakpoint_has_py_cond (b->py_bp_object))
>> - error (_("Cannot set a condition where a Python 'stop' "
>> - "method has been defined in the breakpoint."));
>> + if (breakpoint_has_script_cond (b, SCRIPT_LANG_NONE))
>> + {
>> + error (_("Cannot set a condition where a scripting language"
>> + " 'stop' method has already been defined."));
>> + }
>> set_breakpoint_condition (b, p, from_tty);
>
> As you moved the entire check into the Python ops structure, it occurs
> to me that we might have to tweak struct breakpoint. Instead of
> having each language attach its object to struct breakpoint, we just
> make the pointer to the scripting object void * (and rename it to
> bp->script_object). I think this would be OK as only one scripting
> language may attach a condition call-back to a breakpoint? What do you
> think?
That's certainly a possibility (as long as we keep the restriction in
place, and it's what's there now).
One could still be type-safe and have a union,
plus an enum to say which one is in use, if any.
Thanks!
[For all the reviews, not just this one.]