From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18756 invoked by alias); 19 Jul 2006 13:31:48 -0000 Received: (qmail 18747 invoked by uid 22791); 19 Jul 2006 13:31:48 -0000 X-Spam-Check-By: sourceware.org Received: from sadr.equallogic.com (HELO sadr.equallogic.com) (66.155.203.134) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 19 Jul 2006 13:31:42 +0000 Received: from sadr.equallogic.com (localhost.localdomain [127.0.0.1]) by sadr.equallogic.com (8.12.8/8.12.8) with ESMTP id k6JCVf3x005362 for ; Wed, 19 Jul 2006 08:31:41 -0400 Received: from M31.equallogic.com (M31.equallogic.com [172.16.1.31]) by sadr.equallogic.com (8.12.8/8.12.8) with SMTP id k6JCVf6B005357; Wed, 19 Jul 2006 08:31:41 -0400 Received: from pkoning.equallogic.com ([172.16.1.176]) by M31.equallogic.com with Microsoft SMTPSVC(6.0.3790.211); Wed, 19 Jul 2006 09:31:40 -0400 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <17598.13370.591727.673308@gargle.gargle.HOWL> Date: Wed, 19 Jul 2006 17:33:00 -0000 From: Paul Koning To: kernel-hacker@bennee.com Cc: gdb@sources.redhat.com Subject: Re: Gcc options for improving debugging? References: <1153308778.9831.49.camel@okra.transitives.com> X-Mailer: VM 7.17 under 21.5 (beta27) "fiddleheads" XEmacs Lucid 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/msg00137.txt.bz2 >>>>> "Alex" == Alex Bennee writes: Alex> Hi, By default we build our software with -O3 which brings in a Alex> host of optimisations which make following code in GDB a Alex> pain. Sure enough, exactly as documented. Alex> An alternate approach is to compile with -O3 but turn off Alex> specific optimisations which make life tricky for gdb. So far I Alex> have: Alex> * -ggdb3 (obviously) * -fno-omit-frame-pointer (seems to help Alex> with finding some variables) -ggdb3??? That's not an optimization option. I find that the simplest and best answer is to do most debugging using a version compiled with -O1. That gives you inline assembler, inlining of things that are specifically called out to be inlined, etc. But it doesn't do much instruction reordering. paul