[PATCH v1 05/13] script language API for GDB: breakpoint changes

Phil Muldoon pmuldoon@redhat.com
Fri Dec 6 12:49:00 GMT 2013


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?

Cheers,

Phil



More information about the Gdb-patches mailing list