Click to See Complete Forum and Search --> : Switching of threads


miteshpandey
December 1st, 2004, 12:05 PM
I am debugging a multithreaded application and I am setting break points throught the program.

I am tired of waiting for a particular thread(the thread which interests me) to get the control of the program showing the yellow tick mark along the break point. Is there a mechanism while debugging so that I can switch among the threads.

Please Help
Mitesh.

kirants
December 1st, 2004, 02:16 PM
As far as my knowledge goes, all threads , so in effect the debuggee process , are suspended when the process hits a breakpoint.

But, I am still not sure what you are trying to do..

miteshpandey
December 2nd, 2004, 10:54 AM
What I really meant to say is that I have at least three threads in the program. All the three threads are derived from the base class. The base class has a start function which actually creates the thread. The thread function in the base class then calls the virtual function Run.

the objects are created in the main function. The thread that executes the main function I believe is the primary thread. I have set two break point say one is just at the entry of the main function and the other is at the entry of the run function of the particular thread object.

Now when I start the application the control stops at the break point set at the entry of the main function. And now I do a step by step execution (i.e. line by line). The thread objects are created and the secondary threads start(via start function). Now I want the break point set in the virtual function Run to get stopped at. But for this to happen I have to wait and wait and do step by step execution of the main thread. When the main thread blocks or some thing else happens then only the break point at the Run function is reached. With two or three thread it doesn't matter a lot but with many threads in the program I have to wait a lot.

I hope you know what I mean. I wonder if others have not experienced this.

Mitesh.

miteshpandey
December 2nd, 2004, 11:19 AM
Sorry my mistake. The problem's solved. I should not have been using step by step execution and wait for the break point in the other thread to get activated. I should have used the play button on the debugger toolbar.