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

📄 annotate.texinfo

📁 这个是LINUX下的GDB调度工具的源码
💻 TEXINFO
📖 第 1 页 / 共 2 页
字号:
\input texinfo   @c -*-texinfo-*-@c %**start of header@setfilename annotate.info@c This is a dir.info fragment to support semi-automated addition of@c manuals to an info tree.@dircategory Software development@direntry* Annotate: (annotate).                 The obsolete annotation interface.@end direntry@c@include gdb-cfg.texi@c@settitle @value{GDBN}'s Obsolete Annotations@setchapternewpage off@c %**end of header@set EDITION 1.0@set DATE July 2003@c NOTE: cagney/2003-07-28:@c Don't make this migration doccument an appendix of GDB's user guide.@c By keeping this separate, the size of the user guide is contained. If@c the user guide to get much bigger it would need to switch to a larger,@c more expensive, form factor and would drive up the manuals publication@c cost.  Having a smaller cheaper manual helps the GNU Press with its sales.@ifinfoThis file documents @value{GDBN}'s obsolete annotations.Copyright 1994, 1995, 2000, 2001, 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 noInvariant Sections, with no Front-Cover Texts, and with no Back-CoverTexts.  A copy of the license is included in the section entitled ``GNUFree Documentation License''.@end ifinfo@titlepage@title @value{GDBN}'s Obsolete Annotations@subtitle Edition @value{EDITION}@subtitle @value{DATE}@author Free Software Foundation@page@vskip 0pt plus 1filllCopyright @copyright{} 1994, 1995, 2000, 2001, 2003 Free SoftwareFoundation, 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 noInvariant Sections, with no Front-Cover Texts, and with no Back-CoverTexts.  A copy of the license is included in the section entitled ``GNUFree Documentation License''.@end titlepage@ifinfo@node Top@top GDB AnnotationsThis document describes the obsolete level two annotation interfaceimplemented in older @value{GDBN} versions.@ignoreThis is Edition @value{EDITION}, @value{DATE}.@end ignore@end ifinfo@menu* Annotations Overview::  What annotations are; the general syntax.* Limitations::           Limitations of the annotation interface.* Migrating to GDB/MI::   Migrating to GDB/MI* Server Prefix::       Issuing a command without affecting user state.* Value Annotations::   Values are marked as such.* Frame Annotations::   Stack frames are annotated.* Displays::            @value{GDBN} can be told to display something periodically.* Prompting::           Annotations marking @value{GDBN}'s need for input.* Errors::              Annotations for error messages.* Breakpoint Info::     Information on breakpoints.* Invalidation::        Some annotations describe things now invalid.* Annotations for Running::                        Whether the program is running, how it stopped, etc.* Source Annotations::  Annotations describing source code.* GNU Free Documentation License::@end menu@contents@node Annotations Overview@chapter What is an Annotation?@cindex annotationsTo produce obsolete level two annotations, start @value{GDBN} with the@code{--annotate=2} option.Annotations start with a newline character, two @samp{control-z}characters, and the name of the annotation.  If there is no additionalinformation associated with this annotation, the name of the annotationis followed immediately by a newline.  If there is additionalinformation, the name of the annotation is followed by a space, theadditional information, and a newline.  The additional informationcannot contain newline characters.Any output not beginning with a newline and two @samp{control-z}characters denotes literal output from @value{GDBN}.  Currently there isno need for @value{GDBN} to output a newline followed by two@samp{control-z} characters, but if there was such a need, theannotations could be extended with an @samp{escape} annotation whichmeans those three characters as output.A simple example of starting up @value{GDBN} with annotations is:@smallexample$ gdb --annotate=2GNU GDB 5.0Copyright 2000 Free Software Foundation, Inc.GDB is free software, covered by the GNU General Public License,and you are welcome to change it and/or distribute copies of itunder certain conditions.Type "show copying" to see the conditions.There is absolutely no warranty for GDB.  Type "show warranty"for details.This GDB was configured as "sparc-sun-sunos4.1.3"^Z^Zpre-prompt(gdb) ^Z^Zpromptquit^Z^Zpost-prompt$ @end smallexampleHere @samp{quit} is input to @value{GDBN}; the rest is output from@value{GDBN}.  The three lines beginning @samp{^Z^Z} (where @samp{^Z}denotes a @samp{control-z} character) are annotations; the rest isoutput from @value{GDBN}.@node Limitations@chapter Limitations of the Annotation InterfaceThe level two annotations mechanism is known to have a number oftechnical and architectural limitations.  As a consequence, in 2001,with the release of @value{GDBN} 5.1 and the addition of @sc{gdb/mi},the annotation interface was marked as deprecated.This chapter discusses the known problems.@section Dependant on @sc{cli} outputThe annotation interface works by interspersing markups with@value{GDBN} normal command-line interpreter output.  Unfortunately, thismakes the annotation client dependant on not just the annotations, butalso the @sc{cli} output.  This is because the client is forced toassume that specific @value{GDBN} commands provide specific information.Any change to @value{GDBN}'s @sc{cli} output modifies or removes thatinformation and, consequently, likely breaks the client.Since the @sc{gdb/mi} output is independant of the @sc{cli}, it does nothave this problem.@section ScalabilityThe annotation interface relies on value annotations (@pxref{ValueAnnotations}) and the display mechanism as a way of obtaining up-to-datevalue information.  These mechanisms are not scalable.In a graphical environment, where many values can be displayedsimultaneously, a serious performance problem occurs when the clienttries to first extract from @value{GDBN}, and then re-display, all thosevalues.  The client should instead only request and update the valuesthat changed.The @sc{gdb/mi} Variable Objects provide just that mechanism.@section CorrectnessThe annotation interface assumes that a variable's value can only bechanged when the target is running.  This assumption is not correct.  Asingle assignment to a single variable can result in the entire target,and all displayed values, needing an update.The @sc{gdb/mi} Variable Objects include a mechanism for efficientlyreporting such changes.@section ReliabilityThe @sc{gdb/mi} interface includes a dedicated test directory(@file{gdb/gdb.mi}), and any addition or fix to @sc{gdb/mi} must includetestsuite changes.@section MaintainabilityThe annotation mechanism was implemented by interspersing @sc{cli} printstatements with various annotations.  As a consequence, any @sc{cli}output change can alter the annotation output.Since the @sc{gdb/mi} output is independant of the @sc{cli}, and the@sc{gdb/mi} is increasingly implemented independant of the @sc{cli}code, its long term maintenance is much easier.@node Migrating to GDB/MI@chapter Migrating to @sc{gdb/mi}By using the @samp{interp mi} command, it is possible for annotationclients to invoke @sc{gdb/mi} commands, and hence access the@sc{gdb/mi}.  By doing this, existing annotation clients have amigration path from this obsolete interface to @sc{gdb/mi}.@node Server Prefix@chapter The Server Prefix@cindex server prefix for annotationsTo issue a command to @value{GDBN} without affecting certain aspects ofthe state which is seen by users, prefix it with @samp{server }.  Thismeans that this command will not affect the command history, nor will itaffect @value{GDBN}'s notion of which command to repeat if @key{RET} ispressed on a line by itself.The server prefix does not affect the recording of values into the valuehistory; to print a value without recording it into the value history,use the @code{output} command instead of the @code{print} command.@node Value Annotations@chapter Values@emph{Value Annotations have been removed.  @sc{gdb/mi} instead providesVariable Objects.}@cindex annotations for valuesWhen a value is printed in various contexts, @value{GDBN} usesannotations to delimit the value from the surrounding text.@findex value-history-begin@findex value-history-value@findex value-history-endIf a value is printed using @code{print} and added to the value history,the annotation looks like@smallexample^Z^Zvalue-history-begin @var{history-number} @var{value-flags}@var{history-string}^Z^Zvalue-history-value@var{the-value}^Z^Zvalue-history-end@end smallexample@noindentwhere @var{history-number} is the number it is getting in the valuehistory, @var{history-string} is a string, such as @samp{$5 = }, whichintroduces the value to the user, @var{the-value} is the outputcorresponding to the value itself, and @var{value-flags} is @samp{*} fora value which can be dereferenced and @samp{-} for a value which cannot.@findex value-begin@findex value-endIf the value is not added to the value history (it is an invalid floator it is printed with the @code{output} command), the annotation is similar:@smallexample^Z^Zvalue-begin @var{value-flags}@var{the-value}^Z^Zvalue-end@end smallexample@findex arg-begin@findex arg-name-end@findex arg-value@findex arg-endWhen @value{GDBN} prints an argument to a function (for example, in the outputfrom the @code{backtrace} command), it annotates it as follows:@smallexample^Z^Zarg-begin@var{argument-name}^Z^Zarg-name-end@var{separator-string}^Z^Zarg-value @var{value-flags}@var{the-value}^Z^Zarg-end@end smallexample@noindentwhere @var{argument-name} is the name of the argument,@var{separator-string} is text which separates the name from the valuefor the user's benefit (such as @samp{=}), and @var{value-flags} and@var{the-value} have the same meanings as in a@code{value-history-begin} annotation.@findex field-begin@findex field-name-end@findex field-value@findex field-endWhen printing a structure, @value{GDBN} annotates it as follows:@smallexample^Z^Zfield-begin @var{value-flags}@var{field-name}^Z^Zfield-name-end@var{separator-string}^Z^Zfield-value@var{the-value}^Z^Zfield-end@end smallexample@noindentwhere @var{field-name} is the name of the field, @var{separator-string}is text which separates the name from the value for the user's benefit(such as @samp{=}), and @var{value-flags} and @var{the-value} have thesame meanings as in a @code{value-history-begin} annotation.When printing an array, @value{GDBN} annotates it as follows:@smallexample^Z^Zarray-section-begin @var{array-index} @var{value-flags}@end smallexample@noindentwhere @var{array-index} is the index of the first element beingannotated and @var{value-flags} has the same meaning as in a@code{value-history-begin} annotation.  This is followed by any numberof elements, where is element can be either a single element:@findex elt@smallexample@samp{,} @var{whitespace}         ; @r{omitted for the first element}@var{the-value}^Z^Zelt@end smallexampleor a repeated element@findex elt-rep@findex elt-rep-end@smallexample@samp{,} @var{whitespace}         ; @r{omitted for the first element}@var{the-value}^Z^Zelt-rep @var{number-of-repetitions}@var{repetition-string}^Z^Zelt-rep-end@end smallexampleIn both cases, @var{the-value} is the output for the value of theelement and @var{whitespace} can contain spaces, tabs, and newlines.  Inthe repeated case, @var{number-of-repetitions} is the number ofconsecutive array elements which contain that value, and@var{repetition-string} is a string which is designed to convey to theuser that repetition is being depicted.@findex array-section-endOnce all the array elements have been output, the array annotation isended with@smallexample^Z^Zarray-section-end@end smallexample@node Frame Annotations@chapter Frames@emph{Value Annotations have been removed.  @sc{gdb/mi} instead providesa number of frame commands.}@emph{Frame annotations are no longer available.  The @sc{gdb/mi}provides @samp{-stack-list-arguments}, @samp{-stack-list-locals}, and@samp{-stack-list-frames} commands.}@cindex annotations for framesWhenever @value{GDBN} prints a frame, it annotates it.  For example, this appliesto frames printed when @value{GDBN} stops, output from commands such as@code{backtrace} or @code{up}, etc.@findex frame-beginThe frame annotation begins with@smallexample^Z^Zframe-begin @var{level} @var{address}@var{level-string}@end smallexample@noindentwhere @var{level} is the number of the frame (0 is the innermost frame,and other frames have positive numbers), @var{address} is the address ofthe code executing in that frame, and @var{level-string} is a stringdesigned to convey the level to the user.  @var{address} is in the form@samp{0x} followed by one or more lowercase hex digits (note that thisdoes not depend on the language).  The frame ends with@findex frame-end@smallexample^Z^Zframe-end@end smallexampleBetween these annotations is the main body of the frame, which canconsist of@itemize @bullet@item@findex function-call@smallexample^Z^Zfunction-call@var{function-call-string}@end smallexamplewhere @var{function-call-string} is text designed to convey to the userthat this frame is associated with a function call made by @value{GDBN} to afunction in the program being debugged.@item@findex signal-handler-caller@smallexample^Z^Zsignal-handler-caller@var{signal-handler-caller-string}

⌨️ 快捷键说明

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