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: Jason Wessel <jason.wessel@...>, Linus Torvalds <torvalds@...>, <linux-kernel@...>, <linux-arch@...>
Date: Wednesday, July 11, 2007 - 7:03 pm

On Wed, 11 Jul 2007 15:43:27 -0700 (PDT)
Roland McGrath <roland@redhat.com> wrote:


OK, thanks.  So I ended up with the below as a probably-2.6.23 thing:


From: Roland McGrath <roland@redhat.com>

The assembler for a while now supports -gdwarf to generate source line info
just like the C compiler does.  Source-level assembly debugging sounds like an
oxymoron, but it is handy to be able to see the right source file and read its
comments rather than just the disassembly.  This patch enables -gdwarf for
assembly files when CONFIG_DEBUG_INFO=y and the assembler supports the option.

Signed-off-by: Roland McGrath <roland@redhat.com>
Cc: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 Makefile |    1 +
 1 files changed, 1 insertion(+)

diff -puN Makefile~pass-g-to-assembler-under-config_debug_info Makefile
--- a/Makefile~pass-g-to-assembler-under-config_debug_info
+++ a/Makefile
@@ -498,6 +498,7 @@ endif
 
 ifdef CONFIG_DEBUG_INFO
 CFLAGS		+= -g
+AFLAGS		+= $(call as-option, -gdwarf)
 endif
 
 # Force gcc to behave correct even for buggy distributions
_


If there are problems it'll most likely be with oddball architectures
running older compilers, I guess.  If something blows up we might need to
make this an arch/foo/Makefile thing.

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