[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Debug as default...
From: |
David Ayers |
Subject: |
Re: Debug as default... |
Date: |
Wed, 20 Sep 2006 19:18:59 +0200 |
User-agent: |
Mozilla Thunderbird 1.0.2 (X11/20060830) |
Nicola Pero schrieb:
> Thanks ...
>
> ... I also noticed that according to the GNU Coding Standards, '-g' should
> be used by default
> when doing 'make all' ... just another reason why it looks like a good
> idea to make 'make debug=yes'
> the default, which I've done. :-)
>
> I also removed the filtering of -O2 from 'make debug=yes', as it seems
> that '-g -O2' is a good
> set of flags ... I think the -O2 causes GCC to do some flow analysis that
> causes it to generate
> better warnings ...
>
> Hmmm ... maybe we should be using '-g -O' rather than '-g -O2'. The doc
> says:
>
> -O1: "Some transformations that preserve execution ordering. Debuggability
> of the generated code is hardly affected. User variables should not
> disappear and function inlining is not done."
>
> -O2: "More aggressive transformations that may affect execution ordering
> and usually provide faster code. Debuggability may be somewhat compromised
> by disappearing user variables and function bodies."
>
> Anyway, let me know if '-g -O2' causes problems, I presume if the '-O2'
> seriously confuse the
> debugger let me know and we can revert that change, or maybe use '-g -O' ?
>
I'm a a bit confused about the current state, but let me mention
my view of the "optimal" settings:
debug=no : -g -O2 (default)
debug=yes : -g -O
IOW, I think we should always use '-g' to generate debug info.
I think strip=yes should be used by packagers who really want to loose
the debug information.
If you like to look at the difference in debugging of -O2 and -O, try
single stepping through some of the static inline functions in
GSObjCRuntime.h from within emacs and attempt to examine some of the
variables with -O2.
Cheers,
David
Cheers,
David
- Re: Debug as default..., (continued)
- Re: Debug as default...,
David Ayers <=