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

Method do_condition

tools/python-3.11.9-amd64/Lib/pdb.py:871–894  ·  view source on GitHub ↗

condition bpnumber [condition] Set a new condition for the breakpoint, an expression which must evaluate to true before the breakpoint is honored. If condition is absent, any existing condition is removed; i.e., the breakpoint is made unconditional.

(self, arg)

Source from the content-addressed store, hash-verified

869 complete_disable = _complete_bpnumber
870
871 def do_condition(self, arg):
872 """condition bpnumber [condition]
873 Set a new condition for the breakpoint, an expression which
874 must evaluate to true before the breakpoint is honored. If
875 condition is absent, any existing condition is removed; i.e.,
876 the breakpoint is made unconditional.
877 """
878 args = arg.split(' ', 1)
879 try:
880 cond = args[1]
881 except IndexError:
882 cond = None
883 try:
884 bp = self.get_bpbynumber(args[0].strip())
885 except IndexError:
886 self.error('Breakpoint number expected')
887 except ValueError as err:
888 self.error(err)
889 else:
890 bp.cond = cond
891 if not cond:
892 self.message('Breakpoint %d is now unconditional.' % bp.number)
893 else:
894 self.message('New condition set for breakpoint %d.' % bp.number)
895
896 complete_condition = _complete_bpnumber
897

Callers

nothing calls this directly

Calls 5

errorMethod · 0.95
messageMethod · 0.95
get_bpbynumberMethod · 0.80
stripMethod · 0.80
splitMethod · 0.45

Tested by

no test coverage detected