[76] in Pthreads mailing list archive

home help back first fref pref prev next nref lref last post

Re: debugging pthreads applications

daemon@ATHENA.MIT.EDU (sudhir halbhavi)
Tue Aug 15 15:13:09 1995

Date: Tue, 15 Aug 1995 12:39:10 -0500 (CDT)
From: sudhir halbhavi <halbhavi@tisl.ukans.edu>
To: Umesh Soni <U.Soni@cs.ucl.ac.uk>
Cc: pthreads@MIT.EDU
In-Reply-To: <9508151558.AA28390@MIT.EDU>



GDB has support only for Lynx, Convex and Mach threads. It can only
list threads and switch threads. It is not aware of user level threads
(like pthreads). "info threads" and other thread commands are simply 
ignored for any other platform.

If you try to debug a pthreads program,	a breakpoint is hit by any thread 
that encounters it and a backtrace will only show the backtrace of the 
running thread. But, you could enumerate the linked_lists if you knew the 
data structures of pthreads (and pthreads was compiled with -g option). One 
tool for data enumeration is DUEL (available from princeton), which sits 
atop gdb and helps in data structure enumeration. You could look at the
threads in the different queues, their states etc, much more easily.
	
	We are building a interface to gdb that will incorporate features
for debugging and data structure display of such applications.

	I am implementing user level thread debugging (pthreads)
features in gdb, as part of the debugger project here. I have the thread
specific breakpoints, backtrace and some kind of user specified
context switching working, but still have to iron out some details (bugs)
and add more features before we can officially release it, which may take
a few weeks at the least :-)

Hope that helps

Sudhir Halbhavi
halbhavi@eecs.ukans.edu

On Tue, 15 Aug 1995, Umesh Soni wrote:

> I am using the pthreads library and am having some problems
> debugging my programs.
> 
> I was wondering if someone could advise me on the best debugging
> tools and techniques to use. I am currently compiling with gcc and 
> rely on gdb for debugging -the problem is that gdb does not seem to
> be aware of any new threads that I create (when using the 'info threads'
> command.
> 
> Umesh.
> 


home help back first fref pref prev next nref lref last post