@@ -20,10 +20,12 @@ The following exception is defined:
2020
2121The :mod: `bdb ` module also defines two classes:
2222
23- .. class :: Breakpoint(self, file, line, temporary=0, cond=None, funcname=None)
23+ .. class :: Breakpoint(self, file, line, temporary=0, cond=None, funcname=None, \
24+ var_name=None, var_value=None, var_frame=None, \
25+ bptype='breakpoint')
2426
25- This class implements temporary breakpoints, ignore counts, disabling and
26- (re-)enabling, and conditionals.
27+ This class implements temporary breakpoints, watchpoints, ignore counts,
28+ disabling and (re-)enabling, and conditionals.
2729
2830 Breakpoints are indexed by number through a list called :attr: `bpbynumber `
2931 and by ``(file, line) `` pairs through :attr: `bplist `. The former points to a
@@ -35,6 +37,12 @@ The :mod:`bdb` module also defines two classes:
3537 first line of that function is executed. A conditional breakpoint always
3638 counts a hit.
3739
40+ When creating a watchpoint, *file * and *line * should be ``None ``, and *cond *
41+ , *funcname * are not used. *bptype * should be set to corresponding
42+ watchpoiont type: ``watchpoint ``, ``read watchpoint `` or
43+ ``read/write watchpoint ``.
44+
45+
3846 :class: `Breakpoint ` instances have the following methods:
3947
4048 .. method :: deleteMe()
@@ -60,6 +68,7 @@ The :mod:`bdb` module also defines two classes:
6068 formatted:
6169
6270 * The breakpoint number.
71+ * The breakpoint type.
6372 * If it is temporary or not.
6473 * Its file,line position.
6574 * The condition that causes a break.
@@ -68,6 +77,9 @@ The :mod:`bdb` module also defines two classes:
6877
6978 .. versionadded :: 3.2
7079
80+ .. versionchanged :: 3.7::
81+ Breakpoint type will now changed by corresponding type.
82+
7183 .. method :: bpprint(out=None)
7284
7385 Print the output of :meth: `bpformat ` to the file *out *, or if it is
@@ -182,6 +194,11 @@ The :mod:`bdb` module also defines two classes:
182194 This method checks if there is a breakpoint in the filename of the current
183195 frame.
184196
197+ .. method :: watch_here(frame)
198+
199+ This method checks if there is a watchpoint in the filename and line
200+ belonging to *frame * or, at least, in the current function.
201+
185202 Derived classes should override these methods to gain control over debugger
186203 operation.
187204
@@ -250,15 +267,21 @@ The :mod:`bdb` module also defines two classes:
250267
251268
252269 Derived classes and clients can call the following methods to manipulate
253- breakpoints. These methods return a string containing an error message if
254- something went wrong, or ``None `` if all is well.
270+ breakpoints and watchpoints . These methods return a string containing an
271+ error message if something went wrong, or ``None `` if all is well.
255272
256273 .. method :: set_break(filename, lineno, temporary=0, cond, funcname)
257274
258275 Set a new breakpoint. If the *lineno * line doesn't exist for the
259276 *filename * passed as argument, return an error message. The *filename *
260277 should be in canonical form, as described in the :meth: `canonic ` method.
261278
279+ .. method :: set_watch(var_name, var_frame, bptype)
280+
281+ Set a new watchpoint. If the *var_name * does not exist in *var_frame *,
282+ return a error message. bptype should be *watchpoint *, *read watchpoint *
283+ or *read/write watchpoint *.
284+
262285 .. method :: clear_break(filename, lineno)
263286
264287 Delete the breakpoints in *filename * and *lineno *. If none were set, an
0 commit comments