Re: 2.6.0-test3-mm1 and the -g thing.

George Anzinger
2003-08-14T08:17:53Z

Sam Ravnborg wrote:
> On Mon, Aug 11, 2003 at 11:26:36AM -0700, George Anzinger wrote:
>
>>>that patch sets DEBUG_INFO to y by default, even if whether DEBUG_KERNEL
>>>nor KGDB is enabled. The attached patch changes this to enable DEBUG_INFO
>>>by default only if KGDB is enabled.
>>
>>Looks good to me, but.... just what does this turn on? Its been a
>>long time and me thinks a wee comment here would help me remember next
>>time.
>
>
> DEBUG_INFO add "-g" to CFLAGS.
> Main reason to introduce this was that many architectures always use
> "-g", so a config option seemed more appropriate.
> I do not agree that this should be dependent on KGDB.
> To my knowledge -g is useful also without using kgdb.

Yes, I see.

But we have this problem you see:

--- linux-2.6.0-test2-org/arch/i386/Makefile 2003-07-31
13:06:52.000000000 -0700
+++ linux/arch/i386/Makefile 2003-08-06 13:09:39.000000000 -0700
@@ -84,6 +84,9 @@
# default subarch .h files
mflags-y += -Iinclude/asm-i386/mach-default

+mflags-$(CONFIG_KGDB) += -gdwarf-2
+mflags-$(CONFIG_KGDB_MORE) += $(shell echo $(CONFIG_KGDB_OPTIONS) |
sed -e 's/"//g')
+

So the -g gets set as well as -gdwarf-2. And note that the -gdwarf-2
gets set for asm code also (interesting problem there in that the line
number info is for the .s file and not the .S and the .s is a tmp file
to boot). But back to the -g and kgdb. I am thinking the thing to do
is to force DEBUG_INFO off if KGDB is on, thus using what ever we
finally decide should be after the -g.

Andrew started with -gstabs then -g, then -ggdb which I am sure is the
same as -gdwarf-2 (the kernel files are exactly the same size with
either -ggdb or -gdwarf-2) and now, I think, he is back to -g.

I want to use -gdwarf-2 since it a) clearly states what we want, and
b) the new gdb uses the dwarf2 call frames and thus avoids the "bt"
confusion caused by gdb not recognizing the function entry sequence
generated by the newer compilers (I use gcc 3.2.1). I also expect to
have dwarf call frames for the asm code some time soon, which will
allow us to "bt" over interrupt and trap frames.
--
George Anzinger george@mvista.com
High-res-timers: http://sourceforge.net/projects/high-res-timers/
Preemption patch: http://www.kernel.org/pub/linux/kernel/people/rml