MCPcopy Index your code
hub / github.com/RustPython/RustPython / checkfuncname

Function checkfuncname

Lib/bdb.py:1092–1121  ·  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 and i

(b, frame)

Source from the content-addressed store, hash-verified

1090
1091
1092def checkfuncname(b, frame):
1093 """Return True if break should happen here.
1094
1095 Whether a break should happen depends on the way that b (the breakpoint)
1096 was set. If it was set via line number, check if b.line is the same as
1097 the one in the frame. If it was set via function name, check if this is
1098 the right function and if it is on the first executable line.
1099 """
1100 if not b.funcname:
1101 # Breakpoint was set via line number.
1102 if b.line != frame.f_lineno:
1103 # Breakpoint was set at a line with a def statement and the function
1104 # defined is called: don't break.
1105 return False
1106 return True
1107
1108 # Breakpoint set via function name.
1109 if frame.f_code.co_name != b.funcname:
1110 # It's not a function call, but rather execution of def statement.
1111 return False
1112
1113 # We are in the right frame.
1114 if not b.func_first_executable_line:
1115 # The function is entered for the 1st time.
1116 b.func_first_executable_line = frame.f_lineno
1117
1118 if b.func_first_executable_line != frame.f_lineno:
1119 # But we are not at the first line number: don't break.
1120 return False
1121 return True
1122
1123
1124def effective(file, line, frame):

Callers 1

effectiveFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected