[oclug] debugging using ddd
Greg Sarsons
gsarsons at home.com
Fri Feb 2 19:23:21 EST 2001
Bart,
You need to clarify here. Are you saying I should be putting the main
to sleep or something??? What I've tried: first I tried creating two
threads ... they do a couple of things and return. Then I thought I
should try calling join after to see if this would be different. No
luck. Main itself returns for the time being since it doesn't do
anything other then creates the threads. On thread sends continuously on
a multicast address and another listens on the broadcast address and
then will create another thread if something is heard. This just keeps
going on until the program is killed.
All I would like to do is put a nice breakpoint in the threads function
to check a couple of things out. Sounds simple doesn't it. Well I
could just cheat, cut the code out, paste it in main and watch it there.
Greg
Bart Trojanowski wrote:
>
> One more thing... in your main thread while the others run are you calling
> sleep? Don't use join.
>
> On Fri, 2 Feb 2001, Bart Trojanowski wrote:
>
> >
> > Greg, you are not doing anything wrong. I just found out that there is a
> > small inconsistency in how break/continue is done in gdb 5 with the new
> > kernels. When I did thread debugging I was using gdb 4.x and linux 2.2.x.
> >
> > I figure you are running gdb 5.x and linux 2.4.x, right?
> >
> > So try to see what the gdb people are saying about this. Keep us posted.
> >
> > Bart.
> >
> > On Fri, 2 Feb 2001, Greg Sarsons wrote:
> >
> > > main creates
> > >
> > > prthread_create(&broadcast_thread,NULL,broadcast_function,NULL)) .... :)
> > >
> > > I see in the gdb consol window comments about pthread_setconcurrency()
> > > etc
> > >
> > > If set a breakpoint in the main I can even go up to either of the thread
> > > functions and get the values of the variables ie I can get socket file
> > > descriptors etc which are set in the functions.
> > >
> > > Greg
> > >
> > > Bart Trojanowski wrote:
> > > >
> > > > OK, another dumb question... you are doing pthread_create and not fork
> > > > right?
> > > >
> > > > Bart.
> > > >
> > > > On Thu, 1 Feb 2001, Greg Sarsons wrote:
> > > >
> > > > > Well for the number of dumb things I've done -ggdb was a fair question
> > > > > but I had that flag. As for the single thread, ie the main I can debug
> > > > > that. I can run the program in a terminal and can see my thread is
> > > > > working ok but using ddd I can't seem to figure it out.
> > > > >
> > > > > Noticed the thread option window but I only see one thread, the main.
> > > > >
> > > > > Greg
> > > > >
> > > > > Bart Trojanowski wrote:
> > > > > >
> > > > > > Hey Greg, how is life?
> > > > > >
> > > > > > Well, I am sure that ddd can debug [p]threaded apps. Just a dumb
> > > > > > question, did you use -ggdb in your CFLAGS?
> > > > > >
> > > > > > Can you successfuly debug a single thread?
> > > > > >
> > > > > > Bart.
> > > > > >
> > > > > > On Thu, 1 Feb 2001, Greg Sarsons wrote:
> > > > > >
> > > > > > > I'm writing a threaded program that creates sockets but I haven't
> > > > > > > succeeded in being able to use ddd to debug it. I can set break points
> > > > > > > but ddd just seems to ignore them.
> > > > > > >
> > > > > > > Awaiting words of wisdom from the list .....
> > > > > > >
> > > > > > > Greg
--
It said use Windows 98 or better so I installed Linux.
More information about the OCLUG
mailing list