From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18456 invoked by alias); 4 Sep 2008 15:55:57 -0000 Received: (qmail 18445 invoked by uid 22791); 4 Sep 2008 15:55:56 -0000 X-Spam-Check-By: sourceware.org Received: from mtaout2.012.net.il (HELO mtaout2.012.net.il) (84.95.2.4) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 04 Sep 2008 15:55:17 +0000 Received: from HOME-C4E4A596F7 ([84.229.211.50]) by i_mtaout2.012.net.il (HyperSendmail v2004.12) with ESMTPA id <0K6O002KQHL7RAT1@i_mtaout2.012.net.il> for gdb@sourceware.org; Thu, 04 Sep 2008 18:55:56 +0300 (IDT) Date: Thu, 04 Sep 2008 15:55:00 -0000 From: Eli Zaretskii Subject: Re: how to examine data with compiler optimization option set? In-reply-to: X-012-Sender: halo1@inter.net.il To: Andreas Schwab Cc: dewar@adacore.com, fche@redhat.com, msnyder@vmware.com, brobecker@adacore.com, jreiver@free.fr, gdb@sourceware.org Reply-to: Eli Zaretskii Message-id: References: <1220390777.48bdaf79617dd@imp.free.fr> <48BDB1B0.4040703@adacore.com> <1220391632.48bdb2d04bfd7@imp.free.fr> <48BDB4E2.9010301@adacore.com> <20080902215623.GA3779@adacore.com> <48BDD4B7.5060503@vmware.com> <48BF04C6.8030108@adacore.com> X-IsSubscribed: yes 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: 2008-09/txt/msg00030.txt.bz2 > From: Andreas Schwab > Cc: Eli Zaretskii , > "Frank Ch. Eigler" , msnyder@vmware.com, > brobecker@adacore.com, jreiver@free.fr, gdb@sourceware.org > Date: Thu, 04 Sep 2008 10:00:45 +0200 > > If parameters are passed in registers they are very likely to get lost. Then the compiler should, under -ggdb, emit code and debug info that allow GDB finding these parameters somewhere. Failing that, there should be a compiler switch to disable this optimization, and that switch should be enabled by default when one uses -ggdb. In many real-life programs the net effect of this optimization is negligibly small, while the effect of not being able to see function arguments means the program either gets shipped less debugged or is built without optimizations and shipped that way. I know _I_ would happily give up this optimization if I could get back the lost ability of debugging reasonably well optimized code.