⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 gdb.texinfo

📁 这个是LINUX下的GDB调度工具的源码
💻 TEXINFO
📖 第 1 页 / 共 5 页
字号:
@cindex @code{--epoch}The Epoch Emacs-@value{GDBN} interface sets this option when it runs@value{GDBN} as a subprocess.  It tells @value{GDBN} to modify its printroutines so as to allow Epoch to display values of expressions in aseparate window.@item -annotate @var{level}@cindex @code{--annotate}This option sets the @dfn{annotation level} inside @value{GDBN}.  Itseffect is identical to using @samp{set annotate @var{level}}(@pxref{Annotations}).  The annotation @var{level} controls how muchinformation @value{GDBN} prints together with its prompt, values ofexpressions, source lines, and other types of output.  Level 0 is thenormal, level 1 is for use when @value{GDBN} is run as a subprocess of@sc{gnu} Emacs, level 3 is the maximum annotation suitable for programsthat control @value{GDBN}, and level 2 has been deprecated.The annotation mechanism has largely been superseeded by @sc{gdb/mi}(@pxref{GDB/MI}).@item --args@cindex @code{--args}Change interpretation of command line so that arguments following theexecutable file are passed as command line arguments to the inferior.This option stops option processing.@item -baud @var{bps}@itemx -b @var{bps}@cindex @code{--baud}@cindex @code{-b}Set the line speed (baud rate or bits per second) of any serialinterface used by @value{GDBN} for remote debugging.@item -tty @var{device}@itemx -t @var{device}@cindex @code{--tty}@cindex @code{-t}Run using @var{device} for your program's standard input and output.@c FIXME: kingdon thinks there is more to -tty.  Investigate.@c resolve the situation of these eventually@item -tui@cindex @code{--tui}Activate the @dfn{Text User Interface} when starting.  The Text UserInterface manages several text windows on the terminal, showingsource, assembly, registers and @value{GDBN} command outputs(@pxref{TUI, ,@value{GDBN} Text User Interface}).  Alternatively, theText User Interface can be enabled by invoking the program@samp{gdbtui}.  Do not use this option if you run @value{GDBN} fromEmacs (@pxref{Emacs, ,Using @value{GDBN} under @sc{gnu} Emacs}).@c @item -xdb@c @cindex @code{--xdb}@c Run in XDB compatibility mode, allowing the use of certain XDB commands.@c For information, see the file @file{xdb_trans.html}, which is usually@c installed in the directory @code{/opt/langtools/wdb/doc} on HP-UX@c systems.@item -interpreter @var{interp}@cindex @code{--interpreter}Use the interpreter @var{interp} for interface with the controllingprogram or device.  This option is meant to be set by programs whichcommunicate with @value{GDBN} using it as a back end.@xref{Interpreters, , Command Interpreters}.@samp{--interpreter=mi} (or @samp{--interpreter=mi2}) causes@value{GDBN} to use the @dfn{@sc{gdb/mi} interface} (@pxref{GDB/MI, ,The @sc{gdb/mi} Interface}) included since @var{GDBN} version 6.0.  Theprevious @sc{gdb/mi} interface, included in @value{GDBN} version 5.3 andselected with @samp{--interpreter=mi1}, is deprecated.  Earlier@sc{gdb/mi} interfaces are no longer supported.@item -write@cindex @code{--write}Open the executable and core files for both reading and writing.  Thisis equivalent to the @samp{set write on} command inside @value{GDBN}(@pxref{Patching}).@item -statistics@cindex @code{--statistics}This option causes @value{GDBN} to print statistics about time andmemory usage after it completes each command and returns to the prompt.@item -version@cindex @code{--version}This option causes @value{GDBN} to print its version number andno-warranty blurb, and exit.@end table@node Quitting GDB@section Quitting @value{GDBN}@cindex exiting @value{GDBN}@cindex leaving @value{GDBN}@table @code@kindex quit @r{[}@var{expression}@r{]}@kindex q @r{(@code{quit})}@item quit @r{[}@var{expression}@r{]}@itemx qTo exit @value{GDBN}, use the @code{quit} command (abbreviated@code{q}), or type an end-of-file character (usually @kbd{C-d}).  If youdo not supply @var{expression}, @value{GDBN} will terminate normally;otherwise it will terminate using the result of @var{expression} as theerror code.@end table@cindex interruptAn interrupt (often @kbd{C-c}) does not exit from @value{GDBN}, but ratherterminates the action of any @value{GDBN} command that is in progress andreturns to @value{GDBN} command level.  It is safe to type the interruptcharacter at any time because @value{GDBN} does not allow it to take effectuntil a time when it is safe.If you have been using @value{GDBN} to control an attached process ordevice, you can release it with the @code{detach} command(@pxref{Attach, ,Debugging an already-running process}).@node Shell Commands@section Shell commandsIf you need to execute occasional shell commands during yourdebugging session, there is no need to leave or suspend @value{GDBN}; you canjust use the @code{shell} command.@table @code@kindex shell@cindex shell escape@item shell @var{command string}Invoke a standard shell to execute @var{command string}.If it exists, the environment variable @code{SHELL} determines whichshell to run.  Otherwise @value{GDBN} uses the default shell(@file{/bin/sh} on Unix systems, @file{COMMAND.COM} on MS-DOS, etc.).@end tableThe utility @code{make} is often needed in development environments.You do not have to use the @code{shell} command for this purpose in@value{GDBN}:@table @code@kindex make@cindex calling make@item make @var{make-args}Execute the @code{make} program with the specifiedarguments.  This is equivalent to @samp{shell make @var{make-args}}.@end table@node Logging output@section Logging output@cindex logging @value{GDBN} outputYou may want to save the output of @value{GDBN} commands to a file.There are several commands to control @value{GDBN}'s logging.@table @code@kindex set logging@item set logging onEnable logging.@item set logging offDisable logging.@item set logging file @var{file}Change the name of the current logfile.  The default logfile is @file{gdb.txt}.@item set logging overwrite [on|off]By default, @value{GDBN} will append to the logfile.  Set @code{overwrite} ifyou want @code{set logging on} to overwrite the logfile instead.@item set logging redirect [on|off]By default, @value{GDBN} output will go to both the terminal and the logfile.Set @code{redirect} if you want output to go only to the log file.@kindex show logging@item show loggingShow the current values of the logging settings.@end table@node Commands@chapter @value{GDBN} CommandsYou can abbreviate a @value{GDBN} command to the first few letters of the commandname, if that abbreviation is unambiguous; and you can repeat certain@value{GDBN} commands by typing just @key{RET}.  You can also use the @key{TAB}key to get @value{GDBN} to fill out the rest of a word in a command (or toshow you the alternatives available, if there is more than one possibility).@menu* Command Syntax::              How to give commands to @value{GDBN}* Completion::                  Command completion* Help::                        How to ask @value{GDBN} for help@end menu@node Command Syntax@section Command syntaxA @value{GDBN} command is a single line of input.  There is no limit onhow long it can be.  It starts with a command name, which is followed byarguments whose meaning depends on the command name.  For example, thecommand @code{step} accepts an argument which is the number of times tostep, as in @samp{step 5}.  You can also use the @code{step} commandwith no arguments.  Some commands do not allow any arguments.@cindex abbreviation@value{GDBN} command names may always be truncated if that abbreviation isunambiguous.  Other possible command abbreviations are listed in thedocumentation for individual commands.  In some cases, even ambiguousabbreviations are allowed; for example, @code{s} is specially defined asequivalent to @code{step} even though there are other commands whosenames start with @code{s}.  You can test abbreviations by using them asarguments to the @code{help} command.@cindex repeating commands@kindex RET @r{(repeat last command)}A blank line as input to @value{GDBN} (typing just @key{RET}) means torepeat the previous command.  Certain commands (for example, @code{run})will not repeat this way; these are commands whose unintentionalrepetition might cause trouble and which you are unlikely to want torepeat.The @code{list} and @code{x} commands, when you repeat them with@key{RET}, construct new arguments rather than repeatingexactly as typed.  This permits easy scanning of source or memory.@value{GDBN} can also use @key{RET} in another way: to partition lengthyoutput, in a way similar to the common utility @code{more}(@pxref{Screen Size,,Screen size}).  Since it is easy to press one@key{RET} too many in this situation, @value{GDBN} disables commandrepetition after any command that generates this sort of display.@kindex # @r{(a comment)}@cindex commentAny text from a @kbd{#} to the end of the line is a comment; it doesnothing.  This is useful mainly in command files (@pxref{CommandFiles,,Command files}).@cindex repeating command sequences@kindex C-o @r{(operate-and-get-next)}The @kbd{C-o} binding is useful for repeating a complex sequence ofcommands.  This command accepts the current line, like @kbd{RET}, andthen fetches the next line relative to the current line from the historyfor editing.@node Completion@section Command completion@cindex completion@cindex word completion@value{GDBN} can fill in the rest of a word in a command for you, if there isonly one possibility; it can also show you what the valid possibilitiesare for the next word in a command, at any time.  This works for @value{GDBN}commands, @value{GDBN} subcommands, and the names of symbols in your program.Press the @key{TAB} key whenever you want @value{GDBN} to fill out the restof a word.  If there is only one possibility, @value{GDBN} fills in theword, and waits for you to finish the command (or press @key{RET} toenter it).  For example, if you type@c FIXME "@key" does not distinguish its argument sufficiently to permit@c complete accuracy in these examples; space introduced for clarity.@c If texinfo enhancements make it unnecessary, it would be nice to@c replace " @key" by "@key" in the following...@smallexample(@value{GDBP}) info bre @key{TAB}@end smallexample@noindent@value{GDBN} fills in the rest of the word @samp{breakpoints}, since that isthe only @code{info} subcommand beginning with @samp{bre}:@smallexample(@value{GDBP}) info breakpoints@end smallexample@noindentYou can either press @key{RET} at this point, to run the @code{infobreakpoints} command, or backspace and enter something else, if@samp{breakpoints} does not look like the command you expected.  (If youwere sure you wanted @code{info breakpoints} in the first place, youmight as well just type @key{RET} immediately after @samp{info bre},to exploit command abbreviations rather than command completion).If there is more than one possibility for the next word when you press@key{TAB}, @value{GDBN} sounds a bell.  You can either supply morecharacters and try again, or just press @key{TAB} a second time;@value{GDBN} displays all the possible completions for that word.  Forexample, you might want to set a breakpoint on a subroutine whose namebegins with @samp{make_}, but when you type @kbd{b make_@key{TAB}} @value{GDBN}just sounds the bell.  Typing @key{TAB} again displays all thefunction names in your program that begin with those characters, forexample:@smallexample(@value{GDBP}) b make_ @key{TAB}@exdent @value{GDBN} sounds bell; press @key{TAB} again, to see:make_a_section_from_file     make_environmake_abs_section             make_function_typemake_blockvector             make_pointer_typemake_cleanup                 make_reference_typemake_command                 make_symbol_completion_list(@value{GDBP}) b make_@end smallexample@noindentAfter displaying the available possibilities, @value{GDBN} copies yourpartial input (@samp{b make_} in the example) so you can finish thecommand.If you just want to see the list of alternatives in the first place, youcan press @kbd{M-?} rather than pressing @key{TAB} twice.  @kbd{M-?}means @kbd{@key{META} ?}.  You can type this either by holding down akey designated as the @key{META} shift on your keyboard (if there isone) while typing @kbd{?}, or as @key{ESC} followed by @kbd{?}.@cindex quotes in commands@cindex completion of quoted stringsSometimes the string you need, while logically a ``word'', may containparentheses or other characters that @value{GDBN} normally excludes fromits notion of a word.  To permit word completion to work in thissituation, you may enclose words in @code{'} (single quote marks) in@value{GDBN} commands.The most likely situation where you might need this is in typing thename of a C@t{++} function.  This is because C@t{++} allows functionoverloading (multiple definitions of the same function, distinguishedby argument type).  For example, when you want to set a breakpoint youmay need to distinguish whether you mean the version of @code{name}that takes an @code{int} parameter, @code{name(int)}, or the versionthat takes a @code{float} parameter, @code{name(float)}.  To use theword-completion facilities in this situation, type a single quote@code{'} at the beginning of the function name.  This alerts@value{GDBN} that it may need to consider more information than usualwhen you press @key{TAB} or @kbd{M-?} to request word completion:@smallexample(@value{GDBP}) b 'bubble( @kbd{M-?}bubble(double,double)    bubble(int,int)(@value{GDBP}) b 'bubble(@end smallexampleIn some cases, @value{GDBN} can tell that completing a name requires usingquotes.  When this happens, @value{GDBN} inserts the quote for you (whilecompleting as much as it can) if you do not type the quote in the firstplace:@smallexample(@value{GDBP}) b bub @key{TAB}@exdent @value{GDBN} alters your input line to the following, and rings a bell:(@value{GDBP}) b 'bubble(@end smallexample@noindentIn general, @value{GDBN} can tell that a quote is needed (and inserts it) ifyou have not yet started typing the argument list when you ask for

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -