Review your favorite Linux distribution.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 05-10-2004, 10:20 PM   #1
LQ Newbie
Registered: Sep 2003
Posts: 7

Rep: Reputation: 0
how to debug multithread using GDB?

here is a program having two threads.when debugging ,i want to scanf the other thread .which commond should i use?
Old 05-11-2004, 12:58 AM   #2
Registered: Jul 2003
Location: bangalore . india
Distribution: openSUSE 10.3
Posts: 251

Rep: Reputation: 33
you can use the command "inf thr", to see the threads running in the process, along with their LWP ids,

to switch from one thread to another, by using the command
thr <thread id>

but i dont think gdb is really that great for multi thread debugging...

there is a debugger called totalview by etnus (not a free ware.but you can download a demo copy at


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
how can I debug the interactinve program with GDB bigapple Programming 1 08-03-2005 09:55 PM
How to use gdb to debug child process? ariana Programming 2 05-03-2005 01:50 PM
GDB unable to debug pthreads linuxdeveloper Programming 1 03-06-2005 05:18 AM
joining in a multithread app killkolor Programming 4 02-09-2005 03:05 PM
Using gdb to debug different arhitectures george_mercury Linux - Software 1 01-07-2005 06:19 PM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 12:26 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration