From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9668 invoked by alias); 4 Nov 2009 16:34:59 -0000 Received: (qmail 9657 invoked by uid 22791); 4 Nov 2009 16:34:58 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=BAYES_00,SPF_FAIL X-Spam-Check-By: sourceware.org Received: from mx20.gnu.org (HELO mx20.gnu.org) (199.232.41.8) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 04 Nov 2009 16:34:53 +0000 Received: from mail.codesourcery.com ([38.113.113.100]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1N5iot-0007MA-Cs for gcc@gcc.gnu.org; Wed, 04 Nov 2009 11:34:51 -0500 Received: (qmail 21867 invoked from network); 4 Nov 2009 16:34:48 -0000 Received: from unknown (HELO localhost) (froydnj@127.0.0.2) by mail.codesourcery.com with ESMTPA; 4 Nov 2009 16:34:48 -0000 Date: Wed, 04 Nov 2009 16:34:00 -0000 From: Nathan Froyd To: Jean Christophe Beyler Cc: Ian Lance Taylor , gcc@gcc.gnu.org Subject: Re: Preserving the argument spills for GDB Message-ID: <20091104163448.GD22753@codesourcery.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.13 (2006-08-11) X-detected-operating-system: by mx20.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-IsSubscribed: yes Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org X-SW-Source: 2009-11/txt/msg00074.txt.bz2 On Wed, Nov 04, 2009 at 11:24:34AM -0500, Jean Christophe Beyler wrote: > However, I've been going through the first step : running GDB, setting > a break-point and doing a continue to see what I get and try to get > the information right for O3 too. > > In O0, I get: > Breakpoint @@ 1, foo (a=4, b=3, c=2, d=1) at hello.c:10 > > In O3, I get: > Breakpoint @@ 1, foo (a=Variable "a" is not available.) at hello.c:11 > > It seems that, in the O0 case, the Dwarf information is automatically > propagated to say "The input register is now here", but when I do it > in O3, I'm issuing the information in the same way. > > What am I exactly missing? Any ideas why GDB would not have enough > information in this case? You should look at the DWARF information (readelf -wi) and see if the function parameters have DW_AT_location attributes. If they don't, then you need to ensure that they get generated. If they do, then perhaps they are wrong or GDB is not interpreting them correctly. (They get generated with optimization and interpreted correctly on other platforms that pass args in registers.) -Nathan