From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2651 invoked by alias); 15 Nov 2006 16:12:08 -0000 Received: (qmail 2634 invoked by uid 22791); 15 Nov 2006 16:12:03 -0000 X-Spam-Check-By: sourceware.org Received: from imo-d06.mx.aol.com (HELO imo-d06.mx.aol.com) (205.188.157.38) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 15 Nov 2006 16:11:52 +0000 Received: from Jbbachky@aim.com by imo-d06.mx.aol.com (mail_out_v38_r7.6.) id o.cc1.39b26c5 (57867) for ; Wed, 15 Nov 2006 11:11:45 -0500 (EST) Received: from mblk-d22 (mblk-d22.mblk.aol.com [205.188.149.14]) by air-ia01.mail.aol.com (v114.2) with ESMTP id MAILINIA11-e20b455b3c411a3; Wed, 15 Nov 2006 11:11:45 -0500 To: gdb@sources.redhat.com Content-Transfer-Encoding: 7bit Subject: gdbserver/gdb-6/4 and lots of pthreads Date: Wed, 15 Nov 2006 16:12:00 -0000 X-MB-Message-Source: WebUI MIME-Version: 1.0 From: jbbachky@aim.com X-MB-Message-Type: User Content-Type: text/plain; charset="us-ascii"; format=flowed X-Mailer: AIM WebMail 21462 Received: from 192.146.101.24 by mblk-d22.sysops.aol.com (205.188.149.14) with HTTP (WebMailUI); Wed, 15 Nov 2006 11:11:45 -0500 Message-Id: <8C8D6E7E15FE5F6-5D0-723B@mblk-d22.sysops.aol.com> X-AOL-IP: 205.188.149.14 Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2006-11/txt/msg00100.txt.bz2 Hi, I've got an application with about 40 pthreads running under linux 2.6.10 w/glibc-2.2.3, compiled with gcc-3.4.3 running on powerpc (and eventually a few other architectures). I've been a happy gdb-5.0 user for a number of years, with my linux kernel(s) performing the breakpoint removal/replacement on context switches. I've been hoping to remove that code and let gdb handle when and if to break based on process id. In attempting to upgrade to gdb-6.4, I'm afraid that I've run into a problem which might require some hacking. Gdbserver attaches to my main thread and opens a socket, and then after invoking gdb and specifying my remote target, I select the particular thread that I wish to debug. Info threads shows all of my threads, and I see that gdbserver now attaches to all of them. Any attempt to single-step or continue with a breakpoint results in a "thrashing system". A counter in my context switching code shows almost 150k switchs/second, up from about 1200/sec when not attached with gdb. One of the 40 pthreads handle a 10ms SIGALRM. Almost all of the others are waiting for messages. Is there a fundamental problem with the number of threads and attaching/detaching/waking them all? Do I need to continue to "hide" my other threads from gdb/gdbserver?. I am building with dynamic linking, and gdbserver finds and uses libthread_db.so. Thanks for any help or advice. ________________________________________________________________________ Check Out the new free AIM(R) Mail -- 2 GB of storage and industry-leading spam and email virus protection.