OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

VS Code not jumping to the top stack frame

  • Thread starter Thread starter carpetguy
  • Start date Start date
C

carpetguy

Guest
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.
<p>I'm trying to debug some Django library code with the default VS Code Python and Django debugging settings (and <code>"justMyCode" = False</code>). I've set a breakpoint in one of the library functions:</p>
<p><a href="https://i.sstatic.net/0k9ZEGCY.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/0k9ZEGCY.png" alt="breakpoint set in save()" /></a></p>
<p>I call this from some user code, eg. <code>formset.save()</code>. When I debug and hit the breakpoint, VS Code jumps to this user code instead of the library code as I'd have expected:</p>
<p><a href="https://i.sstatic.net/trp1QHOy.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/trp1QHOy.png" alt="debugger jumps to user code" /></a></p>
<p>Pressing "Step Into" seems to progress the library code, but keeps jumping back to the user code which is calling it.</p>
<p>The call stack seems to know about the library code, although it is greyed out:</p>
<p><a href="https://i.sstatic.net/fz0R2BN6.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/fz0R2BN6.png" alt="save is greyed out" /></a></p>
<p>If I click on <code>save</code> then the currently executing statement is highlighted:</p>
<p><a href="https://i.sstatic.net/7wRUpXeK.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/7wRUpXeK.png" alt="current statement highlighted green" /></a></p>
<p>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).</p>
<p>I want the library code which is currently being executed to be jumped to, and that's what I would have expected to happen.</p>
 

Latest posts

Top