VS Code not jumping to the top stack frame

  Kiến thức lập trình

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.

LEAVE A COMMENT