📄 00000001.htm
字号:
<HTML><HEAD> <TITLE>BBS水木清华站∶精华区</TITLE></HEAD><BODY><CENTER><H1>BBS水木清华站∶精华区</H1></CENTER> <BR> <BR>gdb(1) GNU Tools gdb(1) <BR> <BR> <BR> <BR>NAME <BR> gdb - The GNU Debugger <BR> <BR>SYNOPSIS <BR> gdb [-help] [-nx] [-q] [-batch] [-cd=dir] [-f] [-b bps] <BR> [-tty=dev] [-s symfile] [-e prog] [-se prog] [-c core] <BR> [-x cmds] [-d dir] [prog[core|procID]] <BR> <BR>DESCRIPTION <BR> The purpose of a debugger such as GDB is to allow you to see <BR> what is going on ``inside'' another program while it <BR> executes-or what another program was doing at the moment it <BR> crashed. <BR> <BR> GDB can do four main kinds of things (plus other things in <BR> support of these) to help you catch bugs in the act: <BR> <BR> <BR> + Start your program, specifying anything that might <BR> affect its behavior. <BR> <BR> <BR> + Make your program stop on specified conditions. <BR> <BR> <BR> + Examine what has happened, when your program has <BR> stopped. <BR> <BR> <BR> + Change things in your program, so you can experiment <BR> with correcting the effects of one bug and go on to <BR> learn about another. <BR> <BR> You can use GDB to debug programs written in C, C++, and <BR> Modula-2. Fortran support will be added when a GNU Fortran <BR> compiler is ready. <BR> <BR> GDB is invoked with the shell command gdb. Once started, it <BR> reads commands from the terminal until you tell it to exit <BR> with the GDB command quit. You can get online help from gdb <BR> itself by using the command help. <BR> <BR> You can run gdb with no arguments or options; but the most <BR> usual way to start GDB is with one argument or two, specify- <BR> ing an executable program as the argument: <BR> <BR> gdb program <BR> <BR> <BR> You can also start with both an executable program and a <BR> core file specified: <BR> <BR> <BR> <BR> <BR>GNU Tools Last change: 4nov1991 1 <BR> <BR> <BR> <BR> <BR> <BR> <BR>gdb(1) GNU Tools gdb(1) <BR> <BR> <BR> <BR> gdb program core <BR> <BR> <BR> You can, instead, specify a process ID as a second argument, <BR> if you want to debug a running process: <BR> <BR> gdb program 1234 <BR> <BR> <BR> would attach GDB to process 1234 (unless you also have a <BR> file named `1234'; GDB does check for a core file first). <BR> <BR> Here are some of the most frequently needed GDB commands: <BR> <BR> break [file:]function <BR> Set a breakpoint at function (in file). <BR> <BR> run [arglist] <BR> Start your program (with arglist, if specified). <BR> <BR> bt Backtrace: display the program stack. <BR> <BR> print expr <BR> Display the value of an expression. <BR> <BR> c Continue running your program (after stopping, e.g. at <BR> a breakpoint). <BR> <BR> next Execute next program line (after stopping); step over <BR> any function calls in the line. <BR> <BR> step Execute next program line (after stopping); step into <BR> any function calls in the line. <BR> <BR> help [name] <BR> Show information about GDB command name, or general <BR> information about using GDB. <BR> <BR> quit Exit from GDB. <BR> <BR> For full details on GDB, see Using GDB: A Guide to the GNU <BR> Source-Level Debugger, by Richard M. Stallman and Roland H. <BR> Pesch. The same text is available online as the gdb entry <BR> in the info program. <BR> <BR>OPTIONS <BR> Any arguments other than options specify an executable file <BR> and core file (or process ID); that is, the first argument <BR> encountered with no associated option flag is equivalent to <BR> a `-se' option, and the second, if any, is equivalent to a <BR> `-c' option if it's the name of a file. Many options have <BR> both long and short forms; both are shown here. The long <BR> <BR> <BR> <BR>GNU Tools Last change: 4nov1991 2 <BR> <BR> <BR> <BR> <BR> <BR> <BR>gdb(1) GNU Tools gdb(1) <BR> <BR> <BR> <BR> forms are also recognized if you truncate them, so long as <BR> enough of the option is present to be unambiguous. (If you <BR> prefer, you can flag option arguments with `+' rather than <BR> `-', though we illustrate the more usual convention.) <BR> <BR> All the options and command line arguments you give are pro- <BR> cessed in sequential order. The order makes a difference <BR> when the `-x' option is used. <BR> <BR> <BR> -help <BR> <BR> -h List all options, with brief explanations. <BR> <BR> <BR> -symbols=file <BR> <BR> -s file <BR> Read symbol table from file file. <BR> <BR> <BR> -exec=file <BR> <BR> -e file <BR> Use file file as the executable file to execute when <BR> appropriate, and for examining pure data in conjunction <BR>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -