profile
viewpoint

Ask questionsCall Stack empty when Debugging

<!-- Please search existing issues to avoid creating duplicates. -->

Environment data

  • VS Code version: 1.49.3
  • Extension version (available under the Extensions sidebar): v2020.9.114305
  • OS and version: Windows 10 2004
  • Python version (& distribution if applicable, e.g. Anaconda): 3.8.6
  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): N/A
  • Relevant/affected Python packages and their versions:
  • Relevant/affected Python-related VS Code extensions and their versions:
  • Value of the python.languageServer setting: Jedi

Expected behaviour

Call Stack should show running processes and threads. Call Stack working with a C++ program

Actual behaviour

Call Stack is empty until a breakpoint is reached and even then it doesn't show the running threads. empty Call Stack when running Python program

Steps to reproduce:

  1. Create python 'project' with these settings in .vscode

settings.json:

{
    "python.pythonPath": "C:\\Users\\summo\\AppData\\Local\\Programs\\Python\\Python38\\python.exe"
}

launch.json

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Python: Current File",
            "type": "python",
            "request": "launch",
            "program": "${file}",
            "console": "externalTerminal"
        }
    ]
}
  1. Python code:
import threading
import time

threads = []

MAX_THREADS = 3


def get_thread():
    while True:
        print(threading.get_ident())  # print thread ID
        time.sleep(1)


def main():
    for i in range(MAX_THREADS):
        getter_thread = threading.Thread(
            target=get_thread, name=f"Getter{i}", daemon=True)
        threads.append(getter_thread)
        getter_thread.start()
    
    wait = input()


if __name__ == "__main__":
    main()



microsoft/debugpy

Answer questions int19h

You've mentioned that it behaves somewhat differently when there is a breakpoint that is hit - could you do that repro with logging enabled, as well?

useful!

Related questions

No questions were found.
source:https://uonfu.com/
Github User Rank List