From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10943 invoked by alias); 3 Jul 2002 13:42:07 -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 10926 invoked from network); 3 Jul 2002 13:42:04 -0000 Received: from unknown (HELO hub.ott.qnx.com) (209.226.137.76) by sources.redhat.com with SMTP; 3 Jul 2002 13:42:04 -0000 Received: from smtp.ott.qnx.com (smtp.ott.qnx.com [10.0.2.158]) by hub.ott.qnx.com (8.9.3/8.9.3) with ESMTP id IAA27601; Wed, 3 Jul 2002 08:43:56 -0400 Received: from catdog (dhcpa182 [10.12.1.182]) by smtp.ott.qnx.com (8.8.8/8.6.12) with SMTP id JAA07141; Wed, 3 Jul 2002 09:34:49 -0400 Message-ID: <018301c22297$45175bc0$b6010c0a@catdog> From: "Kris Warkentin" To: "Eli Zaretskii" , "Bernd Jendrissek" Cc: References: Subject: Re: Who's insane: gdb or I? Date: Wed, 03 Jul 2002 06:42:00 -0000 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 X-SW-Source: 2002-07/txt/msg00030.txt.bz2 > On Wed, 3 Jul 2002, Bernd Jendrissek wrote: > > > Why did gdb tell me that the "OVERtime+=..." part happened several times > > over? > > Because compiler optimizations move code around, so that the machine > instructions generated for those two lines are interleaved. > > Simply get used to this. I usually wait until the line shjown by GDB is > after the one I'm interested in, and then print the relevant variables. I get this all the time too so I usually debug code compiled without optimization. Unfortunately if you're chasing an optimization bug all bets are off and, like Bernd said, you just have to get used to it. cheers, Kris