I haven't compiled my program using those options, but whenever I have pthreads
running in the program, gdb either hangs or stops on strange system messages
when something happens with the threads. When I compile the programs so that
everything runs in a single thread, gdb has no complaints, even though the same
stuff that was done in the pthreads is now being done in the main execution
loop. I'm sorry I couldn't be more specific about the errors gdb spits out, I
haven't been to work for a while to mess with it. As for gdb working with
pthreads, I'm just gonna say that gdb and pthreads are mortal enemies and any
program should either use one or the other. If someone could get a pthread-ed
program working with gdb, I would be glad to hear about it.
Kevin
> Hi,
> I am having trouble debugging my pthread-based program in GDB as well. But
> everywhere I looked it seems that GDB 5 is supposed to be LinuxThread-aware
> but whenever I do 'info threads' I get no response.
> I compiled with -ggdb -DREENTRANT
> So am I doing something wrong or is this what you mean, Kevin, by "it chokes
> on the thread library you use," that they don't work with each other?
> Ming Kao
> > > Is there a good de* for an X app that uses opengl through IRIS
> > > Performer and is also multi-threaded. GDB seems to *on the thread
> > > library I use (pthread), and also complains a lot because the program
> > > uses dynamic linking. I would like something similar to Visual Studio
> > > 6.0 on windows, something that can do breakpoints, stack traces, and
> > > print outs of certain variables. Every de* I've run across seems
> > > to use gdb, and gdb just doesn't like my program. I'm using Mandrake
> > > 7.1.
> > > If anyone can point me to a good de* (gdb based or otherwise, I can
> > > always take out the threads for debugging), I would appreciate it very
> > > much.
> > > Thanks,
> > > Kevin
> > Give our product TotalView a go. It supports dynamically loaded libraries
> > and threads. We verify on Red Hat, but it should all work on Mandrake.
> > It's a commercial product, so if you want to continue to use it you'll
> > need to buy a license, but you can download the full product and get a
> demo
> > license from our WWW site below so you get to try it first.
> > It is completely unrelated to gdb...
> > -- Jim
> > Etnus, LLC. +44 117 9071438
> > http://www.veryComputer.com/