From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20514 invoked by alias); 17 Mar 2005 22:07:13 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 20121 invoked from network); 17 Mar 2005 22:07:05 -0000 Received: from unknown (HELO kymasys.com) (66.160.167.99) by sourceware.org with SMTP; 17 Mar 2005 22:07:05 -0000 Received: from horse.he.net ([127.0.0.9]) by kymasys.com for ; Thu, 17 Mar 2005 14:06:57 -0800 Message-Id: <1111097217.25342@horse.he.net> Date: Thu, 17 Mar 2005 22:07:00 -0000 From: "Ajay Patel" To: gdb@sources.redhat.com Subject: unable to debug statically linked program with linux threads X-IPAddress: 128.107.253.38 MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 X-SW-Source: 2005-03/txt/msg00174.txt.bz2 Hi, I have a FC3 based i686 machine with gdb version 6.1. I got a simple threaded program from one BSD. (program attached) With dynamic linking (linux threads), I can run the program under gdb without a problem. All thread related commands seems to work properly. With static linking, when I run this program under gdb, first I get "Program received signal SIG32/SIG33 Real-time event 32/32". I avoid this problem by "handle SIG32/SIG33 pass nostop noprint". However none of the thread related command works. Any suggestion? Thanks Ajay /**************************************************************************** * * Simple diff mode test. * * $FreeBSD: src/lib/libpthread/test/hello_d.c,v 1.1 2000/04/24 21:07:37 jasone Exp $ * ****************************************************************************/ #include #include #include void * entry1(void * a_arg) { fprintf(stderr, "Hello world1\n"); sleep(100); } void * entry2(void * a_arg) { fprintf(stderr, "Hello world2\n"); sleep(100); } int main() { pthread_t thread1, thread2; int error; error = pthread_create(&thread1, NULL, entry1, NULL); if (error) fprintf(stderr, "Error in pthread_create(): %s\n", strerror(error)); error = pthread_create(&thread2, NULL, entry2, NULL); if (error) fprintf(stderr, "Error in pthread_create(): %s\n", strerror(error)); error = pthread_join(thread1, NULL); if (error) fprintf(stderr, "Error in pthread_join(): %s\n", strerror(error)); error = pthread_join(thread2, NULL); if (error) fprintf(stderr, "Error in pthread_join(): %s\n", strerror(error)); return 0; }