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 v1 05/13] script language API for GDB: breakpoint changes


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.]


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