public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jason Wessel <jason.wessel@windriver.com>
To: Roland McGrath <roland@redhat.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Pass -g to assembler under CONFIG_DEBUG_INFO
Date: Wed, 11 Jul 2007 17:37:37 -0500	[thread overview]
Message-ID: <46955BB1.20200@windriver.com> (raw)
In-Reply-To: <20070711213012.4D4694D0555@magilla.localdomain>

Roland McGrath wrote:
>> Jason's kgdb tree does
>>
>> AFLAGS		+= -gdwarf2
>>
>> (for all architectures!)  Which is better?
>>     
>
> It makes no difference on any platform I care about.  -g says "turn on the
> default flavor for the target", while -gdwarf2 turns on DWARF flavor even
> if the default is different.  Every target I know anything in particular
> about has DWARF as the default flavor anyway.
>   

The -gdwarf2 had a specific reason. 

I had not looked at the recent gcc 4.1.x + binutils, but in the gcc 
3.x.x compilers when you pass just -g the assembler emitted stabs debug 
data on most archs.  This not only made the debug object files bigger, 
but also the stabs sections were not always parsed correctly in various 
versions of gdb.  I found the dwarf2 sections to be smaller and more 
reliable to allow source level assembly stepping as well as debug frame 
info through the assembly linked functions (ie better back traces).

If it is the case that the gcc 4.1.x + binutils all emit dwarf2 as the 
default you can use just -g.

I'll also take a moment to mention that in the kgdb branch, I also 
modified the top level make file so that you can un-optimize kernel 
modules compiled outside the kernel tree.  I find this this is useful if 
you want to step through significant chunks of code in your kernel 
module IE:

make ARCH=i386 -C KERN_SRC_LOCATION M=/my_mod COMPTIMIZE=-O0

Jason.

  reply	other threads:[~2007-07-11 22:38 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-11 18:53 [PATCH] Pass -g to assembler under CONFIG_DEBUG_INFO Roland McGrath
2007-07-11 21:09 ` Andrew Morton
2007-07-11 21:30   ` Roland McGrath
2007-07-11 22:37     ` Jason Wessel [this message]
2007-07-11 22:43       ` Roland McGrath
2007-07-11 23:03         ` Andrew Morton
2007-07-11 23:07           ` Roland McGrath
2007-07-11 23:15           ` Andreas Schwab
2007-07-11 23:19             ` Roland McGrath
2007-07-11 23:27               ` Andreas Schwab
2007-07-11 23:40           ` Linus Torvalds
2007-07-11 23:53             ` Andrew Morton
2007-07-12  8:23               ` Jan Engelhardt
2007-07-14  1:08               ` Adrian Bunk

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=46955BB1.20200@windriver.com \
    --to=jason.wessel@windriver.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=roland@redhat.com \
    --cc=torvalds@linux-foundation.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