aboutsummaryrefslogtreecommitdiff
path: root/gdb/doc/gdb.texinfo
diff options
context:
space:
mode:
authorPhil Muldoon <pmuldoon@redhat.com>2011-03-14 16:09:55 +0000
committerPhil Muldoon <pmuldoon@redhat.com>2011-03-14 16:09:55 +0000
commit7371cf6d8db5a0c04550fc95b1acc87857ac348c (patch)
tree9efe92bd981241731fcdae40a017da24e0c30ed0 /gdb/doc/gdb.texinfo
parent34e77a920a469734b88c8efc79be94be955b1029 (diff)
downloadgdb-7371cf6d8db5a0c04550fc95b1acc87857ac348c.zip
gdb-7371cf6d8db5a0c04550fc95b1acc87857ac348c.tar.gz
gdb-7371cf6d8db5a0c04550fc95b1acc87857ac348c.tar.bz2
2011-03-14 Phil Muldoon <pmuldoon@redhat.com>
* gdb.texinfo (Breakpoints In Python): Add description and example of Python stop function operation. 2010-03-14 Phil Muldoon <pmuldoon@redhat.com> * gdb.python/py-breakpoint.exp: Add Python stop operations tests. 2011-03-14 Phil Muldoon <pmuldoon@redhat.com> * python/python.h: Declare gdbpy_should_stop and gdbpy_breakpoint_has_py_cond. * python/python.c: Add python.h to includes. Remove python.h from HAVE_PYTHON definition (gdbpy_should_stop): New dummy function. (gdbpy_breakpoint_has_py_cond): New dummy function. * python/py-breakpoint.c (bppy_init): Rewrite to allow sub-classing capabilities. (gdbpy_should_stop): New function. (gdbpy_breakpoint_has_py_cond): New function. (local_setattro): New function. * breakpoint.c (condition_command): Add check for Python 'stop' operation. (bpstat_check_breakpoint_conditions): Execute Python 'stop' operation function as part of stop/continue tests.
Diffstat (limited to 'gdb/doc/gdb.texinfo')
-rw-r--r--gdb/doc/gdb.texinfo28
1 files changed, 28 insertions, 0 deletions
diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
index 4c07af9..01455d1 100644
--- a/gdb/doc/gdb.texinfo
+++ b/gdb/doc/gdb.texinfo
@@ -23115,6 +23115,34 @@ argument defines the class of watchpoint to create, if @var{type} is
assumed to be a @var{WP_WRITE} class.
@end defmethod
+@defop Operation {gdb.Breakpoint} stop (self)
+The @code{gdb.Breakpoint} class can be sub-classed and, in
+particular, you may choose to implement the @code{stop} method.
+If this method is defined as a sub-class of @code{gdb.Breakpoint},
+it will be called when the inferior reaches any location of a
+breakpoint which instantiates that sub-class. If the method returns
+@code{True}, the inferior will be stopped at the location of the
+breakpoint, otherwise the inferior will continue.
+
+If there are multiple breakpoints at the same location with a
+@code{stop} method, each one will be called regardless of the
+return status of the previous. This ensures that all @code{stop}
+methods have a chance to execute at that location. In this scenario
+if one of the methods returns @code{True} but the others return
+@code{False}, the inferior will still be stopped.
+
+Example @code{stop} implementation:
+
+@smallexample
+class MyBreakpoint (gdb.Breakpoint):
+ def stop (self):
+ inf_val = gdb.parse_and_eval("foo")
+ if inf_val == 3:
+ return True
+ return False
+@end smallexample
+@end defop
+
The available watchpoint types represented by constants are defined in the
@code{gdb} module: