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