Search code examples
pythondjangovisual-studio-codedebugging

VS Code not jumping to the top stack frame


I'm trying to debug some Django library code with the default VS Code Python and Django debugging settings (and "justMyCode" = False). I've set a breakpoint in one of the library functions:

breakpoint set in save()

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:

debugger jumps to user code

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:

save is greyed out

If I click on save then the currently executing statement is highlighted:

current statement highlighted green

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.


Solution

  • I see the same thing. Looks like a recent bug in VSCode. I rolled back to VSCode version 1.89 and it worked as expected.

    This was fixed in version 1.90.1 (list of addressed issues).