|
Home > Archive > Unix Programming > February 2006 > How to debug threads
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
How to debug threads
|
|
| Sunil Varma 2006-02-17, 10:40 pm |
| 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.
| |
| Andrei Voropaev 2006-02-17, 10:40 pm |
| 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
| |
| Sunil Varma 2006-02-17, 10:40 pm |
|
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.
|
|
|
|
|