I’m trying to debug some Django library code with the default VS Code Python and Django debugging settings (and "justMyCode" = True
). I’ve set a breakpoint in one of the library functions:
I call this from some user code, eg. formset.save()
. When I debug and hit the breakpoint, VS Code jumps to this user code instead of the library code as I’d have expected:
Pressing "Step Into" seems to progress the library code, but keeps jumping back to the user code which is calling it.
The call stack seems to know about the library code, although it is greyed out:
If I click on save
then the currently executing statement is highlighted:
I can go through the tedious process of stepping through, clicking the top stack frame, and then doing usual things like inspecting locals. The issue just seems to be about where VS Code is jumping to every time the debugger breaks (or maybe where pdb is telling VS Code to jump — I’m not sure).
I want the library code which is currently being executed to be jumped to, and that’s what I would have expected to happen.
2
Answers
for debugging the problem that you can’t get into the library code could be due to the
just my code
setting. Click onFile
and selectPreferences
and go toSettings
. Search for thejustMyCode
setting and change this setting to false.I see the same thing. Looks like a recent bug in VSCode.
I rolled back to https://code.visualstudio.com/updates/v1_89 which works as expected