MCPcopy Index your code
hub / github.com/python/cpython / checkfuncname

Function checkfuncname

Lib/bdb.py:1083–1112  ·  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

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

Callers 1

effectiveFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…