📄 00000008.htm
字号:
<HTML><HEAD> <TITLE>BBS水木清华站∶精华区</TITLE></HEAD><BODY><CENTER><H1>BBS水木清华站∶精华区</H1></CENTER>DEBUGGING OPTIONS <BR> GNU CC has various special options that are used for de- <BR> bugging either your program or GCC: <BR> <BR> -g Produce debugging information in the operating sys- <BR> tem's native format (stabs, COFF, XCOFF, or DWARF). <BR> GDB can work with this debugging information. <BR> <BR> On most systems that use stabs format, `-g' enables <BR> use of extra debugging information that only GDB <BR> can use; this extra information makes debugging <BR> work better in GDB but will probably make other de- <BR> buggers crash or refuse to read the program. If <BR> you want to control for certain whether to generate <BR> the extra information, use `-gstabs+', `-gstabs', <BR> `-gxcoff+', `-gxcoff', `-gdwarf+', or `-gdwarf' <BR> (see below). <BR> <BR> Unlike most other C compilers, GNU CC allows you to <BR> use `-g' with `-O'. The shortcuts taken by opti- <BR> mized code may occasionally produce surprising re- <BR> sults: some variables you declared may not exist at <BR> all; flow of control may briefly move where you did <BR> not expect it; some statements may not be executed <BR> because they compute constant results or their val- <BR> ues were already at hand; some statements may exe- <BR> cute in different places because they were moved <BR> out of loops. <BR> <BR> Nevertheless it proves possible to debug optimized <BR> output. This makes it reasonable to use the opti- <BR> mizer for programs that might have bugs. <BR> <BR> The following options are useful when GNU CC is generated <BR> with the capability for more than one debugging format. <BR> <BR> -ggdb Produce debugging information in the native format <BR> (if that is supported), including GDB extensions if <BR> at all possible. <BR> <BR> -gstabs <BR> Produce debugging information in stabs format (if <BR> that is supported), without GDB extensions. This <BR> is the format used by DBX on most BSD systems. <BR> <BR> -gstabs+ <BR> Produce debugging information in stabs format (if <BR> that is supported), using GNU extensions understood <BR> only by the GNU debugger (GDB). The use of these <BR> extensions is likely to make other debuggers crash <BR> or refuse to read the program. <BR> <BR> -gcoff Produce debugging information in COFF format (if <BR> that is supported). This is the format used by SDB <BR> on most System V systems prior to System V Release <BR> 4. <BR> <BR> -gxcoff <BR> Produce debugging information in XCOFF format (if <BR> that is supported). This is the format used by the <BR> DBX debugger on IBM RS/6000 systems. <BR> <BR> -gxcoff+ <BR> Produce debugging information in XCOFF format (if <BR> that is supported), using GNU extensions understood <BR> only by the GNU debugger (GDB). The use of these <BR> extensions is likely to make other debuggers crash <BR> or refuse to read the program. <BR> <BR> -gdwarf <BR> Produce debugging information in DWARF format (if <BR> that is supported). This is the format used by SDB <BR> on most System V Release 4 systems. <BR> <BR> -gdwarf+ <BR> Produce debugging information in DWARF format (if <BR> that is supported), using GNU extensions understood <BR> only by the GNU debugger (GDB). The use of these <BR> extensions is likely to make other debuggers crash <BR> or refuse to read the program. <BR> <BR> -glevel <BR> -ggdblevel <BR> -gstabslevel <BR> -gcofflevel -gxcofflevel <BR> <BR> -gdwarflevel <BR> Request debugging information and also use level to <BR> specify how much information. The default level is <BR> 2. <BR> <BR> Level 1 produces minimal information, enough for <BR> making backtraces in parts of the program that you <BR> don't plan to debug. This includes descriptions of <BR> functions and external variables, but no informa- <BR> tion about local variables and no line numbers. <BR> <BR> Level 3 includes extra information, such as all the <BR> macro definitions present in the program. Some de- <BR> buggers support macro expansion when you use `-g3'. <BR> <BR> -p Generate extra code to write profile information <BR> suitable for the analysis program prof. <BR> <BR> -pg Generate extra code to write profile information <BR> suitable for the analysis program gprof. <BR>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -