How to debug threads
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Unix and Linux reviews > Free Unix support > Unix Programming > How to debug threads




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    How to debug threads  
Sunil Varma


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
02-18-06 03:40 AM

Hello all,

i'm trying to debug a program using gdb.
i use threads in the application.
Right now i'm putting a breakpoint in that function whose address is
passed to thread as the argument.
But by the time i finish working with the thread i find the calling
function had finished it's work.
How can i make the calling fucntion wait till the thread finishes its
execution.
Here i'm using detachable threads so i dont pthread_join() them in the
calling function.

Please solve my problem.

Thanks in Advance.






[ Post a follow-up to this message ]



    Re: How to debug threads  
Andrei Voropaev


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
02-18-06 03:40 AM

On 2006-02-17, Sunil Varma <sunil.s51@gmail.com> wrote:
> i'm trying to debug a program using gdb.
> i use threads in the application.
[...]
> How can i make the calling fucntion wait till the thread finishes its
> execution.
> Here i'm using detachable threads so i dont pthread_join() them in the
> calling function.


Read info gdb. Section Stopping, then Thread Stops. The 'set
scheduler-locking MODE' should be interesting for you.

Generally read also section Running, then Threads.


--
Minds, like parachutes, function best when open





[ Post a follow-up to this message ]



    Re: How to debug threads  
Sunil Varma


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
02-18-06 03:40 AM


Andrei Voropaev wrote:
> On 2006-02-17, Sunil Varma <sunil.s51@gmail.com> wrote: 
> [...] 
>
>
> Read info gdb. Section Stopping, then Thread Stops. The 'set
> scheduler-locking MODE' should be interesting for you.
>
> Generally read also section Running, then Threads.
>
>
> --
> Minds, like parachutes, function best when open

Thanks Andrei,
i'll go thru.






[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 04:00 AM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register