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

📄 gdb.texinfo

📁 这个是LINUX下的GDB调度工具的源码
💻 TEXINFO
📖 第 1 页 / 共 5 页
字号:
Andrew Cagney (releases 6.1, 6.0, 5.3, 5.2, 5.1 and 5.0);Jim Blandy (release 4.18);Jason Molenda (release 4.17);Stan Shebs (release 4.14);Fred Fish (releases 4.16, 4.15, 4.13, 4.12, 4.11, 4.10, and 4.9);Stu Grossman and John Gilmore (releases 4.8, 4.7, 4.6, 4.5, and 4.4);John Gilmore (releases 4.3, 4.2, 4.1, 4.0, and 3.9);Jim Kingdon (releases 3.5, 3.4, and 3.3);and Randy Smith (releases 3.2, 3.1, and 3.0).Richard Stallman, assisted at various times by Peter TerMaat, ChrisHanson, and Richard Mlynarik, handled releases through 2.8.Michael Tiemann is the author of most of the @sc{gnu} C@t{++} supportin @value{GDBN}, with significant additional contributions from PerBothner and Daniel Berlin.  James Clark wrote the @sc{gnu} C@t{++}demangler.  Early work on C@t{++} was by Peter TerMaat (who also didmuch general update work leading to release 3.0).@value{GDBN} uses the BFD subroutine library to examine multipleobject-file formats; BFD was a joint project of David V.Henkel-Wallace, Rich Pixley, Steve Chamberlain, and John Gilmore.David Johnson wrote the original COFF support; Pace Willison didthe original support for encapsulated COFF.Brent Benson of Harris Computer Systems contributed DWARF 2 support.Adam de Boor and Bradley Davis contributed the ISI Optimum V support.Per Bothner, Noboyuki Hikichi, and Alessandro Forin contributed MIPSsupport.Jean-Daniel Fekete contributed Sun 386i support.Chris Hanson improved the HP9000 support.Noboyuki Hikichi and Tomoyuki Hasei contributed Sony/News OS 3 support.David Johnson contributed Encore Umax support.Jyrki Kuoppala contributed Altos 3068 support.Jeff Law contributed HP PA and SOM support.Keith Packard contributed NS32K support.Doug Rabson contributed Acorn Risc Machine support.Bob Rusk contributed Harris Nighthawk CX-UX support.Chris Smith contributed Convex support (and Fortran debugging).Jonathan Stone contributed Pyramid support.Michael Tiemann contributed SPARC support.Tim Tucker contributed support for the Gould NP1 and Gould Powernode.Pace Willison contributed Intel 386 support.Jay Vosburgh contributed Symmetry support.Marko Mlinar contributed OpenRISC 1000 support.Andreas Schwab contributed M68K @sc{gnu}/Linux support.Rich Schaefer and Peter Schauer helped with support of SunOS sharedlibraries.Jay Fenlason and Roland McGrath ensured that @value{GDBN} and GAS agreeabout several machine instruction sets.Patrick Duval, Ted Goldstein, Vikram Koka and Glenn Engel helped developremote debugging.  Intel Corporation, Wind River Systems, AMD, and ARMcontributed remote debugging modules for the i960, VxWorks, A29K UDI,and RDI targets, respectively.Brian Fox is the author of the readline libraries providingcommand-line editing and command history.Andrew Beers of SUNY Buffalo wrote the language-switching code, theModula-2 support, and contributed the Languages chapter of this manual.Fred Fish wrote most of the support for Unix System Vr4.He also enhanced the command-completion support to cover C@t{++} overloadedsymbols.Hitachi America (now Renesas America), Ltd. sponsored the support forH8/300, H8/500, and Super-H processors.NEC sponsored the support for the v850, Vr4xxx, and Vr5xxx processors.Mitsubishi (now Renesas) sponsored the support for D10V, D30V, and M32R/Dprocessors.Toshiba sponsored the support for the TX39 Mips processor.Matsushita sponsored the support for the MN10200 and MN10300 processors.Fujitsu sponsored the support for SPARClite and FR30 processors.Kung Hsu, Jeff Law, and Rick Sladkey added support for hardwarewatchpoints.Michael Snyder added support for tracepoints.Stu Grossman wrote gdbserver.Jim Kingdon, Peter Schauer, Ian Taylor, and Stu Grossman madenearly innumerable bug fixes and cleanups throughout @value{GDBN}.The following people at the Hewlett-Packard Company contributedsupport for the PA-RISC 2.0 architecture, HP-UX 10.20, 10.30, and 11.0(narrow mode), HP's implementation of kernel threads, HP's aC@t{++}compiler, and the Text User Interface (nee Terminal User Interface):Ben Krepp, Richard Title, John Bishop, Susan Macchia, Kathy Mann,Satish Pai, India Paul, Steve Rehrauer, and Elena Zannoni.  Kim Haaseprovided HP-specific information in this manual.DJ Delorie ported @value{GDBN} to MS-DOS, for the DJGPP project.Robert Hoehne made significant contributions to the DJGPP port.Cygnus Solutions has sponsored @value{GDBN} maintenance and much of itsdevelopment since 1991.  Cygnus engineers who have worked on @value{GDBN}fulltime include Mark Alexander, Jim Blandy, Per Bothner, KevinBuettner, Edith Epstein, Chris Faylor, Fred Fish, Martin Hunt, JimIngham, John Gilmore, Stu Grossman, Kung Hsu, Jim Kingdon, John Metzler,Fernando Nasser, Geoffrey Noer, Dawn Perchik, Rich Pixley, ZdenekRadouch, Keith Seitz, Stan Shebs, David Taylor, and Elena Zannoni.  Inaddition, Dave Brolley, Ian Carmichael, Steve Chamberlain, Nick Clifton,JT Conklin, Stan Cox, DJ Delorie, Ulrich Drepper, Frank Eigler, DougEvans, Sean Fagan, David Henkel-Wallace, Richard Henderson, JeffHolcomb, Jeff Law, Jim Lemke, Tom Lord, Bob Manson, Michael Meissner,Jason Merrill, Catherine Moore, Drew Moseley, Ken Raeburn, GavinRomig-Koch, Rob Savoye, Jamie Smith, Mike Stump, Ian Taylor, AngelaThomas, Michael Tiemann, Tom Tromey, Ron Unrau, Jim Wilson, and DavidZuhn have made contributions both large and small.Jim Blandy added support for preprocessor macros, while working for RedHat.@node Sample Session@chapter A Sample @value{GDBN} SessionYou can use this manual at your leisure to read all about @value{GDBN}.However, a handful of commands are enough to get started using thedebugger.  This chapter illustrates those commands.@iftexIn this sample session, we emphasize user input like this: @b{input},to make it easier to pick out from the surrounding output.@end iftex@c FIXME: this example may not be appropriate for some configs, where@c FIXME...primary interest is in remote use.One of the preliminary versions of @sc{gnu} @code{m4} (a generic macroprocessor) exhibits the following bug: sometimes, when we change itsquote strings from the default, the commands used to capture one macrodefinition within another stop working.  In the following short @code{m4}session, we define a macro @code{foo} which expands to @code{0000}; wethen use the @code{m4} built-in @code{defn} to define @code{bar} as thesame thing.  However, when we change the open quote string to@code{<QUOTE>} and the close quote string to @code{<UNQUOTE>}, the sameprocedure fails to define a new synonym @code{baz}:@smallexample$ @b{cd gnu/m4}$ @b{./m4}@b{define(foo,0000)}@b{foo}0000@b{define(bar,defn(`foo'))}@b{bar}0000@b{changequote(<QUOTE>,<UNQUOTE>)}@b{define(baz,defn(<QUOTE>foo<UNQUOTE>))}@b{baz}@b{C-d}m4: End of input: 0: fatal error: EOF in string@end smallexample@noindentLet us use @value{GDBN} to try to see what is going on.@smallexample$ @b{@value{GDBP} m4}@c FIXME: this falsifies the exact text played out, to permit smallbook@c FIXME... format to come out better.@value{GDBN} is free software and you are welcome to distribute copies of it under certain conditions; type "show copying" to see the conditions.There is absolutely no warranty for @value{GDBN}; type "show warranty" for details.@value{GDBN} @value{GDBVN}, Copyright 1999 Free Software Foundation, Inc...(@value{GDBP})@end smallexample@noindent@value{GDBN} reads only enough symbol data to know where to find therest when needed; as a result, the first prompt comes up very quickly.We now tell @value{GDBN} to use a narrower display width than usual, sothat examples fit in this manual.@smallexample(@value{GDBP}) @b{set width 70}@end smallexample@noindentWe need to see how the @code{m4} built-in @code{changequote} works.Having looked at the source, we know the relevant subroutine is@code{m4_changequote}, so we set a breakpoint there with the @value{GDBN}@code{break} command.@smallexample(@value{GDBP}) @b{break m4_changequote}Breakpoint 1 at 0x62f4: file builtin.c, line 879.@end smallexample@noindentUsing the @code{run} command, we start @code{m4} running under @value{GDBN}control; as long as control does not reach the @code{m4_changequote}subroutine, the program runs as usual:@smallexample(@value{GDBP}) @b{run}Starting program: /work/Editorial/gdb/gnu/m4/m4@b{define(foo,0000)}@b{foo}0000@end smallexample@noindentTo trigger the breakpoint, we call @code{changequote}.  @value{GDBN}suspends execution of @code{m4}, displaying information about thecontext where it stops.@smallexample@b{changequote(<QUOTE>,<UNQUOTE>)}Breakpoint 1, m4_changequote (argc=3, argv=0x33c70)    at builtin.c:879879         if (bad_argc(TOKEN_DATA_TEXT(argv[0]),argc,1,3))@end smallexample@noindentNow we use the command @code{n} (@code{next}) to advance execution tothe next line of the current function.@smallexample(@value{GDBP}) @b{n}882         set_quotes((argc >= 2) ? TOKEN_DATA_TEXT(argv[1])\ : nil,@end smallexample@noindent@code{set_quotes} looks like a promising subroutine.  We can go into itby using the command @code{s} (@code{step}) instead of @code{next}.@code{step} goes to the next line to be executed in @emph{any}subroutine, so it steps into @code{set_quotes}.@smallexample(@value{GDBP}) @b{s}set_quotes (lq=0x34c78 "<QUOTE>", rq=0x34c88 "<UNQUOTE>")    at input.c:530530         if (lquote != def_lquote)@end smallexample@noindentThe display that shows the subroutine where @code{m4} is nowsuspended (and its arguments) is called a stack frame display.  Itshows a summary of the stack.  We can use the @code{backtrace}command (which can also be spelled @code{bt}), to see where we arein the stack as a whole: the @code{backtrace} command displays astack frame for each active subroutine.@smallexample(@value{GDBP}) @b{bt}#0  set_quotes (lq=0x34c78 "<QUOTE>", rq=0x34c88 "<UNQUOTE>")    at input.c:530#1  0x6344 in m4_changequote (argc=3, argv=0x33c70)    at builtin.c:882#2  0x8174 in expand_macro (sym=0x33320) at macro.c:242#3  0x7a88 in expand_token (obs=0x0, t=209696, td=0xf7fffa30)    at macro.c:71#4  0x79dc in expand_input () at macro.c:40#5  0x2930 in main (argc=0, argv=0xf7fffb20) at m4.c:195@end smallexample@noindentWe step through a few more lines to see what happens.  The first twotimes, we can use @samp{s}; the next two times we use @code{n} to avoidfalling into the @code{xstrdup} subroutine.@smallexample(@value{GDBP}) @b{s}0x3b5c  532         if (rquote != def_rquote)(@value{GDBP}) @b{s}0x3b80  535         lquote = (lq == nil || *lq == '\0') ?  \def_lquote : xstrdup(lq);(@value{GDBP}) @b{n}536         rquote = (rq == nil || *rq == '\0') ? def_rquote\ : xstrdup(rq);(@value{GDBP}) @b{n}538         len_lquote = strlen(rquote);@end smallexample@noindentThe last line displayed looks a little odd; we can examine the variables@code{lquote} and @code{rquote} to see if they are in fact the new leftand right quotes we specified.  We use the command @code{p}(@code{print}) to see their values.@smallexample(@value{GDBP}) @b{p lquote}$1 = 0x35d40 "<QUOTE>"(@value{GDBP}) @b{p rquote}$2 = 0x35d50 "<UNQUOTE>"@end smallexample@noindent@code{lquote} and @code{rquote} are indeed the new left and right quotes.To look at some context, we can display ten lines of sourcesurrounding the current line with the @code{l} (@code{list}) command.@smallexample(@value{GDBP}) @b{l}533             xfree(rquote);534535         lquote = (lq == nil || *lq == '\0') ? def_lquote\ : xstrdup (lq);536         rquote = (rq == nil || *rq == '\0') ? def_rquote\ : xstrdup (rq);537538         len_lquote = strlen(rquote);539         len_rquote = strlen(lquote);540     @}541542     void@end smallexample@noindentLet us step past the two lines that set @code{len_lquote} and@code{len_rquote}, and then examine the values of those variables.@smallexample(@value{GDBP}) @b{n}539         len_rquote = strlen(lquote);(@value{GDBP}) @b{n}540     @}(@value{GDBP}) @b{p len_lquote}$3 = 9(@value{GDBP}) @b{p len_rquote}$4 = 7@end smallexample@noindentThat certainly looks wrong, assuming @code{len_lquote} and@code{len_rquote} are meant to be the lengths of @code{lquote} and@code{rquote} respectively.  We can set them to better values using

⌨️ 快捷键说明

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