I'm using PyCharm Community Edition 2020.1.2 on Windows 10 and I try to debug a Python 3.7 Toga project, created with the BeeWare 'briefcase new' command. The app is set up as a module and I can debug into it, until I get to Toga.App.main_window.main_loop(). There, a new thread for the app execution is created and the app's main window is displayed.
The debugger stops there and waits for the main_loop() to end and no breakpoint in my app code has any effect. Then, when main_loop ends, debugging resumes. But I want to debug the newly created thread, because that is where my app code is actually executed. I would have expected to see the new Thread under 'Frames',so that I could change to this thread to continue debugging. But under 'Frames', I first only see 'MainThread' and when main_loop() is executed, there is nothing in 'Frames' anymore until I close the app's main window. Then, again, 'MainThread' is displayed.
This is the code executed in main_loop():
thread = Threading.Thread(Threading.ThreadStart(self.run_app))
Debugging works fine for apps using tkinter for example. A colleague told me that Toga debugging is working on his Mac but he has the same problem under Windows.