[PATCH] Pass -g to assembler under CONFIG_DEBUG_INFO




The assembler for a while now supports -g 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 -g for
assembly files when CONFIG_DEBUG_INFO=y and the assembler supports the option.

Signed-off-by: Roland McGrath <roland@xxxxxxxxxx>
---
Makefile | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/Makefile b/Makefile
index 8a3c271..88b2252 100644
--- a/Makefile
+++ b/Makefile
@@ -498,6 +498,7 @@ endif

ifdef CONFIG_DEBUG_INFO
CFLAGS += -g
+AFLAGS += $(call as-option, -g)
endif

# Force gcc to behave correct even for buggy distributions
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



Relevant Pages

  • Re: What micros do you actually hate to work with?
    ... with less than tiny asm ... hassle to work with 32 bit longs in assembler for an 8 bit uP, ... Microchip's C compiler tools and their assembly under MPLAB. ... is that other programmers for C are easier to find. ...
    (comp.arch.embedded)
  • Re: The Promise of Forth
    ... Declare variables, declare locals, let the compiler do the work ... Forth could be considered the assembler for a simplified virtual ... If you use locals then you have to initialise them each time. ... there are likely to be libraries that could be profitably used within ...
    (comp.lang.forth)
  • The never ending assembly vs. HLL war
    ... > branch instruction excluded is not particularly effective optimization. ... > CPU, chances are pretty good it *won't* be optimal on a different CPU. ... > discussing the futility of optimizing it in *assembler* when the ... careful and consider the code the compiler is emitting (and adjust your ...
    (comp.lang.asm.x86)
  • Re: the quality of assembly language code
    ... Intel's compiler is supposed to ... I have found that I prefer 'C' and assembler roughly in inverse ... >> code than human beings writing raw assembly language. ... > assembly programmers and compilers. ...
    (comp.lang.asm.x86)
  • Re: Microcontroller Project
    ... A C compiler will just mask the nonsense underneath. ... A heck of a lot of poeple will use C on micros because it provides many ... I still do some inline assembler where it's called ... Thousands of embedded engineers who use C almost exclusively will tell ...
    (sci.electronics.design)