Denys Vlasenko wrote:
> On Tuesday 03 June 2008 22:06, Cristian Ionescu-Idbohrn wrote:
>> When using gdb, one would expect to have the source compiled with '-g -O0',
>> and not '-g -Os'.
> 
> There were people who disagree (they say "debug what you ship").
> I see only one way to leave BOTH camps happy. Create a CONFIG_DEBUG0
> option (dependent on CONFIG_DEBUG) which forces -O0 build.
> Otherwise, -Os would be used.
> 
> Can you do this?
> --

hi vda,
hi all,

-Os specially, does not make sense with -g since i what to save space what i am 
adding
with debugsymbols again. -O0 disables optimisation this is the default.

IMHO debugging optimised code is only useful when using the asm-level since 
even the function
i try to debug may not exist any more (inline).
The normal case for me is that i want to debug code using tools like gdb at 
C-level that is only
useful (possible) when i disable optimisation. I guess that is the case for 
most people.

And if your code works only correct when -g is enabled you are in even deeper 
trouble. (no comment).

To make everyone happy is hard, but i would insist that the DEBUG option should 
enable all debug options
and disable all optimisation to make things easy as possible.
To make others happy we can add a CUSTOM_CFLAGS where people may add there 
personal preferred CFLAGS (e.g. -g)
for the final binary. This could also take same fancy option that do not went 
into the mainline.

re,
 wh


_______________________________________________
busybox mailing list
[email protected]
http://busybox.net/cgi-bin/mailman/listinfo/busybox

Reply via email to