📄 gdb.texinfo
字号:
\input texinfo @c -*-texinfo-*-@c Copyright 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998,@c 1999, 2000, 2001, 2002, 2003@c Free Software Foundation, Inc.@c@c %**start of header@c makeinfo ignores cmds prev to setfilename, so its arg cannot make use@c of @set vars. However, you can override filename with makeinfo -o.@setfilename gdb.info@c@include gdb-cfg.texi@c@settitle Debugging with @value{GDBN}@setchapternewpage odd@c %**end of header@iftex@c @smallbook@c @cropmarks@end iftex@finalout@syncodeindex ky cp@c readline appendices use @vindex, @findex and @ftable,@c annotate.texi and gdbmi use @findex.@syncodeindex vr cp@syncodeindex fn cp@c !!set GDB manual's edition---not the same as GDB version!@c This is updated by GNU Press.@set EDITION Ninth@c !!set GDB edit command default editor@set EDITOR /bin/ex@c THIS MANUAL REQUIRES TEXINFO 4.0 OR LATER.@c This is a dir.info fragment to support semi-automated addition of@c manuals to an info tree.@dircategory Programming & development tools.@direntry* Gdb: (gdb). The @sc{gnu} debugger.@end direntry@ifinfoThis file documents the @sc{gnu} debugger @value{GDBN}.This is the @value{EDITION} Edition, of @cite{Debugging with@value{GDBN}: the @sc{gnu} Source-Level Debugger} for @value{GDBN}Version @value{GDBVN}.Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998,@* 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.Permission is granted to copy, distribute and/or modify this documentunder the terms of the GNU Free Documentation License, Version 1.1 orany later version published by the Free Software Foundation; with theInvariant Sections being ``Free Software'' and ``Free Software NeedsFree Documentation'', with the Front-Cover Texts being ``A GNU Manual,''and with the Back-Cover Texts as in (a) below.(a) The Free Software Foundation's Back-Cover Text is: ``You havefreedom to copy and modify this GNU Manual, like GNU software. Copiespublished by the Free Software Foundation raise funds for GNUdevelopment.''@end ifinfo@titlepage@title Debugging with @value{GDBN}@subtitle The @sc{gnu} Source-Level Debugger@sp 1@subtitle @value{EDITION} Edition, for @value{GDBN} version @value{GDBVN}@author Richard Stallman, Roland Pesch, Stan Shebs, et al.@page@tex{\parskip=0pt\hfill (Send bugs and comments on @value{GDBN} to bug-gdb\@gnu.org.)\par\hfill {\it Debugging with @value{GDBN}}\par\hfill \TeX{}info \texinfoversion\par}@end tex@vskip 0pt plus 1filllCopyright @copyright{} 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995,1996, 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.@sp 2Published by the Free Software Foundation @*59 Temple Place - Suite 330, @*Boston, MA 02111-1307 USA @*ISBN 1-882114-77-9 @*Permission is granted to copy, distribute and/or modify this documentunder the terms of the GNU Free Documentation License, Version 1.1 orany later version published by the Free Software Foundation; with theInvariant Sections being ``Free Software'' and ``Free Software NeedsFree Documentation'', with the Front-Cover Texts being ``A GNU Manual,''and with the Back-Cover Texts as in (a) below.(a) The Free Software Foundation's Back-Cover Text is: ``You havefreedom to copy and modify this GNU Manual, like GNU software. Copiespublished by the Free Software Foundation raise funds for GNUdevelopment.''@end titlepage@page@ifnottex@node Top, Summary, (dir), (dir)@top Debugging with @value{GDBN}This file describes @value{GDBN}, the @sc{gnu} symbolic debugger.This is the @value{EDITION} Edition, for @value{GDBN} Version@value{GDBVN}.Copyright (C) 1988-2003 Free Software Foundation, Inc.@menu* Summary:: Summary of @value{GDBN}* Sample Session:: A sample @value{GDBN} session* Invocation:: Getting in and out of @value{GDBN}* Commands:: @value{GDBN} commands* Running:: Running programs under @value{GDBN}* Stopping:: Stopping and continuing* Stack:: Examining the stack* Source:: Examining source files* Data:: Examining data* Macros:: Preprocessor Macros* Tracepoints:: Debugging remote targets non-intrusively* Overlays:: Debugging programs that use overlays* Languages:: Using @value{GDBN} with different languages* Symbols:: Examining the symbol table* Altering:: Altering execution* GDB Files:: @value{GDBN} files* Targets:: Specifying a debugging target* Remote Debugging:: Debugging remote programs* Configurations:: Configuration-specific information* Controlling GDB:: Controlling @value{GDBN}* Sequences:: Canned sequences of commands* TUI:: @value{GDBN} Text User Interface* Interpreters:: Command Interpreters* Emacs:: Using @value{GDBN} under @sc{gnu} Emacs* Annotations:: @value{GDBN}'s annotation interface.* GDB/MI:: @value{GDBN}'s Machine Interface.* GDB Bugs:: Reporting bugs in @value{GDBN}* Formatting Documentation:: How to format and print @value{GDBN} documentation* Command Line Editing:: Command Line Editing* Using History Interactively:: Using History Interactively* Installing GDB:: Installing GDB* Maintenance Commands:: Maintenance Commands* Remote Protocol:: GDB Remote Serial Protocol* Agent Expressions:: The GDB Agent Expression Mechanism* Copying:: GNU General Public License says how you can copy and share GDB* GNU Free Documentation License:: The license for this documentation* Index:: Index@end menu@end ifnottex@contents@node Summary@unnumbered Summary of @value{GDBN}The purpose of a debugger such as @value{GDBN} is to allow you to see what isgoing on ``inside'' another program while it executes---or what anotherprogram was doing at the moment it crashed.@value{GDBN} can do four main kinds of things (plus other things in support ofthese) to help you catch bugs in the act:@itemize @bullet@itemStart your program, specifying anything that might affect its behavior.@itemMake your program stop on specified conditions.@itemExamine what has happened, when your program has stopped.@itemChange things in your program, so you can experiment with correcting theeffects of one bug and go on to learn about another.@end itemizeYou can use @value{GDBN} to debug programs written in C and C++.For more information, see @ref{Support,,Supported languages}.For more information, see @ref{C,,C and C++}.@cindex Modula-2Support for Modula-2 is partial. For information on Modula-2, see@ref{Modula-2,,Modula-2}.@cindex PascalDebugging Pascal programs which use sets, subranges, file variables, ornested functions does not currently work. @value{GDBN} does not supportentering expressions, printing values, or similar features using Pascalsyntax.@cindex Fortran@value{GDBN} can be used to debug programs written in Fortran, althoughit may be necessary to refer to some variables with a trailingunderscore.@value{GDBN} can be used to debug programs written in Objective-C,using either the Apple/NeXT or the GNU Objective-C runtime.@menu* Free Software:: Freely redistributable software* Contributors:: Contributors to GDB@end menu@node Free Software@unnumberedsec Free software@value{GDBN} is @dfn{free software}, protected by the @sc{gnu}General Public License(GPL). The GPL gives you the freedom to copy or adapt a licensedprogram---but every person getting a copy also gets with it thefreedom to modify that copy (which means that they must get access tothe source code), and the freedom to distribute further copies.Typical software companies use copyrights to limit your freedoms; theFree Software Foundation uses the GPL to preserve these freedoms.Fundamentally, the General Public License is a license which says thatyou have these freedoms and that you cannot take these freedoms awayfrom anyone else.@unnumberedsec Free Software Needs Free DocumentationThe biggest deficiency in the free software community today is not inthe software---it is the lack of good free documentation that we caninclude with the free software. Many of our most importantprograms do not come with free reference manuals and free introductorytexts. Documentation is an essential part of any software package;when an important free software package does not come with a freemanual and a free tutorial, that is a major gap. We have many suchgaps today.Consider Perl, for instance. The tutorial manuals that peoplenormally use are non-free. How did this come about? Because theauthors of those manuals published them with restrictive terms---nocopying, no modification, source files not available---which excludethem from the free software world.That wasn't the first time this sort of thing happened, and it was farfrom the last. Many times we have heard a GNU user eagerly describe amanual that he is writing, his intended contribution to the community,only to learn that he had ruined everything by signing a publicationcontract to make it non-free.Free documentation, like free software, is a matter of freedom, notprice. The problem with the non-free manual is not that publisherscharge a price for printed copies---that in itself is fine. (The FreeSoftware Foundation sells printed copies of manuals, too.) Theproblem is the restrictions on the use of the manual. Free manualsare available in source code form, and give you permission to copy andmodify. Non-free manuals do not allow this.The criteria of freedom for a free manual are roughly the same as forfree software. Redistribution (including the normal kinds ofcommercial redistribution) must be permitted, so that the manual canaccompany every copy of the program, both on-line and on paper.Permission for modification of the technical content is crucial too.When people modify the software, adding or changing features, if theyare conscientious they will change the manual too---so they canprovide accurate and clear documentation for the modified program. Amanual that leaves you no choice but to write a new manual to documenta changed version of the program is not really available to ourcommunity.Some kinds of limits on the way modification is handled areacceptable. For example, requirements to preserve the originalauthor's copyright notice, the distribution terms, or the list ofauthors, are ok. It is also no problem to require modified versionsto include notice that they were modified. Even entire sections thatmay not be deleted or changed are acceptable, as long as they dealwith nontechnical topics (like this one). These kinds of restrictionsare acceptable because they don't obstruct the community's normal useof the manual.However, it must be possible to modify all the @emph{technical}content of the manual, and then distribute the result in all the usualmedia, through all the usual channels. Otherwise, the restrictionsobstruct the use of the manual, it is not free, and we need anothermanual to replace it.Please spread the word about this issue. Our community continues tolose manuals to proprietary publishing. If we spread the word thatfree software needs free reference manuals and free tutorials, perhapsthe next person who wants to contribute by writing documentation willrealize, before it is too late, that only free manuals contribute tothe free software community.If you are writing documentation, please insist on publishing it underthe GNU Free Documentation License or another free documentationlicense. Remember that this decision requires your approval---youdon't have to let the publisher decide. Some commercial publisherswill use a free license if you insist, but they will not propose theoption; it is up to you to raise the issue and say firmly that this iswhat you want. If the publisher you are dealing with refuses, pleasetry other publishers. If you're not sure whether a proposed licenseis free, write to @email{licensing@@gnu.org}.You can encourage commercial publishers to sell more free, copyleftedmanuals and tutorials by buying them, and particularly by buyingcopies from the publishers that paid for their writing or for majorimprovements. Meanwhile, try to avoid buying non-free documentationat all. Check the distribution terms of a manual before you buy it,and insist that whoever seeks your business must respect your freedom.Check the history of the book, and try to reward the publishers thathave paid or pay the authors to work on it.The Free Software Foundation maintains a list of free documentationpublished by other publishers, at@url{http://www.fsf.org/doc/other-free-books.html}.@node Contributors@unnumberedsec Contributors to @value{GDBN}Richard Stallman was the original author of @value{GDBN}, and of manyother @sc{gnu} programs. Many others have contributed to itsdevelopment. This section attempts to credit major contributors. Oneof the virtues of free software is that everyone is free to contributeto it; with regret, we cannot actually acknowledge everyone here. Thefile @file{ChangeLog} in the @value{GDBN} distribution approximates ablow-by-blow account.Changes much prior to version 2.0 are lost in the mists of time.@quotation@emph{Plea:} Additions to this section are particularly welcome. If youor your friends (or enemies, to be evenhanded) have been unfairlyomitted from this list, we would like to add your names!@end quotationSo that they may not regard their many labors as thankless, weparticularly thank those who shepherded @value{GDBN} through majorreleases:Andrew Cagney (releases 6.0, 5.3, 5.2, 5.1 and 5.0);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -