From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22760 invoked by alias); 24 Apr 2003 14:52:10 -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 22750 invoked from network); 24 Apr 2003 14:52:10 -0000 Received: from unknown (HELO crack.them.org) (65.125.64.184) by sources.redhat.com with SMTP; 24 Apr 2003 14:52:10 -0000 Received: from nevyn.them.org ([66.93.61.169] ident=mail) by crack.them.org with asmtp (Exim 3.12 #1 (Debian)) id 198i5B-0000NF-00; Thu, 24 Apr 2003 09:52:17 -0500 Received: from drow by nevyn.them.org with local (Exim 3.36 #1 (Debian)) id 198i4u-0003l6-00; Thu, 24 Apr 2003 10:52:00 -0400 Date: Thu, 24 Apr 2003 14:52:00 -0000 From: Daniel Jacobowitz To: Eric Brunel Cc: gdb@sources.redhat.com Subject: Re: Variable read time * 3+ between program compiled w/ gcc 2.95 and w/ gcc 3.2 on Solaris Message-ID: <20030424145200.GB14226@nevyn.them.org> Mail-Followup-To: Eric Brunel , gdb@sources.redhat.com References: <03042416451601.01259@eb.pragmadev> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <03042416451601.01259@eb.pragmadev> User-Agent: Mutt/1.5.1i X-SW-Source: 2003-04/txt/msg00293.txt.bz2 On Thu, Apr 24, 2003 at 04:45:16PM +0200, Eric Brunel wrote: > Hi all, > > I don't know if the following problem belongs here or in the gcc > newsgroup: we've noticed a drastic loss of performance when reading > program variables from gdb between the versions 2.95.3 and 3.2.2 of > gcc on Solaris 2.7. Here is a short example showing the problem: > > --foo.cpp--------------- > int x; > > int main(int argc, char *argv[]) > { > x = 12; > return 0; > } > ------------------------ > > I then compile this program using g++ 2.95.3 and 3.2.2 into the > binaries foo2 and foo3 resp. Then I run: > > gdb -batch -x gdb.cmds fooN > > with the following commands file: > > --gdb.cmds-------------- > break foo.cpp:6 > run > print x > print x > ... (200 times) > print x > quit > ------------------------- > > Here are typical results: > > $ time gdb -batch -x gdb.cmds foo2 > /dev/null > > real 0m0.564s > user 0m0.150s > sys 0m0.110s > > $ time gdb -batch -x gdb.cmds foo3 > /dev/null > > real 0m1.726s > user 0m1.340s > sys 0m0.260s > > The reading time has been increased by a factor 3+. This is even worse > if the variable is a structure and if I access fields in it. With a > chained list read via x->next->next->next..., we got times around > .5/.75 seconds with g++ 2.95, and more than 30 seconds (!) with g++ > 3.2 > > We tested versions 5.2 and 5.3 of gdb and got similar results. > > Is this a bug? Is it known? Is there a workaround or a patch? Thanks a > lot in advance. Probably a bug; not known. I don't know why this would happen, especially for such a simple program; if you can get an ida of where gdb is spending its time that would be interesting. A decent profiling tool should be able to do the job. -- Daniel Jacobowitz MontaVista Software Debian GNU/Linux Developer