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

Method request_set_next

_pydevd_bundle/pydevd_api.py:279–314  ·  view source on GitHub ↗

set_next_cmd_id may actually be one of: CMD_RUN_TO_LINE CMD_SET_NEXT_STATEMENT CMD_SMART_STEP_INTO -- note: request_smart_step_into is preferred if it's possible to work with bytecode offset. :param Optional[str] original_fil

(self, py_db, seq, thread_id, set_next_cmd_id, original_filename, line, func_name)

Source from the content-addressed store, hash-verified

277 self.request_set_next(py_db, seq, thread_id, CMD_SMART_STEP_INTO, None, line, func_name)
278
279 def request_set_next(self, py_db, seq, thread_id, set_next_cmd_id, original_filename, line, func_name):
280 """
281 set_next_cmd_id may actually be one of:
282
283 CMD_RUN_TO_LINE
284 CMD_SET_NEXT_STATEMENT
285
286 CMD_SMART_STEP_INTO -- note: request_smart_step_into is preferred if it's possible
287 to work with bytecode offset.
288
289 :param Optional[str] original_filename:
290 If available, the filename may be source translated, otherwise no translation will take
291 place (the set next just needs the line afterwards as it executes locally, but for
292 the Jupyter integration, the source mapping may change the actual lines and not only
293 the filename).
294 """
295 t = pydevd_find_thread_by_id(thread_id)
296 if t:
297 if original_filename is not None:
298 translated_filename = self.filename_to_server(original_filename) # Apply user path mapping.
299 pydev_log.debug("Set next (after path translation) in: %s line: %s", translated_filename, line)
300 func_name = self.to_str(func_name)
301
302 assert translated_filename.__class__ == str # i.e.: bytes on py2 and str on py3
303 assert func_name.__class__ == str # i.e.: bytes on py2 and str on py3
304
305 # Apply source mapping (i.e.: ipython).
306 _source_mapped_filename, new_line, multi_mapping_applied = py_db.source_mapping.map_to_server(translated_filename, line)
307 if multi_mapping_applied:
308 pydev_log.debug("Set next (after source mapping) in: %s line: %s", translated_filename, line)
309 line = new_line
310
311 int_cmd = InternalSetNextStatementThread(thread_id, set_next_cmd_id, line, func_name, seq=seq)
312 py_db.post_internal_command(int_cmd, thread_id)
313 elif thread_id.startswith("__frame__:"):
314 sys.stderr.write("Can't set next statement in tasklet: %s\n" % (thread_id,))
315
316 def request_reload_code(self, py_db, seq, module_name, filename):
317 """

Callers 3

_cmd_set_nextMethod · 0.80
on_goto_requestMethod · 0.80

Calls 7

filename_to_serverMethod · 0.95
to_strMethod · 0.95
pydevd_find_thread_by_idFunction · 0.90
map_to_serverMethod · 0.80
post_internal_commandMethod · 0.80
writeMethod · 0.45

Tested by

no test coverage detected