Skip to content

How interactive debugging works (old way)

Rich Chiodo edited this page Jul 22, 2022 · 15 revisions

The Interactive Window is used for running cells in a python script. One of the capabilities of running these cells is to debug them.

This page will describe how this debugging is implemented under the covers.

What does debug cell do?

image<!-- Generated at https://sequencediagram.org/ with the following text: title Interactive Window Debugging

participant VS Code#lightgreen participant Jupyter#lightblue participant Kernel#lightyellow VS Code->Jupyter:Debug cell clicked Jupyter->VS Code:Debug attach Jupyter->Kernel:Replace kernel's run cell handler Jupyter->Kernel:Remap source files Jupyter->Kernel:Enable thread tracing Jupyter->Jupyter:Add breakpoint to source Jupyter->Kernel:Execute cell with new source Kernel->VS Code:Stop Event -->

This sequence diagram is explained below:

Special case to get 'debugpy' attached

Translation of file paths

Changing cell hashes

Clone this wiki locally