From owner-freebsd-questions Thu Sep 10 10:06:21 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id KAA06001 for freebsd-questions-outgoing; Thu, 10 Sep 1998 10:06:21 -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 KAA05990 for ; Thu, 10 Sep 1998 10:06:14 -0700 (PDT) (envelope-from msaal@qosnet.com) Received: (qmail 4706 invoked from network); 10 Sep 1998 17:18:56 -0000 Received: from greatbay.portsmouth (HELO qosnet.com) (192.32.47.110) by lucy.portsmouth with SMTP; 10 Sep 1998 17:18:56 -0000 Message-ID: <35F80904.589E6FF0@qosnet.com> Date: Thu, 10 Sep 1998 13:14:44 -0400 From: Michael Saal X-Mailer: Mozilla 4.05 [en] (X11; I; FreeBSD 2.2.6-RELEASE i386) MIME-Version: 1.0 To: freebsd-questions@FreeBSD.ORG Subject: How do you debugg pthreads with gdb? Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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. I can step and break in code that is in my primary or main() thread. When I set a breakpoint in a thread created with pthread_create() and the breakpoint is hit top shows my apps process consuming all of the CPU cycles. gdb never breaks and the only way to regain control is to kill my apps process. Any help on how to solve this debugging problem would greatly be appreciated Mike Saal To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message