MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / set_break

Method set_break

tools/python-3.11.9-amd64/Lib/bdb.py:376–390  ·  view source on GitHub ↗

Set a new breakpoint for filename:lineno. If lineno doesn't exist for the filename, return an error message. The filename should be in canonical form.

(self, filename, lineno, temporary=False, cond=None,
                  funcname=None)

Source from the content-addressed store, hash-verified

374 bp_linenos.append(lineno)
375
376 def set_break(self, filename, lineno, temporary=False, cond=None,
377 funcname=None):
378 """Set a new breakpoint for filename:lineno.
379
380 If lineno doesn't exist for the filename, return an error message.
381 The filename should be in canonical form.
382 """
383 filename = self.canonic(filename)
384 import linecache # Import as late as possible
385 line = linecache.getline(filename, lineno)
386 if not line:
387 return 'Line %s:%d does not exist' % (filename, lineno)
388 self._add_to_breaks(filename, lineno)
389 bp = Breakpoint(filename, lineno, temporary, cond, funcname)
390 return None
391
392 def _load_breaks(self):
393 """Apply all breakpoints (set in other instances) to this one.

Callers 1

do_breakMethod · 0.45

Calls 4

canonicMethod · 0.95
_add_to_breaksMethod · 0.95
BreakpointClass · 0.85
getlineMethod · 0.45

Tested by

no test coverage detected