From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29126 invoked by alias); 19 Jul 2006 17:53:01 -0000 Received: (qmail 29109 invoked by uid 22791); 19 Jul 2006 17:53:01 -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, 19 Jul 2006 17:52:54 +0000 Received: from drow by nevyn.them.org with local (Exim 4.54) id 1G3GE4-0006j8-8Q; Wed, 19 Jul 2006 13:52:48 -0400 Date: Thu, 20 Jul 2006 15:21:00 -0000 From: Daniel Jacobowitz To: Paul Koning Cc: kernel-hacker@bennee.com, gdb@sources.redhat.com Subject: Re: Gcc options for improving debugging? Message-ID: <20060719175248.GA25814@nevyn.them.org> Mail-Followup-To: Paul Koning , kernel-hacker@bennee.com, gdb@sources.redhat.com References: <1153308778.9831.49.camel@okra.transitives.com> <20060719130547.GA18159@nevyn.them.org> <1153330383.9831.82.camel@okra.transitives.com> <17598.28866.916402.335524@gargle.gargle.HOWL> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <17598.28866.916402.335524@gargle.gargle.HOWL> User-Agent: Mutt/1.5.11+cvs20060403 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-07/txt/msg00140.txt.bz2 On Wed, Jul 19, 2006 at 01:49:54PM -0400, Paul Koning wrote: > >>>>> "Alex" == Alex Bennee writes: > > Alex> Is it the inlineing that's causing the variables to get > Alex> optimised away??? > > No. GCC can make variables go away without any inlining. And even if > a variable isn't optimized away completely, it can become "dead" at > some point (when it is not needed in the rest of the function). When > that happens, the register gets reused but GDB doesn't necessarily > know that. So you can still see the variable but the values it > appears to have are wrong because that register now contains something > else. In addition to what Paul said: Alex, you may want to try upgrading to GDB 6.5. Previous versions had a much more annoying behavior when this happened, but 6.5 is better about it; from your initial report I guess you're using something earlier. -- Daniel Jacobowitz CodeSourcery