From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15987 invoked by alias); 30 Nov 2010 09:26:31 -0000 Received: (qmail 15970 invoked by uid 22791); 30 Nov 2010 09:26:29 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,TW_KG X-Spam-Check-By: sourceware.org Received: from mail-vw0-f41.google.com (HELO mail-vw0-f41.google.com) (209.85.212.41) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 30 Nov 2010 09:26:22 +0000 Received: by vws10 with SMTP id 10so2082112vws.0 for ; Tue, 30 Nov 2010 01:26:20 -0800 (PST) Received: by 10.220.180.69 with SMTP id bt5mr1316742vcb.133.1291109179039; Tue, 30 Nov 2010 01:26:19 -0800 (PST) Received: from cr0.nay.redhat.com ([60.247.97.98]) by mx.google.com with ESMTPS id b28sm942255vcm.30.2010.11.30.01.26.14 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 30 Nov 2010 01:26:17 -0800 (PST) Date: Tue, 30 Nov 2010 09:26:00 -0000 From: =?utf-8?Q?Am=C3=A9rico?= Wang To: Mark Wielaard Cc: Andi Kleen , Hui Zhu , linux-kernel@vger.kernel.org, gdb@sourceware.org, hellogcc@freelists.org Subject: Re: [PATCH] Built kernel without -O2 option Message-ID: <20101130093106.GD5203@cr0.nay.redhat.com> References: <87r5e4lab7.fsf@basil.nowhere.org> <1291025536.2904.6.camel@springer.wildebeest.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1291025536.2904.6.camel@springer.wildebeest.org> User-Agent: Mutt/1.5.20 (2009-06-14) 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: 2010-11/txt/msg00133.txt.bz2 On Mon, Nov 29, 2010 at 11:12:16AM +0100, Mark Wielaard wrote: >On Mon, 2010-11-29 at 10:59 +0100, Andi Kleen wrote: >> Hui Zhu writes: >> >> > Now, there are a lot of ways to debug the Linux kernel with GDB, like >> > qemu, kgtp or kgdb and so on. >> > But the developer more like add a printk. It have a lot of reason, a big one is: >> > (gdb) p ret >> > $3 = >> > And the code execution order is not right. >> >> Really the right place to fix a lot of this would be gcc (and perhaps >> gdb). I suspect with some careful work the debugging experience >> for -O2 could be improved a lot. >> I also believe the latest gccs already have improvements in this area. > >The VTA branch was merged for GCC 4.5 >http://gcc.gnu.org/wiki/Var_Tracking_Assignments >Which helps a lot with generating dwarf for previously "optimized out" >values. There were also a couple of papers on generating even better >debuginfo at the recent GCC Summit: http://gcc.gnu.org/wiki/summit2010 > >Jakub Jelínek, Improving debug info for optimized away parameters >http://gcc.gnu.org/wiki/summit2010?action=AttachFile&do=get&target=jelinek.pdf >Alexandre Oliva, Consistent Views at Recommended Breakpoints >http://gcc.gnu.org/wiki/summit2010?action=AttachFile&do=get&target=oliva.pdf > Cool! It would be much more convenient if this is solved by gcc.