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