This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [patch] [python] Implement stop_p for gdb.Breakpoint
>>>>> "Phil" == Phil Muldoon <pmuldoon@redhat.com> writes:
Phil> Here is the latest patch. I've added the mutual exclusion to setting
Phil> the CLI condition and the Python method. I renamed the method to
Phil> 'stop'. Plus all the other review comments regarding the #HAVE Python
Phil> defines . I included some changes from the branch that alter how
Phil> breakpoints are initialized (the tests require those changes).
Thanks.
Phil> + error (_("Cannot set a condition where a Python 'stop' " \
No backslash.
Phil> +If this method is defined as a sub-class of @code{gdb.Breakpoint},
Phil> +it will be called when the inferior stops at any location of a
Phil> +breakpoint which instantiates that sub-class. If the method returns
Phil> +@code{True}, the inferior will be stopped at the location of the
Phil> +breakpoint, otherwise the inferior will continue.
The repeated use of "stops" here makes it read a little strangely. I
think it should use "reaches" first, like "... when the inferior reaches
any location of a ...".
Phil> +/* Function that is called when a Python condition is evaluated. */
Phil> +char *stop_func = "stop";
`static const'
Phil> diff --git a/gdb/python/python.c b/gdb/python/python.c
Phil> index 3b10d8c..2d7213a 100644
Phil> --- a/gdb/python/python.c
Phil> +++ b/gdb/python/python.c
Phil> @@ -30,6 +30,7 @@
Phil> #include "exceptions.h"
Phil> #include "event-loop.h"
Phil> #include "serial.h"
Phil> +#include "python.h"
You should remove the other inclusion of python.h.
Ok with the above changes. Thanks again.
Tom