From owner-freebsd-questions Wed Sep 16 05:49:07 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id FAA05116 for freebsd-questions-outgoing; Wed, 16 Sep 1998 05:49:07 -0700 (PDT) (envelope-from owner-freebsd-questions@FreeBSD.ORG) Received: from qosnetics.com (qosnetics.com [209.137.14.2]) by hub.freebsd.org (8.8.8/8.8.8) with SMTP id FAA05061 for ; Wed, 16 Sep 1998 05:48:48 -0700 (PDT) (envelope-from msaal@qosnet.com) Received: (qmail 6528 invoked from network); 16 Sep 1998 13:02:31 -0000 Received: from bertha.portsmouth (HELO qosnet.com) (192.32.47.90) by lucy.portsmouth with SMTP; 16 Sep 1998 13:02:31 -0000 Message-ID: <35FFB5B1.B12BB3DF@qosnet.com> Date: Wed, 16 Sep 1998 08:57:21 -0400 From: Michael Saal X-Mailer: Mozilla 4.5b2 [en] (WinNT; I) X-Accept-Language: en MIME-Version: 1.0 To: Doug White CC: freebsd-questions@FreeBSD.ORG Subject: Re: can't debug pthreads with gdb References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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