Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 178421

Summary: backtraces guide redundant flag recommendations
Product: [OLD] Docs on www.gentoo.org Reporter: Ryan Hill (RETIRED) <rhill>
Component: Other documentsAssignee: Gentoo Quality Assurance Team <qa>
Status: RESOLVED FIXED    
Severity: trivial    
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
URL: http://www.gentoo.org/proj/en/qa/backtraces.xml
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: backtraces.xml.diff

Description Ryan Hill (RETIRED) gentoo-dev 2007-05-13 19:55:17 UTC
The backtraces guide states:

"The basic flag to add in this case is -g. That tells the compiler to include extra information in objects, such as filenames and line numbers. This is usually enough to have basic backtraces, but the flags -g2 and -ggdb add more information."

but -g is equivalent to -g2. (like -ggdb is equivalent to -ggdb2 but that's beside the point)
Comment 1 Ryan Hill (RETIRED) gentoo-dev 2007-05-13 19:55:58 UTC
Created attachment 119140 [details, diff]
backtraces.xml.diff
Comment 2 Jan Kundrát (RETIRED) gentoo-dev 2007-05-13 20:08:24 UTC
Thanks, but we (GDP) generally don't touch other project's docs -> reassigning to QA.
Comment 3 SpanKY gentoo-dev 2007-05-13 20:56:14 UTC
where do you see the statement that "-g2" is equivalent to "-g"
Comment 4 Ryan Hill (RETIRED) gentoo-dev 2007-05-13 21:31:33 UTC
-glevel
-ggdblevel
-gstabslevel
-gcofflevel
-gxcofflevel
-gvmslevel
    Request debugging information and also use level to specify how much information. The default level is 2.

    Level 0 produces no debug information at all. Thus, -g0 negates -g.

    Level 1 produces minimal information, enough for making backtraces in parts of the program that you don't plan to debug. This includes descriptions of functions and external variables, but no information about local variables and no line numbers.

    Level 3 includes extra information, such as all the macro definitions present in the program. Some debuggers support macro expansion when you use -g3. 

http://gcc.gnu.org/onlinedocs/gcc/Debugging-Options.html#Debugging-Options
Comment 5 SpanKY gentoo-dev 2007-05-13 21:46:06 UTC
my look through the source code didnt turn up such visibility which is why i was asking ... thanks, merged