public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jason Wessel <jason.wessel@windriver.com>
To: linux-kernel@vger.kernel.org
Subject: [PATCH 20/21] KGDB: Add ability to unoptimize module compiles and dwarf2 asm
Date: Mon, 15 Oct 2007 13:34:03 -0500	[thread overview]
Message-ID: <4713B29B.4020108@windriver.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 57 bytes --]

Signed-off-by: Jason Wessel <jason.wessel@windriver.com>

[-- Attachment #2: asm_debug.patch --]
[-- Type: text/x-patch, Size: 1520 bytes --]

asm_debug.patch

From: Jason Wessel <jason.wessel@windriver.com>
Subject: [PATCH] Add ability to unoptimize module compiles and dwarf2 asm

This patch adds in the ability to unoptimize a single kernel module to
make source stepping more linear and not optimize out variables that
the developer might like to inspect.  It used with adding
COPTIMIZE=-O0 to the build line.

Also when creating a debug kernel add in dwarf2 sections for the
assembled code.  This makes source stepping the assembly files
possible as well as having references into the .S files in the back
trace information.  The -gdwarf2 was chosen to work around any
problems with the stabs assembly sections.

Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
---
 Makefile |    9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

Index: linux-2.6-kgdb/Makefile
===================================================================
--- linux-2.6-kgdb.orig/Makefile
+++ linux-2.6-kgdb/Makefile
@@ -483,10 +483,14 @@ endif # $(dot-config)
 all: vmlinux
 
 ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE
-CFLAGS		+= -Os
+COPTIMIZE	= -Os
 else
-CFLAGS		+= -O2
+COPTIMIZE	= -O2
 endif
+# COPTIMIZE may be overridden on the make command line with
+# 	make ... COPTIMIZE=""
+# The resulting object may be easier to debug with KGDB
+CFLAGS		+= $(COPTIMIZE)
 
 include $(srctree)/arch/$(ARCH)/Makefile
 
@@ -498,6 +502,7 @@ endif
 
 ifdef CONFIG_DEBUG_INFO
 CFLAGS		+= -g
+AFLAGS		+= -gdwarf2
 endif
 
 # Force gcc to behave correct even for buggy distributions

                 reply	other threads:[~2007-10-15 18:44 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=4713B29B.4020108@windriver.com \
    --to=jason.wessel@windriver.com \
    --cc=linux-kernel@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox