From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8152 invoked by alias); 3 Nov 2009 18:09:10 -0000 Received: (qmail 8141 invoked by uid 22791); 3 Nov 2009 18:09:09 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00,SARE_MSGID_LONG40,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mail-vw0-f182.google.com (HELO mail-vw0-f182.google.com) (209.85.212.182) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 03 Nov 2009 18:09:05 +0000 Received: by vws12 with SMTP id 12so1834707vws.12 for ; Tue, 03 Nov 2009 10:09:04 -0800 (PST) MIME-Version: 1.0 Received: by 10.220.122.144 with SMTP id l16mr330603vcr.78.1257271744131; Tue, 03 Nov 2009 10:09:04 -0800 (PST) In-Reply-To: <20091103180127.GA7855@caradoc.them.org> References: <4AEF6834.1080208@caviumnetworks.com> <8ac60eac0911030938y2fba14a3na8446d61c7d497f5@mail.gmail.com> <20091103180127.GA7855@caradoc.them.org> Date: Tue, 03 Nov 2009 18:09:00 -0000 Message-ID: Subject: Re: GDB interactions with GCC From: Jean Christophe Beyler To: Jean Christophe Beyler , Paul Pluzhnikov , David Daney , gdb@sourceware.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2009-11/txt/msg00028.txt.bz2 That is what I noticed as well. So you have confirmed that if we want to retain that information, it needs to be stored on the stack even if the optimization levels are used. Thanks, Jc On Tue, Nov 3, 2009 at 1:01 PM, Daniel Jacobowitz wrote: > On Tue, Nov 03, 2009 at 12:54:54PM -0500, Jean Christophe Beyler wrote: >> On my architecture, I can have the code for foo reduced to : >> >> add FirstInputRegister, FirstInputRegister, 1 >> call bar >> branch return. >> >> Therefore, once I'm in bar, the input register that foo had has been >> lost since it's been incremented. The original value of a has been >> lost since it is not in a particular register, was not spilled. >> >> In this case, how does GDB handle it ? > > GDB will report that the value is not available. =A0If you compile > without optimization, GCC will generally save it in a stack slot, and > the value will be available. > > -- > Daniel Jacobowitz > CodeSourcery >