MCPcopy Create free account
hub / github.com/fabioz/PyDev.Debugger / internal_get_next_statement_targets

Function internal_get_next_statement_targets

_pydevd_bundle/pydevd_comm.py:1129–1154  ·  view source on GitHub ↗

gets the valid line numbers for use with set next statement

(dbg, seq, thread_id, frame_id)

Source from the content-addressed store, hash-verified

1127
1128
1129def internal_get_next_statement_targets(dbg, seq, thread_id, frame_id):
1130 """gets the valid line numbers for use with set next statement"""
1131 try:
1132 frame = dbg.find_frame(thread_id, frame_id)
1133 if frame is not None:
1134 code = frame.f_code
1135 xml = "<xml>"
1136 try:
1137 linestarts = dis.findlinestarts(code)
1138 except:
1139 # i.e.: jython doesn't provide co_lnotab, so, we can only keep at the current line.
1140 xml += "<line>%d</line>" % (frame.f_lineno,)
1141 else:
1142 for _, line in linestarts:
1143 if line is not None:
1144 xml += "<line>%d</line>" % (line,)
1145 del frame
1146 xml += "</xml>"
1147 cmd = dbg.cmd_factory.make_get_next_statement_targets_message(seq, xml)
1148 dbg.writer.add_command(cmd)
1149 else:
1150 cmd = dbg.cmd_factory.make_error_message(seq, "Frame not found: %s from thread: %s" % (frame_id, thread_id))
1151 dbg.writer.add_command(cmd)
1152 except:
1153 cmd = dbg.cmd_factory.make_error_message(seq, "Error resolving frame: %s from thread: %s" % (frame_id, thread_id))
1154 dbg.writer.add_command(cmd)
1155
1156
1157def _evaluate_response(py_db, request, result, error_message=""):

Callers

nothing calls this directly

Calls 4

make_error_messageMethod · 0.80
find_frameMethod · 0.45
add_commandMethod · 0.45

Tested by

no test coverage detected