From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25674 invoked by alias); 15 Nov 2006 16:50:10 -0000 Received: (qmail 25627 invoked by uid 22791); 15 Nov 2006 16:50:05 -0000 X-Spam-Check-By: sourceware.org Received: from nevyn.them.org (HELO nevyn.them.org) (66.93.172.17) by sourceware.org (qpsmtpd/0.31.1) with ESMTP; Wed, 15 Nov 2006 16:49:59 +0000 Received: from drow by nevyn.them.org with local (Exim 4.54) id 1GkNxR-00085i-UA; Wed, 15 Nov 2006 11:49:54 -0500 Date: Wed, 15 Nov 2006 16:50:00 -0000 From: Daniel Jacobowitz To: jbbachky@aim.com Cc: gdb@sources.redhat.com Subject: Re: gdbserver/gdb-6/4 and lots of pthreads Message-ID: <20061115164953.GA31009@nevyn.them.org> Mail-Followup-To: jbbachky@aim.com, gdb@sources.redhat.com References: <8C8D6E7E15FE5F6-5D0-723B@mblk-d22.sysops.aol.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <8C8D6E7E15FE5F6-5D0-723B@mblk-d22.sysops.aol.com> User-Agent: Mutt/1.5.13 (2006-08-11) X-IsSubscribed: yes 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/msg00102.txt.bz2 On Wed, Nov 15, 2006 at 11:11:45AM -0500, jbbachky@aim.com wrote: > 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. Normally this is a feature :-) > 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. It'll be the 10ms SIGALRM. Fortunately, I have _just_ the thing for you. If you can wait another day or two, I expect to commit a patch which dramatically improves gdbserver performance for multithreaded applications with signals ignored by GDB. You can find the patch on the gdb-patches list archives if you want to try it in the mean time; it should apply to a checkout of current CVS HEAD. You need a patched gdbserver and gdb client. -- Daniel Jacobowitz CodeSourcery