Re: [PATCH] Pass -g to assembler under CONFIG_DEBUG_INFO

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Roland McGrath <roland@...>
Cc: Andrew Morton <akpm@...>, Linus Torvalds <torvalds@...>, <linux-kernel@...>
Date: Wednesday, July 11, 2007 - 6:37 pm

Roland McGrath wrote:

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.
-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] Pass -g to assembler under CONFIG_DEBUG_INFO, Roland McGrath, (Wed Jul 11, 2:53 pm)
Re: [PATCH] Pass -g to assembler under CONFIG_DEBUG_INFO, Andrew Morton, (Wed Jul 11, 5:09 pm)
Re: [PATCH] Pass -g to assembler under CONFIG_DEBUG_INFO, Roland McGrath, (Wed Jul 11, 5:30 pm)
Re: [PATCH] Pass -g to assembler under CONFIG_DEBUG_INFO, Jason Wessel, (Wed Jul 11, 6:37 pm)
Re: [PATCH] Pass -g to assembler under CONFIG_DEBUG_INFO, Roland McGrath, (Wed Jul 11, 6:43 pm)
Re: [PATCH] Pass -g to assembler under CONFIG_DEBUG_INFO, Andrew Morton, (Wed Jul 11, 7:03 pm)
Re: [PATCH] Pass -g to assembler under CONFIG_DEBUG_INFO, Linus Torvalds, (Wed Jul 11, 7:40 pm)
Re: [PATCH] Pass -g to assembler under CONFIG_DEBUG_INFO, Andrew Morton, (Wed Jul 11, 7:53 pm)
Re: [PATCH] Pass -g to assembler under CONFIG_DEBUG_INFO, Jan Engelhardt, (Thu Jul 12, 4:23 am)
Re: [PATCH] Pass -g to assembler under CONFIG_DEBUG_INFO, Andreas Schwab, (Wed Jul 11, 7:15 pm)
Re: [PATCH] Pass -g to assembler under CONFIG_DEBUG_INFO, Roland McGrath, (Wed Jul 11, 7:19 pm)
Re: [PATCH] Pass -g to assembler under CONFIG_DEBUG_INFO, Andreas Schwab, (Wed Jul 11, 7:27 pm)
Re: [PATCH] Pass -g to assembler under CONFIG_DEBUG_INFO, Roland McGrath, (Wed Jul 11, 7:07 pm)