All of lore.kernel.org
 help / color / mirror / Atom feed
From: slash.tmp@free.fr (Mason)
To: linux-arm-kernel@lists.infradead.org
Subject: arch/arm/kernel/setup.c does not compile at -O0
Date: Thu, 30 Jul 2015 18:09:47 +0200	[thread overview]
Message-ID: <55BA4C4B.3070705@free.fr> (raw)
In-Reply-To: <55BA2D9D.1070402@free.fr>

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 
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
 

Regards.

  parent reply	other threads:[~2015-07-30 16:09 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-30 12:53 arch/arm/kernel/setup.c does not compile at -O0 Mason
2015-07-30 13:14 ` Robin Murphy
2015-07-30 13:58   ` Mason
2015-07-30 14:54     ` Mason
2015-07-30 16:09     ` Mason [this message]
2015-07-31  8:28       ` Mason
2015-07-30 13:29 ` Russell King - ARM Linux
2015-07-30 15:23 ` Suman Tripathi
2015-07-30 15:50   ` Russell King - ARM Linux
2015-07-30 16:13     ` Suman Tripathi
2015-08-20  9:07     ` Suman Tripathi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=55BA4C4B.3070705@free.fr \
    --to=slash.tmp@free.fr \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.