Editors: please note that this question is specific to the VS Code Python debugger, and the features offered by the VS Code editor.
I have a problematic section of code. The start of the section is decorated with a print statement, as is the end:
print("starting problematic section") # <-- breakpoint set here
# various calls # <--- program hangs somewhere here if not manually stepping through
print("done.") # <-- breakpoint set here
When I use the debugger to step through the code manually everything works okay, and I hit both starting and ending print statements.
When I remove the breakpoint, and do not step through the code manually: program execution hangs. Therefore, it seems relevant to me to be able to see where the program is currently in execution, independently of any breakpoints I might have set.
How can I do so?
I have two ideas:
-
Can the editor continuously and automatically jump me to whatever point in the source is relevant corresponds to where the program currently is in its execution? (Note: this would be happening without any breakpoints being set, or any manual stepping through.)
-
Is it possible to examine a live-updating trace/call-stack of the program’s execution?
(A unfeasible idea I considered: setting a “logpoint” on every single line of source code, which prints out the file/line of the breakpoint. Obviously, setting a logpoint on every line in every file is not possible since it would be awfully time consuming. But, the idea illustrates what I wish I could do: finding out where my program is stuck, when breakpoints/print-statements are not enough.)