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