Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 16 Sep 1998 08:57:21 -0400
From:      Michael Saal <msaal@qosnet.com>
To:        Doug White <dwhite@resnet.uoregon.edu>
Cc:        freebsd-questions@FreeBSD.ORG
Subject:   Re: can't debug pthreads with gdb
Message-ID:  <35FFB5B1.B12BB3DF@qosnet.com>
References:  <Pine.BSF.4.03.9809151705310.19769-100000@resnet.uoregon.edu>

next in thread | previous in thread | raw e-mail | index | archive | help


Doug White wrote:

> On Tue, 15 Sep 1998, Michael Saal wrote:
>
> > I am having a lot of trouble trying to debug a multi threaded app in
> > gdb.
> >
> > I am compiling with -D_THREAD_SAFE , linking with libc_r and used
> > FreeBSD versions 2.2.6 and 2.2.7
> >
> > If I run my app without gdb or don't set any breakpoints in gdb 'top'
> > says that my apps process uses virtually no CPU cycles.
>
> gdb makes assumptions that you're debugging a standard linear program, not
> a multithreaded one.  Debugging multithreaded programs is a pain in the
> tail.
>
> I'd suggest profuse amounts of scaffolding (printf()s).
>
> Doug White                              | University of Oregon
> Internet:  dwhite@resnet.uoregon.edu    | Residence Networking Assistant
> http://gladstone.uoregon.edu/~dwhite    | Computer Science Major

printf()s are not required, I downloaded and built pmpthreads-1.8.8,
http://www.humanfactor.com/pthreads, and was then able to debug my code with
gdb.

I strongly suspect that the FreeBSD pthread implimentation  has a bug with way
it handles signals, i.e SIGTRAP, that make its threads impossible to debug
with gdb.

Mike


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?35FFB5B1.B12BB3DF>