how to debug multity threads
-
I have two threads one used to send data to COM1 buffer, the other used to monitor COM1 events. I want to know whether the corresponding event is received when I send a byte in the first thread. so I have to debug the two threads parellely, but how can i ? help me. I am a fish swimming in the sea of c++.
-
I have two threads one used to send data to COM1 buffer, the other used to monitor COM1 events. I want to know whether the corresponding event is received when I send a byte in the first thread. so I have to debug the two threads parellely, but how can i ? help me. I am a fish swimming in the sea of c++.
Hi, set a breakpoint in the appropriate WaitCommEvent() event type result evaluation. This is usually switch( EvtMask) where you determine the type of event. Run the debuggee. When the debugger breaks on the specified event type, simply suspend the other threads. "Debug" -> "Threads" ... "suspend" all by looking at "location" where the functions are listed that each thread executed (before break). By doing this you save yourself from hassle that is when single stepping thru one thread you end up in another thread and so on (of course its multithreaded). Hope this helps. A. Focht.
-
Hi, set a breakpoint in the appropriate WaitCommEvent() event type result evaluation. This is usually switch( EvtMask) where you determine the type of event. Run the debuggee. When the debugger breaks on the specified event type, simply suspend the other threads. "Debug" -> "Threads" ... "suspend" all by looking at "location" where the functions are listed that each thread executed (before break). By doing this you save yourself from hassle that is when single stepping thru one thread you end up in another thread and so on (of course its multithreaded). Hope this helps. A. Focht.
Nice answer
-
Hi, set a breakpoint in the appropriate WaitCommEvent() event type result evaluation. This is usually switch( EvtMask) where you determine the type of event. Run the debuggee. When the debugger breaks on the specified event type, simply suspend the other threads. "Debug" -> "Threads" ... "suspend" all by looking at "location" where the functions are listed that each thread executed (before break). By doing this you save yourself from hassle that is when single stepping thru one thread you end up in another thread and so on (of course its multithreaded). Hope this helps. A. Focht.