I have a pretty serious multithreaded debugging problem. I have synchronization issues when interacting with a serial device, and I need to track it. I have three threads:
- The main stream of UI updates. The user can either change one parameter of the device, or a lot of things at once by selecting a preset.
- A status check thread that asks to verify that the device is still connected. If the user disconnects the device or interacts with it, it is interesting that state changes should be reflected in the user interface.
- The stream that reads the serial port to which the device responds.
My problem is actually related to debugging this situation. It seems that every line I have in every thread should have a breakpoint for debugging; if I break in one thread, the debugger will not go through that thread. I understand that other threads will continue to be updated, but should not the thread that I execute be as normal in the debugger, i.e. Go from one line to another? Then I could use the "threads" tab to switch between threads.
I mention that I am in WPF because I do not know if this changed the situation at all; perhaps this is so, maybe not. The state control flow is part of the user interface control because the status should only be checked when the user interface is enabled. This control is in a library other than the main application.
source
share