From patchwork Thu Jul 30 16:09:47 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mason X-Patchwork-Id: 6903741 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 1F5319F38B for ; Thu, 30 Jul 2015 16:12:38 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3B81420591 for ; Thu, 30 Jul 2015 16:12:34 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4EA052058E for ; Thu, 30 Jul 2015 16:12:33 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZKqPV-0000rR-Ra; Thu, 30 Jul 2015 16:10:21 +0000 Received: from smtp2-g21.free.fr ([2a01:e0c:1:1599::11]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZKqPS-000830-Ar for linux-arm-kernel@lists.infradead.org; Thu, 30 Jul 2015 16:10:19 +0000 Received: from [172.27.0.114] (unknown [83.142.147.193]) (Authenticated sender: shill) by smtp2-g21.free.fr (Postfix) with ESMTPSA id 394F44B00C8; Thu, 30 Jul 2015 18:09:48 +0200 (CEST) Message-ID: <55BA4C4B.3070705@free.fr> Date: Thu, 30 Jul 2015 18:09:47 +0200 From: Mason User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:35.0) Gecko/20100101 Firefox/35.0 SeaMonkey/2.32.1 MIME-Version: 1.0 To: Robin Murphy , Linux ARM Subject: Re: arch/arm/kernel/setup.c does not compile at -O0 References: <55BA1E62.9080103@free.fr> <55BA2335.706@arm.com> <55BA2D9D.1070402@free.fr> In-Reply-To: <55BA2D9D.1070402@free.fr> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150730_091018_543172_B8B44EDC X-CRM114-Status: GOOD ( 10.36 ) X-Spam-Score: -2.6 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Rob Herring , Arnd Bergmann , Stefano Stabellini , Marc Zyngier , Nicolas Pitre , Will Deacon Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-5.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On 30/07/2015 15:58, Mason wrote: > But the problem seems to be on a higher level. My debugger > just doesn't see ANY local variable whatsoever. I found the magic setting! NB: I'm using gcc version 4.9.3 20141031 (prerelease) (Linaro GCC 2014.11) If I add either: KBUILD_CFLAGS += $(call cc-option, -gdwarf-2,) or KBUILD_CFLAGS += $(call cc-option, -gdwarf-3,) to my top-level Makefile, then DS-5 is able to display local variables. However, if I add: KBUILD_CFLAGS += $(call cc-option, -gdwarf-4,) or nothing at all, DS-5 just ignores local variables. It appears that "gcc -g" and "gcc -gdwarf-2 -g" generate different debugging information... What debugging format does "gcc -g" use? (Not DWARF, apparently.) I'll try setting KBUILD_CFLAGS += -gdwarf-2 instead of $(call cc-option, -gdwarf-2,) => Yes, that works too. Does anyone know the difference? So basically, I'm now using this patch locally: $ git diff Makefile Regards. diff --git a/Makefile b/Makefile index f9041e6d4d19..f79c480f8922 100644 --- a/Makefile +++ b/Makefile @@ -641,10 +641,8 @@ KBUILD_CFLAGS += -fomit-frame-pointer endif endif -KBUILD_CFLAGS += $(call cc-option, -fno-var-tracking-assignments) - ifdef CONFIG_DEBUG_INFO -KBUILD_CFLAGS += -g +KBUILD_CFLAGS += -gdwarf-3 KBUILD_AFLAGS += -Wa,--gdwarf-2 endif