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

Function checkfuncname

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

Return True if break should happen here. Whether a break should happen depends on the way that b (the breakpoint) was set. If it was set via line number, check if b.line is the same as the one in the frame. If it was set via function name, check if this is the right function

(b, frame)

Source from the content-addressed store, hash-verified

777
778
779def checkfuncname(b, frame):
780 """Return True if break should happen here.
781
782 Whether a break should happen depends on the way that b (the breakpoint)
783 was set. If it was set via line number, check if b.line is the same as
784 the one in the frame. If it was set via function name, check if this is
785 the right function and if it is on the first executable line.
786 """
787 if not b.funcname:
788 # Breakpoint was set via line number.
789 if b.line != frame.f_lineno:
790 # Breakpoint was set at a line with a def statement and the function
791 # defined is called: don't break.
792 return False
793 return True
794
795 # Breakpoint set via function name.
796 if frame.f_code.co_name != b.funcname:
797 # It's not a function call, but rather execution of def statement.
798 return False
799
800 # We are in the right frame.
801 if not b.func_first_executable_line:
802 # The function is entered for the 1st time.
803 b.func_first_executable_line = frame.f_lineno
804
805 if b.func_first_executable_line != frame.f_lineno:
806 # But we are not at the first line number: don't break.
807 return False
808 return True
809
810
811def effective(file, line, frame):

Callers 1

effectiveFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected