1b725ae77Skettenis\input texinfo @c -*-texinfo-*- 2b725ae77Skettenis@c %**start of header 3b725ae77Skettenis@setfilename annotate.info 4b725ae77Skettenis 5b725ae77Skettenis@c This is a dir.info fragment to support semi-automated addition of 6b725ae77Skettenis@c manuals to an info tree. 7*11efff7fSkettenis@dircategory Software development 8b725ae77Skettenis@direntry 9b725ae77Skettenis* Annotate: (annotate). The obsolete annotation interface. 10b725ae77Skettenis@end direntry 11b725ae77Skettenis 12b725ae77Skettenis@c 13b725ae77Skettenis@include gdb-cfg.texi 14b725ae77Skettenis@c 15b725ae77Skettenis@settitle @value{GDBN}'s Obsolete Annotations 16b725ae77Skettenis@setchapternewpage off 17b725ae77Skettenis@c %**end of header 18b725ae77Skettenis 19b725ae77Skettenis@set EDITION 1.0 20b725ae77Skettenis@set DATE July 2003 21b725ae77Skettenis 22b725ae77Skettenis@c NOTE: cagney/2003-07-28: 23b725ae77Skettenis@c Don't make this migration doccument an appendix of GDB's user guide. 24b725ae77Skettenis@c By keeping this separate, the size of the user guide is contained. If 25b725ae77Skettenis@c the user guide to get much bigger it would need to switch to a larger, 26b725ae77Skettenis@c more expensive, form factor and would drive up the manuals publication 27b725ae77Skettenis@c cost. Having a smaller cheaper manual helps the GNU Press with its sales. 28b725ae77Skettenis 29b725ae77Skettenis@ifinfo 30b725ae77SkettenisThis file documents @value{GDBN}'s obsolete annotations. 31b725ae77Skettenis 32b725ae77SkettenisCopyright 1994, 1995, 2000, 2001, 2003 Free Software Foundation, Inc. 33b725ae77Skettenis 34b725ae77SkettenisPermission is granted to copy, distribute and/or modify this document 35b725ae77Skettenisunder the terms of the GNU Free Documentation License, Version 1.1 or 36b725ae77Skettenisany later version published by the Free Software Foundation; with no 37b725ae77SkettenisInvariant Sections, with no Front-Cover Texts, and with no Back-Cover 38b725ae77SkettenisTexts. A copy of the license is included in the section entitled ``GNU 39b725ae77SkettenisFree Documentation License''. 40b725ae77Skettenis 41b725ae77Skettenis@end ifinfo 42b725ae77Skettenis 43b725ae77Skettenis@titlepage 44b725ae77Skettenis@title @value{GDBN}'s Obsolete Annotations 45b725ae77Skettenis@subtitle Edition @value{EDITION} 46b725ae77Skettenis@subtitle @value{DATE} 47b725ae77Skettenis@author Free Software Foundation 48b725ae77Skettenis@page 49b725ae77Skettenis@vskip 0pt plus 1filll 50b725ae77SkettenisCopyright @copyright{} 1994, 1995, 2000, 2001, 2003 Free Software 51b725ae77SkettenisFoundation, Inc. 52b725ae77Skettenis 53b725ae77SkettenisPermission is granted to copy, distribute and/or modify this document 54b725ae77Skettenisunder the terms of the GNU Free Documentation License, Version 1.1 or 55b725ae77Skettenisany later version published by the Free Software Foundation; with no 56b725ae77SkettenisInvariant Sections, with no Front-Cover Texts, and with no Back-Cover 57b725ae77SkettenisTexts. A copy of the license is included in the section entitled ``GNU 58b725ae77SkettenisFree Documentation License''. 59b725ae77Skettenis@end titlepage 60b725ae77Skettenis 61b725ae77Skettenis@ifinfo 62b725ae77Skettenis@node Top 63b725ae77Skettenis@top GDB Annotations 64b725ae77Skettenis 65b725ae77SkettenisThis document describes the obsolete level two annotation interface 66b725ae77Skettenisimplemented in older @value{GDBN} versions. 67b725ae77Skettenis 68b725ae77Skettenis@ignore 69b725ae77SkettenisThis is Edition @value{EDITION}, @value{DATE}. 70b725ae77Skettenis@end ignore 71b725ae77Skettenis@end ifinfo 72b725ae77Skettenis 73b725ae77Skettenis@menu 74b725ae77Skettenis* Annotations Overview:: What annotations are; the general syntax. 75b725ae77Skettenis* Limitations:: Limitations of the annotation interface. 76b725ae77Skettenis* Migrating to GDB/MI:: Migrating to GDB/MI 77b725ae77Skettenis* Server Prefix:: Issuing a command without affecting user state. 78b725ae77Skettenis* Value Annotations:: Values are marked as such. 79b725ae77Skettenis* Frame Annotations:: Stack frames are annotated. 80b725ae77Skettenis* Displays:: @value{GDBN} can be told to display something periodically. 81b725ae77Skettenis* Prompting:: Annotations marking @value{GDBN}'s need for input. 82b725ae77Skettenis* Errors:: Annotations for error messages. 83b725ae77Skettenis* Breakpoint Info:: Information on breakpoints. 84b725ae77Skettenis* Invalidation:: Some annotations describe things now invalid. 85b725ae77Skettenis* Annotations for Running:: 86b725ae77Skettenis Whether the program is running, how it stopped, etc. 87b725ae77Skettenis* Source Annotations:: Annotations describing source code. 88b725ae77Skettenis 89b725ae77Skettenis* GNU Free Documentation License:: 90b725ae77Skettenis@end menu 91b725ae77Skettenis 92b725ae77Skettenis@contents 93b725ae77Skettenis 94b725ae77Skettenis@node Annotations Overview 95b725ae77Skettenis@chapter What is an Annotation? 96b725ae77Skettenis@cindex annotations 97b725ae77Skettenis 98b725ae77SkettenisTo produce obsolete level two annotations, start @value{GDBN} with the 99b725ae77Skettenis@code{--annotate=2} option. 100b725ae77Skettenis 101b725ae77SkettenisAnnotations start with a newline character, two @samp{control-z} 102b725ae77Skettenischaracters, and the name of the annotation. If there is no additional 103b725ae77Skettenisinformation associated with this annotation, the name of the annotation 104b725ae77Skettenisis followed immediately by a newline. If there is additional 105b725ae77Skettenisinformation, the name of the annotation is followed by a space, the 106b725ae77Skettenisadditional information, and a newline. The additional information 107b725ae77Sketteniscannot contain newline characters. 108b725ae77Skettenis 109b725ae77SkettenisAny output not beginning with a newline and two @samp{control-z} 110b725ae77Skettenischaracters denotes literal output from @value{GDBN}. Currently there is 111b725ae77Skettenisno need for @value{GDBN} to output a newline followed by two 112b725ae77Skettenis@samp{control-z} characters, but if there was such a need, the 113b725ae77Skettenisannotations could be extended with an @samp{escape} annotation which 114b725ae77Skettenismeans those three characters as output. 115b725ae77Skettenis 116b725ae77SkettenisA simple example of starting up @value{GDBN} with annotations is: 117b725ae77Skettenis 118b725ae77Skettenis@smallexample 119b725ae77Skettenis$ gdb --annotate=2 120b725ae77SkettenisGNU GDB 5.0 121b725ae77SkettenisCopyright 2000 Free Software Foundation, Inc. 122b725ae77SkettenisGDB is free software, covered by the GNU General Public License, 123b725ae77Skettenisand you are welcome to change it and/or distribute copies of it 124b725ae77Skettenisunder certain conditions. 125b725ae77SkettenisType "show copying" to see the conditions. 126b725ae77SkettenisThere is absolutely no warranty for GDB. Type "show warranty" 127b725ae77Skettenisfor details. 128b725ae77SkettenisThis GDB was configured as "sparc-sun-sunos4.1.3" 129b725ae77Skettenis 130b725ae77Skettenis^Z^Zpre-prompt 131b725ae77Skettenis(gdb) 132b725ae77Skettenis^Z^Zprompt 133b725ae77Skettenisquit 134b725ae77Skettenis 135b725ae77Skettenis^Z^Zpost-prompt 136b725ae77Skettenis$ 137b725ae77Skettenis@end smallexample 138b725ae77Skettenis 139b725ae77SkettenisHere @samp{quit} is input to @value{GDBN}; the rest is output from 140b725ae77Skettenis@value{GDBN}. The three lines beginning @samp{^Z^Z} (where @samp{^Z} 141b725ae77Skettenisdenotes a @samp{control-z} character) are annotations; the rest is 142b725ae77Skettenisoutput from @value{GDBN}. 143b725ae77Skettenis 144b725ae77Skettenis@node Limitations 145b725ae77Skettenis@chapter Limitations of the Annotation Interface 146b725ae77Skettenis 147b725ae77SkettenisThe level two annotations mechanism is known to have a number of 148b725ae77Skettenistechnical and architectural limitations. As a consequence, in 2001, 149b725ae77Sketteniswith the release of @value{GDBN} 5.1 and the addition of @sc{gdb/mi}, 150b725ae77Skettenisthe annotation interface was marked as deprecated. 151b725ae77Skettenis 152b725ae77SkettenisThis chapter discusses the known problems. 153b725ae77Skettenis 154b725ae77Skettenis@section Dependant on @sc{cli} output 155b725ae77Skettenis 156b725ae77SkettenisThe annotation interface works by interspersing markups with 157b725ae77Skettenis@value{GDBN} normal command-line interpreter output. Unfortunately, this 158b725ae77Skettenismakes the annotation client dependant on not just the annotations, but 159b725ae77Skettenisalso the @sc{cli} output. This is because the client is forced to 160b725ae77Skettenisassume that specific @value{GDBN} commands provide specific information. 161b725ae77SkettenisAny change to @value{GDBN}'s @sc{cli} output modifies or removes that 162b725ae77Skettenisinformation and, consequently, likely breaks the client. 163b725ae77Skettenis 164b725ae77SkettenisSince the @sc{gdb/mi} output is independant of the @sc{cli}, it does not 165b725ae77Skettenishave this problem. 166b725ae77Skettenis 167b725ae77Skettenis@section Scalability 168b725ae77Skettenis 169b725ae77SkettenisThe annotation interface relies on value annotations (@pxref{Value 170b725ae77SkettenisAnnotations}) and the display mechanism as a way of obtaining up-to-date 171b725ae77Skettenisvalue information. These mechanisms are not scalable. 172b725ae77Skettenis 173b725ae77SkettenisIn a graphical environment, where many values can be displayed 174b725ae77Skettenissimultaneously, a serious performance problem occurs when the client 175b725ae77Skettenistries to first extract from @value{GDBN}, and then re-display, all those 176b725ae77Skettenisvalues. The client should instead only request and update the values 177b725ae77Skettenisthat changed. 178b725ae77Skettenis 179b725ae77SkettenisThe @sc{gdb/mi} Variable Objects provide just that mechanism. 180b725ae77Skettenis 181b725ae77Skettenis@section Correctness 182b725ae77Skettenis 183b725ae77SkettenisThe annotation interface assumes that a variable's value can only be 184b725ae77Skettenischanged when the target is running. This assumption is not correct. A 185b725ae77Skettenissingle assignment to a single variable can result in the entire target, 186b725ae77Skettenisand all displayed values, needing an update. 187b725ae77Skettenis 188b725ae77SkettenisThe @sc{gdb/mi} Variable Objects include a mechanism for efficiently 189b725ae77Skettenisreporting such changes. 190b725ae77Skettenis 191b725ae77Skettenis@section Reliability 192b725ae77Skettenis 193b725ae77SkettenisThe @sc{gdb/mi} interface includes a dedicated test directory 194b725ae77Skettenis(@file{gdb/gdb.mi}), and any addition or fix to @sc{gdb/mi} must include 195b725ae77Skettenistestsuite changes. 196b725ae77Skettenis 197b725ae77Skettenis@section Maintainability 198b725ae77Skettenis 199b725ae77SkettenisThe annotation mechanism was implemented by interspersing @sc{cli} print 200b725ae77Skettenisstatements with various annotations. As a consequence, any @sc{cli} 201b725ae77Skettenisoutput change can alter the annotation output. 202b725ae77Skettenis 203b725ae77SkettenisSince the @sc{gdb/mi} output is independant of the @sc{cli}, and the 204b725ae77Skettenis@sc{gdb/mi} is increasingly implemented independant of the @sc{cli} 205b725ae77Sketteniscode, its long term maintenance is much easier. 206b725ae77Skettenis 207b725ae77Skettenis@node Migrating to GDB/MI 208b725ae77Skettenis@chapter Migrating to @sc{gdb/mi} 209b725ae77Skettenis 210b725ae77SkettenisBy using the @samp{interp mi} command, it is possible for annotation 211b725ae77Skettenisclients to invoke @sc{gdb/mi} commands, and hence access the 212b725ae77Skettenis@sc{gdb/mi}. By doing this, existing annotation clients have a 213b725ae77Skettenismigration path from this obsolete interface to @sc{gdb/mi}. 214b725ae77Skettenis 215b725ae77Skettenis@node Server Prefix 216b725ae77Skettenis@chapter The Server Prefix 217b725ae77Skettenis@cindex server prefix for annotations 218b725ae77Skettenis 219b725ae77SkettenisTo issue a command to @value{GDBN} without affecting certain aspects of 220b725ae77Skettenisthe state which is seen by users, prefix it with @samp{server }. This 221b725ae77Skettenismeans that this command will not affect the command history, nor will it 222b725ae77Skettenisaffect @value{GDBN}'s notion of which command to repeat if @key{RET} is 223b725ae77Skettenispressed on a line by itself. 224b725ae77Skettenis 225b725ae77SkettenisThe server prefix does not affect the recording of values into the value 226b725ae77Skettenishistory; to print a value without recording it into the value history, 227b725ae77Skettenisuse the @code{output} command instead of the @code{print} command. 228b725ae77Skettenis 229b725ae77Skettenis@node Value Annotations 230b725ae77Skettenis@chapter Values 231b725ae77Skettenis 232b725ae77Skettenis@emph{Value Annotations have been removed. @sc{gdb/mi} instead provides 233b725ae77SkettenisVariable Objects.} 234b725ae77Skettenis 235b725ae77Skettenis@cindex annotations for values 236b725ae77SkettenisWhen a value is printed in various contexts, @value{GDBN} uses 237b725ae77Skettenisannotations to delimit the value from the surrounding text. 238b725ae77Skettenis 239b725ae77Skettenis@findex value-history-begin 240b725ae77Skettenis@findex value-history-value 241b725ae77Skettenis@findex value-history-end 242b725ae77SkettenisIf a value is printed using @code{print} and added to the value history, 243b725ae77Skettenisthe annotation looks like 244b725ae77Skettenis 245b725ae77Skettenis@smallexample 246b725ae77Skettenis^Z^Zvalue-history-begin @var{history-number} @var{value-flags} 247b725ae77Skettenis@var{history-string} 248b725ae77Skettenis^Z^Zvalue-history-value 249b725ae77Skettenis@var{the-value} 250b725ae77Skettenis^Z^Zvalue-history-end 251b725ae77Skettenis@end smallexample 252b725ae77Skettenis 253b725ae77Skettenis@noindent 254b725ae77Sketteniswhere @var{history-number} is the number it is getting in the value 255b725ae77Skettenishistory, @var{history-string} is a string, such as @samp{$5 = }, which 256b725ae77Skettenisintroduces the value to the user, @var{the-value} is the output 257b725ae77Sketteniscorresponding to the value itself, and @var{value-flags} is @samp{*} for 258b725ae77Skettenisa value which can be dereferenced and @samp{-} for a value which cannot. 259b725ae77Skettenis 260b725ae77Skettenis@findex value-begin 261b725ae77Skettenis@findex value-end 262b725ae77SkettenisIf the value is not added to the value history (it is an invalid float 263b725ae77Skettenisor it is printed with the @code{output} command), the annotation is similar: 264b725ae77Skettenis 265b725ae77Skettenis@smallexample 266b725ae77Skettenis^Z^Zvalue-begin @var{value-flags} 267b725ae77Skettenis@var{the-value} 268b725ae77Skettenis^Z^Zvalue-end 269b725ae77Skettenis@end smallexample 270b725ae77Skettenis 271b725ae77Skettenis@findex arg-begin 272b725ae77Skettenis@findex arg-name-end 273b725ae77Skettenis@findex arg-value 274b725ae77Skettenis@findex arg-end 275b725ae77SkettenisWhen @value{GDBN} prints an argument to a function (for example, in the output 276b725ae77Skettenisfrom the @code{backtrace} command), it annotates it as follows: 277b725ae77Skettenis 278b725ae77Skettenis@smallexample 279b725ae77Skettenis^Z^Zarg-begin 280b725ae77Skettenis@var{argument-name} 281b725ae77Skettenis^Z^Zarg-name-end 282b725ae77Skettenis@var{separator-string} 283b725ae77Skettenis^Z^Zarg-value @var{value-flags} 284b725ae77Skettenis@var{the-value} 285b725ae77Skettenis^Z^Zarg-end 286b725ae77Skettenis@end smallexample 287b725ae77Skettenis 288b725ae77Skettenis@noindent 289b725ae77Sketteniswhere @var{argument-name} is the name of the argument, 290b725ae77Skettenis@var{separator-string} is text which separates the name from the value 291b725ae77Skettenisfor the user's benefit (such as @samp{=}), and @var{value-flags} and 292b725ae77Skettenis@var{the-value} have the same meanings as in a 293b725ae77Skettenis@code{value-history-begin} annotation. 294b725ae77Skettenis 295b725ae77Skettenis@findex field-begin 296b725ae77Skettenis@findex field-name-end 297b725ae77Skettenis@findex field-value 298b725ae77Skettenis@findex field-end 299b725ae77SkettenisWhen printing a structure, @value{GDBN} annotates it as follows: 300b725ae77Skettenis 301b725ae77Skettenis@smallexample 302b725ae77Skettenis^Z^Zfield-begin @var{value-flags} 303b725ae77Skettenis@var{field-name} 304b725ae77Skettenis^Z^Zfield-name-end 305b725ae77Skettenis@var{separator-string} 306b725ae77Skettenis^Z^Zfield-value 307b725ae77Skettenis@var{the-value} 308b725ae77Skettenis^Z^Zfield-end 309b725ae77Skettenis@end smallexample 310b725ae77Skettenis 311b725ae77Skettenis@noindent 312b725ae77Sketteniswhere @var{field-name} is the name of the field, @var{separator-string} 313b725ae77Skettenisis text which separates the name from the value for the user's benefit 314b725ae77Skettenis(such as @samp{=}), and @var{value-flags} and @var{the-value} have the 315b725ae77Skettenissame meanings as in a @code{value-history-begin} annotation. 316b725ae77Skettenis 317b725ae77SkettenisWhen printing an array, @value{GDBN} annotates it as follows: 318b725ae77Skettenis 319b725ae77Skettenis@smallexample 320b725ae77Skettenis^Z^Zarray-section-begin @var{array-index} @var{value-flags} 321b725ae77Skettenis@end smallexample 322b725ae77Skettenis 323b725ae77Skettenis@noindent 324b725ae77Sketteniswhere @var{array-index} is the index of the first element being 325b725ae77Skettenisannotated and @var{value-flags} has the same meaning as in a 326b725ae77Skettenis@code{value-history-begin} annotation. This is followed by any number 327b725ae77Skettenisof elements, where is element can be either a single element: 328b725ae77Skettenis 329b725ae77Skettenis@findex elt 330b725ae77Skettenis@smallexample 331b725ae77Skettenis@samp{,} @var{whitespace} ; @r{omitted for the first element} 332b725ae77Skettenis@var{the-value} 333b725ae77Skettenis^Z^Zelt 334b725ae77Skettenis@end smallexample 335b725ae77Skettenis 336b725ae77Skettenisor a repeated element 337b725ae77Skettenis 338b725ae77Skettenis@findex elt-rep 339b725ae77Skettenis@findex elt-rep-end 340b725ae77Skettenis@smallexample 341b725ae77Skettenis@samp{,} @var{whitespace} ; @r{omitted for the first element} 342b725ae77Skettenis@var{the-value} 343b725ae77Skettenis^Z^Zelt-rep @var{number-of-repetitions} 344b725ae77Skettenis@var{repetition-string} 345b725ae77Skettenis^Z^Zelt-rep-end 346b725ae77Skettenis@end smallexample 347b725ae77Skettenis 348b725ae77SkettenisIn both cases, @var{the-value} is the output for the value of the 349b725ae77Sketteniselement and @var{whitespace} can contain spaces, tabs, and newlines. In 350b725ae77Skettenisthe repeated case, @var{number-of-repetitions} is the number of 351b725ae77Skettenisconsecutive array elements which contain that value, and 352b725ae77Skettenis@var{repetition-string} is a string which is designed to convey to the 353b725ae77Skettenisuser that repetition is being depicted. 354b725ae77Skettenis 355b725ae77Skettenis@findex array-section-end 356b725ae77SkettenisOnce all the array elements have been output, the array annotation is 357b725ae77Skettenisended with 358b725ae77Skettenis 359b725ae77Skettenis@smallexample 360b725ae77Skettenis^Z^Zarray-section-end 361b725ae77Skettenis@end smallexample 362b725ae77Skettenis 363b725ae77Skettenis@node Frame Annotations 364b725ae77Skettenis@chapter Frames 365b725ae77Skettenis 366b725ae77Skettenis@emph{Value Annotations have been removed. @sc{gdb/mi} instead provides 367b725ae77Skettenisa number of frame commands.} 368b725ae77Skettenis 369b725ae77Skettenis@emph{Frame annotations are no longer available. The @sc{gdb/mi} 370b725ae77Skettenisprovides @samp{-stack-list-arguments}, @samp{-stack-list-locals}, and 371b725ae77Skettenis@samp{-stack-list-frames} commands.} 372b725ae77Skettenis 373b725ae77Skettenis@cindex annotations for frames 374b725ae77SkettenisWhenever @value{GDBN} prints a frame, it annotates it. For example, this applies 375b725ae77Skettenisto frames printed when @value{GDBN} stops, output from commands such as 376b725ae77Skettenis@code{backtrace} or @code{up}, etc. 377b725ae77Skettenis 378b725ae77Skettenis@findex frame-begin 379b725ae77SkettenisThe frame annotation begins with 380b725ae77Skettenis 381b725ae77Skettenis@smallexample 382b725ae77Skettenis^Z^Zframe-begin @var{level} @var{address} 383b725ae77Skettenis@var{level-string} 384b725ae77Skettenis@end smallexample 385b725ae77Skettenis 386b725ae77Skettenis@noindent 387b725ae77Sketteniswhere @var{level} is the number of the frame (0 is the innermost frame, 388b725ae77Skettenisand other frames have positive numbers), @var{address} is the address of 389b725ae77Skettenisthe code executing in that frame, and @var{level-string} is a string 390b725ae77Skettenisdesigned to convey the level to the user. @var{address} is in the form 391b725ae77Skettenis@samp{0x} followed by one or more lowercase hex digits (note that this 392b725ae77Skettenisdoes not depend on the language). The frame ends with 393b725ae77Skettenis 394b725ae77Skettenis@findex frame-end 395b725ae77Skettenis@smallexample 396b725ae77Skettenis^Z^Zframe-end 397b725ae77Skettenis@end smallexample 398b725ae77Skettenis 399b725ae77SkettenisBetween these annotations is the main body of the frame, which can 400b725ae77Skettenisconsist of 401b725ae77Skettenis 402b725ae77Skettenis@itemize @bullet 403b725ae77Skettenis@item 404b725ae77Skettenis@findex function-call 405b725ae77Skettenis@smallexample 406b725ae77Skettenis^Z^Zfunction-call 407b725ae77Skettenis@var{function-call-string} 408b725ae77Skettenis@end smallexample 409b725ae77Skettenis 410b725ae77Sketteniswhere @var{function-call-string} is text designed to convey to the user 411b725ae77Skettenisthat this frame is associated with a function call made by @value{GDBN} to a 412b725ae77Skettenisfunction in the program being debugged. 413b725ae77Skettenis 414b725ae77Skettenis@item 415b725ae77Skettenis@findex signal-handler-caller 416b725ae77Skettenis@smallexample 417b725ae77Skettenis^Z^Zsignal-handler-caller 418b725ae77Skettenis@var{signal-handler-caller-string} 419b725ae77Skettenis@end smallexample 420b725ae77Skettenis 421b725ae77Sketteniswhere @var{signal-handler-caller-string} is text designed to convey to 422b725ae77Skettenisthe user that this frame is associated with whatever mechanism is used 423b725ae77Skettenisby this operating system to call a signal handler (it is the frame which 424b725ae77Sketteniscalls the signal handler, not the frame for the signal handler itself). 425b725ae77Skettenis 426b725ae77Skettenis@item 427b725ae77SkettenisA normal frame. 428b725ae77Skettenis 429b725ae77Skettenis@findex frame-address 430b725ae77Skettenis@findex frame-address-end 431b725ae77SkettenisThis can optionally (depending on whether this is thought of as 432b725ae77Skettenisinteresting information for the user to see) begin with 433b725ae77Skettenis 434b725ae77Skettenis@smallexample 435b725ae77Skettenis^Z^Zframe-address 436b725ae77Skettenis@var{address} 437b725ae77Skettenis^Z^Zframe-address-end 438b725ae77Skettenis@var{separator-string} 439b725ae77Skettenis@end smallexample 440b725ae77Skettenis 441b725ae77Sketteniswhere @var{address} is the address executing in the frame (the same 442b725ae77Skettenisaddress as in the @code{frame-begin} annotation, but printed in a form 443b725ae77Sketteniswhich is intended for user consumption---in particular, the syntax varies 444b725ae77Skettenisdepending on the language), and @var{separator-string} is a string 445b725ae77Skettenisintended to separate this address from what follows for the user's 446b725ae77Skettenisbenefit. 447b725ae77Skettenis 448b725ae77Skettenis@findex frame-function-name 449b725ae77Skettenis@findex frame-args 450b725ae77SkettenisThen comes 451b725ae77Skettenis 452b725ae77Skettenis@smallexample 453b725ae77Skettenis^Z^Zframe-function-name 454b725ae77Skettenis@var{function-name} 455b725ae77Skettenis^Z^Zframe-args 456b725ae77Skettenis@var{arguments} 457b725ae77Skettenis@end smallexample 458b725ae77Skettenis 459b725ae77Sketteniswhere @var{function-name} is the name of the function executing in the 460b725ae77Skettenisframe, or @samp{??} if not known, and @var{arguments} are the arguments 461b725ae77Skettenisto the frame, with parentheses around them (each argument is annotated 462b725ae77Skettenisindividually as well, @pxref{Value Annotations}). 463b725ae77Skettenis 464b725ae77Skettenis@findex frame-source-begin 465b725ae77Skettenis@findex frame-source-file 466b725ae77Skettenis@findex frame-source-file-end 467b725ae77Skettenis@findex frame-source-line 468b725ae77Skettenis@findex frame-source-end 469b725ae77SkettenisIf source information is available, a reference to it is then printed: 470b725ae77Skettenis 471b725ae77Skettenis@smallexample 472b725ae77Skettenis^Z^Zframe-source-begin 473b725ae77Skettenis@var{source-intro-string} 474b725ae77Skettenis^Z^Zframe-source-file 475b725ae77Skettenis@var{filename} 476b725ae77Skettenis^Z^Zframe-source-file-end 477b725ae77Skettenis: 478b725ae77Skettenis^Z^Zframe-source-line 479b725ae77Skettenis@var{line-number} 480b725ae77Skettenis^Z^Zframe-source-end 481b725ae77Skettenis@end smallexample 482b725ae77Skettenis 483b725ae77Sketteniswhere @var{source-intro-string} separates for the user's benefit the 484b725ae77Skettenisreference from the text which precedes it, @var{filename} is the name of 485b725ae77Skettenisthe source file, and @var{line-number} is the line number within that 486b725ae77Skettenisfile (the first line is line 1). 487b725ae77Skettenis 488b725ae77Skettenis@findex frame-where 489b725ae77SkettenisIf @value{GDBN} prints some information about where the frame is from (which 490b725ae77Skettenislibrary, which load segment, etc.; currently only done on the RS/6000), 491b725ae77Skettenisit is annotated with 492b725ae77Skettenis 493b725ae77Skettenis@smallexample 494b725ae77Skettenis^Z^Zframe-where 495b725ae77Skettenis@var{information} 496b725ae77Skettenis@end smallexample 497b725ae77Skettenis 498b725ae77SkettenisThen, if source is to actually be displayed for this frame (for example, 499b725ae77Skettenisthis is not true for output from the @code{backtrace} command), then a 500b725ae77Skettenis@code{source} annotation (@pxref{Source Annotations}) is displayed. Unlike 501b725ae77Skettenismost annotations, this is output instead of the normal text which would be 502b725ae77Skettenisoutput, not in addition. 503b725ae77Skettenis@end itemize 504b725ae77Skettenis 505b725ae77Skettenis@node Displays 506b725ae77Skettenis@chapter Displays 507b725ae77Skettenis 508b725ae77Skettenis@emph{Display Annotations have been removed. @sc{gdb/mi} instead 509b725ae77Skettenisprovides Variable Objects.} 510b725ae77Skettenis 511b725ae77Skettenis@findex display-begin 512b725ae77Skettenis@findex display-number-end 513b725ae77Skettenis@findex display-format 514b725ae77Skettenis@findex display-expression 515b725ae77Skettenis@findex display-expression-end 516b725ae77Skettenis@findex display-value 517b725ae77Skettenis@findex display-end 518b725ae77Skettenis@cindex annotations for display 519b725ae77SkettenisWhen @value{GDBN} is told to display something using the @code{display} command, 520b725ae77Skettenisthe results of the display are annotated: 521b725ae77Skettenis 522b725ae77Skettenis@smallexample 523b725ae77Skettenis^Z^Zdisplay-begin 524b725ae77Skettenis@var{number} 525b725ae77Skettenis^Z^Zdisplay-number-end 526b725ae77Skettenis@var{number-separator} 527b725ae77Skettenis^Z^Zdisplay-format 528b725ae77Skettenis@var{format} 529b725ae77Skettenis^Z^Zdisplay-expression 530b725ae77Skettenis@var{expression} 531b725ae77Skettenis^Z^Zdisplay-expression-end 532b725ae77Skettenis@var{expression-separator} 533b725ae77Skettenis^Z^Zdisplay-value 534b725ae77Skettenis@var{value} 535b725ae77Skettenis^Z^Zdisplay-end 536b725ae77Skettenis@end smallexample 537b725ae77Skettenis 538b725ae77Skettenis@noindent 539b725ae77Sketteniswhere @var{number} is the number of the display, @var{number-separator} 540b725ae77Skettenisis intended to separate the number from what follows for the user, 541b725ae77Skettenis@var{format} includes information such as the size, format, or other 542b725ae77Skettenisinformation about how the value is being displayed, @var{expression} is 543b725ae77Skettenisthe expression being displayed, @var{expression-separator} is intended 544b725ae77Skettenisto separate the expression from the text that follows for the user, 545b725ae77Skettenisand @var{value} is the actual value being displayed. 546b725ae77Skettenis 547b725ae77Skettenis@node Prompting 548b725ae77Skettenis@chapter Annotation for @value{GDBN} Input 549b725ae77Skettenis 550b725ae77Skettenis@cindex annotations for prompts 551b725ae77SkettenisWhen @value{GDBN} prompts for input, it annotates this fact so it is possible 552b725ae77Skettenisto know when to send output, when the output from a given command is 553b725ae77Skettenisover, etc. 554b725ae77Skettenis 555b725ae77SkettenisDifferent kinds of input each have a different @dfn{input type}. Each 556b725ae77Skettenisinput type has three annotations: a @code{pre-} annotation, which 557b725ae77Skettenisdenotes the beginning of any prompt which is being output, a plain 558b725ae77Skettenisannotation, which denotes the end of the prompt, and then a @code{post-} 559b725ae77Skettenisannotation which denotes the end of any echo which may (or may not) be 560b725ae77Skettenisassociated with the input. For example, the @code{prompt} input type 561b725ae77Skettenisfeatures the following annotations: 562b725ae77Skettenis 563b725ae77Skettenis@smallexample 564b725ae77Skettenis^Z^Zpre-prompt 565b725ae77Skettenis^Z^Zprompt 566b725ae77Skettenis^Z^Zpost-prompt 567b725ae77Skettenis@end smallexample 568b725ae77Skettenis 569b725ae77SkettenisThe input types are 570b725ae77Skettenis 571b725ae77Skettenis@table @code 572b725ae77Skettenis@findex pre-prompt 573b725ae77Skettenis@findex prompt 574b725ae77Skettenis@findex post-prompt 575b725ae77Skettenis@item prompt 576b725ae77SkettenisWhen @value{GDBN} is prompting for a command (the main @value{GDBN} prompt). 577b725ae77Skettenis 578b725ae77Skettenis@findex pre-commands 579b725ae77Skettenis@findex commands 580b725ae77Skettenis@findex post-commands 581b725ae77Skettenis@item commands 582b725ae77SkettenisWhen @value{GDBN} prompts for a set of commands, like in the @code{commands} 583b725ae77Sketteniscommand. The annotations are repeated for each command which is input. 584b725ae77Skettenis 585b725ae77Skettenis@findex pre-overload-choice 586b725ae77Skettenis@findex overload-choice 587b725ae77Skettenis@findex post-overload-choice 588b725ae77Skettenis@item overload-choice 589b725ae77SkettenisWhen @value{GDBN} wants the user to select between various overloaded functions. 590b725ae77Skettenis 591b725ae77Skettenis@findex pre-query 592b725ae77Skettenis@findex query 593b725ae77Skettenis@findex post-query 594b725ae77Skettenis@item query 595b725ae77SkettenisWhen @value{GDBN} wants the user to confirm a potentially dangerous operation. 596b725ae77Skettenis 597b725ae77Skettenis@findex pre-prompt-for-continue 598b725ae77Skettenis@findex prompt-for-continue 599b725ae77Skettenis@findex post-prompt-for-continue 600b725ae77Skettenis@item prompt-for-continue 601b725ae77SkettenisWhen @value{GDBN} is asking the user to press return to continue. Note: Don't 602b725ae77Skettenisexpect this to work well; instead use @code{set height 0} to disable 603b725ae77Skettenisprompting. This is because the counting of lines is buggy in the 604b725ae77Skettenispresence of annotations. 605b725ae77Skettenis@end table 606b725ae77Skettenis 607b725ae77Skettenis@node Errors 608b725ae77Skettenis@chapter Errors 609b725ae77Skettenis@cindex annotations for errors, warnings and interrupts 610b725ae77Skettenis 611b725ae77Skettenis@findex quit 612b725ae77Skettenis@smallexample 613b725ae77Skettenis^Z^Zquit 614b725ae77Skettenis@end smallexample 615b725ae77Skettenis 616b725ae77SkettenisThis annotation occurs right before @value{GDBN} responds to an interrupt. 617b725ae77Skettenis 618b725ae77Skettenis@findex error 619b725ae77Skettenis@smallexample 620b725ae77Skettenis^Z^Zerror 621b725ae77Skettenis@end smallexample 622b725ae77Skettenis 623b725ae77SkettenisThis annotation occurs right before @value{GDBN} responds to an error. 624b725ae77Skettenis 625b725ae77SkettenisQuit and error annotations indicate that any annotations which @value{GDBN} was 626b725ae77Skettenisin the middle of may end abruptly. For example, if a 627b725ae77Skettenis@code{value-history-begin} annotation is followed by a @code{error}, one 628b725ae77Sketteniscannot expect to receive the matching @code{value-history-end}. One 629b725ae77Sketteniscannot expect not to receive it either, however; an error annotation 630b725ae77Skettenisdoes not necessarily mean that @value{GDBN} is immediately returning all the way 631b725ae77Skettenisto the top level. 632b725ae77Skettenis 633b725ae77Skettenis@findex error-begin 634b725ae77SkettenisA quit or error annotation may be preceded by 635b725ae77Skettenis 636b725ae77Skettenis@smallexample 637b725ae77Skettenis^Z^Zerror-begin 638b725ae77Skettenis@end smallexample 639b725ae77Skettenis 640b725ae77SkettenisAny output between that and the quit or error annotation is the error 641b725ae77Skettenismessage. 642b725ae77Skettenis 643b725ae77SkettenisWarning messages are not yet annotated. 644b725ae77Skettenis@c If we want to change that, need to fix warning(), type_error(), 645b725ae77Skettenis@c range_error(), and possibly other places. 646b725ae77Skettenis 647b725ae77Skettenis@node Breakpoint Info 648b725ae77Skettenis@chapter Information on Breakpoints 649b725ae77Skettenis 650b725ae77Skettenis@emph{Breakpoint Annotations have been removed. @sc{gdb/mi} instead 651b725ae77Skettenisprovides breakpoint commands.} 652b725ae77Skettenis 653b725ae77Skettenis@cindex annotations for breakpoints 654b725ae77SkettenisThe output from the @code{info breakpoints} command is annotated as follows: 655b725ae77Skettenis 656b725ae77Skettenis@findex breakpoints-headers 657b725ae77Skettenis@findex breakpoints-table 658b725ae77Skettenis@smallexample 659b725ae77Skettenis^Z^Zbreakpoints-headers 660b725ae77Skettenis@var{header-entry} 661b725ae77Skettenis^Z^Zbreakpoints-table 662b725ae77Skettenis@end smallexample 663b725ae77Skettenis 664b725ae77Skettenis@noindent 665b725ae77Sketteniswhere @var{header-entry} has the same syntax as an entry (see below) but 666b725ae77Skettenisinstead of containing data, it contains strings which are intended to 667b725ae77Skettenisconvey the meaning of each field to the user. This is followed by any 668b725ae77Skettenisnumber of entries. If a field does not apply for this entry, it is 669b725ae77Skettenisomitted. Fields may contain trailing whitespace. Each entry consists 670b725ae77Skettenisof: 671b725ae77Skettenis 672b725ae77Skettenis@findex record 673b725ae77Skettenis@findex field 674b725ae77Skettenis@smallexample 675b725ae77Skettenis^Z^Zrecord 676b725ae77Skettenis^Z^Zfield 0 677b725ae77Skettenis@var{number} 678b725ae77Skettenis^Z^Zfield 1 679b725ae77Skettenis@var{type} 680b725ae77Skettenis^Z^Zfield 2 681b725ae77Skettenis@var{disposition} 682b725ae77Skettenis^Z^Zfield 3 683b725ae77Skettenis@var{enable} 684b725ae77Skettenis^Z^Zfield 4 685b725ae77Skettenis@var{address} 686b725ae77Skettenis^Z^Zfield 5 687b725ae77Skettenis@var{what} 688b725ae77Skettenis^Z^Zfield 6 689b725ae77Skettenis@var{frame} 690b725ae77Skettenis^Z^Zfield 7 691b725ae77Skettenis@var{condition} 692b725ae77Skettenis^Z^Zfield 8 693b725ae77Skettenis@var{ignore-count} 694b725ae77Skettenis^Z^Zfield 9 695b725ae77Skettenis@var{commands} 696b725ae77Skettenis@end smallexample 697b725ae77Skettenis 698b725ae77SkettenisNote that @var{address} is intended for user consumption---the syntax 699b725ae77Skettenisvaries depending on the language. 700b725ae77Skettenis 701b725ae77SkettenisThe output ends with 702b725ae77Skettenis 703b725ae77Skettenis@findex breakpoints-table-end 704b725ae77Skettenis@smallexample 705b725ae77Skettenis^Z^Zbreakpoints-table-end 706b725ae77Skettenis@end smallexample 707b725ae77Skettenis 708b725ae77Skettenis@node Invalidation 709b725ae77Skettenis@chapter Invalidation Notices 710b725ae77Skettenis 711b725ae77Skettenis@cindex annotations for invalidation messages 712b725ae77SkettenisThe following annotations say that certain pieces of state may have 713b725ae77Skettenischanged. 714b725ae77Skettenis 715b725ae77Skettenis@table @code 716b725ae77Skettenis@findex frames-invalid 717b725ae77Skettenis@item ^Z^Zframes-invalid 718b725ae77Skettenis 719b725ae77SkettenisThe frames (for example, output from the @code{backtrace} command) may 720b725ae77Skettenishave changed. 721b725ae77Skettenis 722b725ae77Skettenis@findex breakpoints-invalid 723b725ae77Skettenis@item ^Z^Zbreakpoints-invalid 724b725ae77Skettenis 725b725ae77SkettenisThe breakpoints may have changed. For example, the user just added or 726b725ae77Skettenisdeleted a breakpoint. 727b725ae77Skettenis@end table 728b725ae77Skettenis 729b725ae77Skettenis@node Annotations for Running 730b725ae77Skettenis@chapter Running the Program 731b725ae77Skettenis@cindex annotations for running programs 732b725ae77Skettenis 733b725ae77Skettenis@findex starting 734b725ae77Skettenis@findex stopping 735b725ae77SkettenisWhen the program starts executing due to a @value{GDBN} command such as 736b725ae77Skettenis@code{step} or @code{continue}, 737b725ae77Skettenis 738b725ae77Skettenis@smallexample 739b725ae77Skettenis^Z^Zstarting 740b725ae77Skettenis@end smallexample 741b725ae77Skettenis 742b725ae77Skettenisis output. When the program stops, 743b725ae77Skettenis 744b725ae77Skettenis@smallexample 745b725ae77Skettenis^Z^Zstopped 746b725ae77Skettenis@end smallexample 747b725ae77Skettenis 748b725ae77Skettenisis output. Before the @code{stopped} annotation, a variety of 749b725ae77Skettenisannotations describe how the program stopped. 750b725ae77Skettenis 751b725ae77Skettenis@table @code 752b725ae77Skettenis@findex exited 753b725ae77Skettenis@item ^Z^Zexited @var{exit-status} 754b725ae77SkettenisThe program exited, and @var{exit-status} is the exit status (zero for 755b725ae77Skettenissuccessful exit, otherwise nonzero). 756b725ae77Skettenis 757b725ae77Skettenis@findex signalled 758b725ae77Skettenis@findex signal-name 759b725ae77Skettenis@findex signal-name-end 760b725ae77Skettenis@findex signal-string 761b725ae77Skettenis@findex signal-string-end 762b725ae77Skettenis@item ^Z^Zsignalled 763b725ae77SkettenisThe program exited with a signal. After the @code{^Z^Zsignalled}, the 764b725ae77Skettenisannotation continues: 765b725ae77Skettenis 766b725ae77Skettenis@smallexample 767b725ae77Skettenis@var{intro-text} 768b725ae77Skettenis^Z^Zsignal-name 769b725ae77Skettenis@var{name} 770b725ae77Skettenis^Z^Zsignal-name-end 771b725ae77Skettenis@var{middle-text} 772b725ae77Skettenis^Z^Zsignal-string 773b725ae77Skettenis@var{string} 774b725ae77Skettenis^Z^Zsignal-string-end 775b725ae77Skettenis@var{end-text} 776b725ae77Skettenis@end smallexample 777b725ae77Skettenis 778b725ae77Skettenis@noindent 779b725ae77Sketteniswhere @var{name} is the name of the signal, such as @code{SIGILL} or 780b725ae77Skettenis@code{SIGSEGV}, and @var{string} is the explanation of the signal, such 781b725ae77Skettenisas @code{Illegal Instruction} or @code{Segmentation fault}. 782b725ae77Skettenis@var{intro-text}, @var{middle-text}, and @var{end-text} are for the 783b725ae77Skettenisuser's benefit and have no particular format. 784b725ae77Skettenis 785b725ae77Skettenis@findex signal 786b725ae77Skettenis@item ^Z^Zsignal 787b725ae77SkettenisThe syntax of this annotation is just like @code{signalled}, but @value{GDBN} is 788b725ae77Skettenisjust saying that the program received the signal, not that it was 789b725ae77Skettenisterminated with it. 790b725ae77Skettenis 791b725ae77Skettenis@findex breakpoint 792b725ae77Skettenis@item ^Z^Zbreakpoint @var{number} 793b725ae77SkettenisThe program hit breakpoint number @var{number}. 794b725ae77Skettenis 795b725ae77Skettenis@findex watchpoint 796b725ae77Skettenis@item ^Z^Zwatchpoint @var{number} 797b725ae77SkettenisThe program hit watchpoint number @var{number}. 798b725ae77Skettenis@end table 799b725ae77Skettenis 800b725ae77Skettenis@node Source Annotations 801b725ae77Skettenis@chapter Displaying Source 802b725ae77Skettenis@cindex annotations for source display 803b725ae77Skettenis 804b725ae77Skettenis@findex source 805b725ae77SkettenisThe following annotation is used instead of displaying source code: 806b725ae77Skettenis 807b725ae77Skettenis@smallexample 808b725ae77Skettenis^Z^Zsource @var{filename}:@var{line}:@var{character}:@var{middle}:@var{addr} 809b725ae77Skettenis@end smallexample 810b725ae77Skettenis 811b725ae77Sketteniswhere @var{filename} is an absolute file name indicating which source 812b725ae77Skettenisfile, @var{line} is the line number within that file (where 1 is the 813b725ae77Skettenisfirst line in the file), @var{character} is the character position 814b725ae77Sketteniswithin the file (where 0 is the first character in the file) (for most 815b725ae77Skettenisdebug formats this will necessarily point to the beginning of a line), 816b725ae77Skettenis@var{middle} is @samp{middle} if @var{addr} is in the middle of the 817b725ae77Skettenisline, or @samp{beg} if @var{addr} is at the beginning of the line, and 818b725ae77Skettenis@var{addr} is the address in the target program associated with the 819b725ae77Skettenissource which is being displayed. @var{addr} is in the form @samp{0x} 820b725ae77Skettenisfollowed by one or more lowercase hex digits (note that this does not 821b725ae77Skettenisdepend on the language). 822b725ae77Skettenis 823b725ae77Skettenis@raisesections 824b725ae77Skettenis@include fdl.texi 825b725ae77Skettenis@lowersections 826b725ae77Skettenis 827b725ae77Skettenis@ignore 828b725ae77Skettenis@node Index 829b725ae77Skettenis@unnumbered Index 830b725ae77Skettenis 831b725ae77Skettenis@printindex fn 832b725ae77Skettenis@end ignore 833b725ae77Skettenis 834b725ae77Skettenis@bye 835