简体   繁体   中英

Visual Studio Code Python Debugger Missing Other Threads in Call Stacks

Basic Info

  • Environment: Windows 11
  • Python Version: 3.8.10
  • Use virtual env: Yes
  • VSCode Python extension version: v2022.20.2

Problem

I tried running an Odoo 15 (multi-threaded) application and previously I was able to see that VSCode properly tracked all spawned thread.

However yesterday when I tried to debug my application, I noticed that my breakpoints on code that was supposed to be run on spawned threads weren't hitting (main thread is fine).

After looking at the call stack window, I noticed that what used to be a list of threads are now showing nothing as if there's only 1 thread running.

我的 Odoo 15 程序上的调用堆栈

Figure 1. Call stack on my Odoo program

So I'm wondering that it has something to do with my VSCode settings, but I'm drawing a blank on which. Interestingly, on my colleague's Linux machine, he can debug and see all the threads fine with VSCode

I've tried to do a clean uninstallation of VSCode and re-installed all extensions manually, but to no avail.

Interestingly, I tried writing a simple threaded program (with threading lib, same as Odoo's) and the call stack showed the multiple threads fine, so I'm lost as of why

多线程程序的调用栈

Figure 2. Call stack on my simple threaded programs

Turns out I have an entry in my.env GEVENT_SUPPORT=True.

Once I erased that flag, everything works normal

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM