509ea6ce25bd2083a1c17d6903f98a5fee3bed62
[binutils-gdb.git] / gdb / mi / gdbmi.texinfo
1 @c \input texinfo @c -*-texinfo-*-
2 @c @c %**start of header
3 @c @setfilename gdbmi.info
4 @c @settitle GDB/MI Machine Interface
5 @c @setchapternewpage off
6 @c @c %**end of header
7
8 @c @ifinfo
9 @c This file documents GDB/MI, a Machine Interface to GDB.
10
11 @c Copyright (C) 2000, Free Software Foundation, Inc.
12 @c Contributed by Cygnus Solutions.
13
14 @c Permission is granted to make and distribute verbatim copies of this
15 @c manual provided the copyright notice and this permission notice are
16 @c preserved on all copies.
17
18 @c @ignore
19 @c Permission is granted to process this file through TeX and print the
20 @c results, provided the printed document carries copying permission notice
21 @c identical to this one except for the removal of this paragraph (this
22 @c paragraph not being relevant to the printed manual).
23
24 @c @end ignore
25 @c Permission is granted to copy and distribute modified versions of this
26 @c manual under the conditions for verbatim copying, provided also that the
27 @c entire resulting derived work is distributed under the terms of a
28 @c permission notice identical to this one.
29
30 @c Permission is granted to copy and distribute translations of this manual
31 @c into another language, under the above conditions for modified versions.
32 @c @end ifinfo
33
34 @c @c This title page illustrates only one of the
35 @c @c two methods of forming a title page.
36
37 @c @titlepage
38 @c @title GDB/MI
39 @c @subtitle Version 0.2
40 @c @subtitle Feb 2000
41 @c @author Andrew Cagney, Fernando Nasser and Elena Zannoni
42
43 @c @c The following two commands
44 @c @c start the copyright page.
45 @c @page
46 @c @vskip 0pt plus 1filll
47 @c Permission is granted to make and distribute verbatim copies of this
48 @c manual provided the copyright notice and this permission notice are
49 @c preserved on all copies.
50
51 @c Copyright @copyright{} 2000, Free Software Foundation, Inc.
52 @c @end titlepage
53
54 @c %%%%%%%%%%%%%%%%%%%%%%%%%%%% CHAPTER %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
55 @node GDB/MI
56 @chapter The @sc{gdb/mi} Interface
57
58 @unnumberedsec Function and Purpose
59
60 @cindex @sc{gdb/mi}, its purpose
61 @sc{gdb/mi} is a line based machine oriented text interface to GDB. It is
62 specifically intended to support the development of systems which use
63 the debugger as just one small component of a larger system.
64
65 This chapter is a specification of the @sc{gdb/mi} interface. It is written
66 in the form of a reference manual.
67
68 Note that @sc{gdb/mi} is still under construction, so some of the
69 features described below are incomplete and subject to change.
70
71 @unnumberedsec Notation and Terminology
72
73 @cindex notational conventions, for @sc{gdb/mi}
74 This chapter uses the following notation:
75
76 @itemize @bullet
77 @item
78 @code{|} separates two alternatives.
79
80 @item
81 @code{[ @var{something} ]} indicates that @var{something} is optional:
82 it may or may not be given.
83
84 @item
85 @code{( @var{group} )*} means that @var{group} inside the parentheses
86 may repeat zero or more times.
87
88 @item
89 @code{( @var{group} )+} means that @var{group} inside the parentheses
90 may repeat one or more times.
91
92 @item
93 @code{"@var{string}"} means a literal @var{string}.
94 @end itemize
95
96 @ignore
97 @heading Dependencies
98 @end ignore
99
100 @heading Acknowledgments
101
102 In alphabetic order: Andrew Cagney, Fernando Nasser, Stan Shebs and
103 Elena Zannoni.
104
105 @menu
106 * GDB/MI Command Syntax::
107 * GDB/MI Compatibility with CLI::
108 * GDB/MI Output Records::
109 * GDB/MI Command Description Format::
110 * GDB/MI Breakpoint Table Commands::
111 * GDB/MI Data Manipulation::
112 * GDB/MI Program Control::
113 * GDB/MI Misc Commands::
114 * GDB/MI Stack Manipulation::
115 * GDB/MI Symbol Query::
116 * GDB/MI Target Manipulation::
117 * GDB/MI Thread Commands::
118 * GDB/MI Tracepoint Commands::
119 * GDB/MI Variable Objects::
120 * GDB/MI Draft Changes to Output Syntax::
121 @end menu
122
123 @c When these are implemented, they should be moved to be between Misc and
124 @c Stack Manipulation in the above menu. They are now outside the menu
125 @c because makeinfo 3.12 barfs if it sees @ignore or @comments in the
126 @c middle of a menu.
127 @ignore
128 * GDB/MI Kod Commands::
129 * GDB/MI Memory Overlay Commands::
130 * GDB/MI Signal Handling Commands::
131 @end ignore
132
133 @c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
134 @node GDB/MI Command Syntax
135 @section @sc{gdb/mi} Command Syntax
136
137 @menu
138 * GDB/MI Input Syntax::
139 * GDB/MI Output Syntax::
140 * GDB/MI Simple Examples::
141 @end menu
142
143 @node GDB/MI Input Syntax
144 @subsection @sc{gdb/mi} Input Syntax
145
146 @cindex input syntax for @sc{gdb/mi}
147 @cindex @sc{gdb/mi}, input syntax
148 @table @code
149 @item @var{command} @expansion{}
150 @code{@var{cli-command} | @var{mi-command}}
151
152 @item @var{cli-command} @expansion{}
153 @code{[ @var{token} ] @var{cli-command} @var{nl}}, where
154 @var{cli-command} is any existing GDB CLI command.
155
156 @item @var{mi-command} @expansion{}
157 @code{[ @var{token} ] "-" @var{operation} ( " " @var{option} )*
158 @code{[} " --" @code{]} ( " " @var{parameter} )* @var{nl}}
159
160 @item @var{token} @expansion{}
161 @code{"any sequence of digits"}
162
163 @item @var{option} @expansion{}
164 @code{"-" @var{parameter} [ " " @var{parameter} ]}
165
166 @item @var{parameter} @expansion{}
167 @code{@var{non-blank-sequence} | @var{c-string}}
168
169 @item @var{operation} @expansion{}
170 @emph{any of the operations described in this document}
171
172 @item @var{non-blank-sequence} @expansion{}
173 @emph{anything, provided it doesn't contain special characters such as
174 "-", @var{nl}, """ and of course " "}
175
176 @item @var{c-string} @expansion{}
177 @code{""" @var{seven-bit-iso-c-string-content} """}
178
179 @item @var{nl} @expansion{}
180 @code{CR | CR-LF}
181 @end table
182
183 Notes:
184
185 @itemize @bullet
186 @item
187 The CLI commands are still handled by the @sc{mi} interpreter; their
188 output is described below.
189
190 @item
191 The @code{@var{token}}, when present, is passed back when the command
192 finishes.
193
194 @item
195 Some @sc{mi} commands accept optional arguments as part of the parameter
196 list. Each option is identified by a leading @samp{-} (dash) and may be
197 followed by an optional argument parameter. Options occur first in the
198 parameter list and can be delimited from normal parameters using
199 @samp{--} (this is useful when some parameters begin with a dash).
200 @end itemize
201
202 Pragmatics:
203
204 @itemize @bullet
205 @item
206 We want easy access to the existing CLI syntax (for debugging).
207
208 @item
209 We want it to be easy to spot a @sc{mi} operation.
210 @end itemize
211
212 @node GDB/MI Output Syntax
213 @subsection @sc{gdb/mi} Output Syntax
214
215 @cindex output syntax of @sc{gdb/mi}
216 @cindex @sc{gdb/mi}, output syntax
217 The output from @sc{gdb/mi} consists of zero or more out-of-band records
218 followed, optionally, by a single result record. The result record
219 being for the most recent command. The sequence of output records is
220 terminated by @samp{(gdb)}.
221
222 If an input command was prefixed with a @code{@var{token}} then the
223 corresponding output for that command will also be prefixed by that same
224 @var{token}.
225
226 @table @code
227 @item @var{output} @expansion{}
228 @code{( @var{out-of-band-record} )* [ @var{result-record} ] "(gdb)" @var{nl}}
229
230 @item @var{result-record} @expansion{}
231 @code{ [ @var{token} ] "^" @var{result-class} ( "," @var{result} )* @var{nl}}
232
233 @item @var{out-of-band-record} @expansion{}
234 @code{@var{async-record} | @var{stream-record}}
235
236 @item @var{async-record} @expansion{}
237 @code{@var{exec-async-output} | @var{status-async-output} | @var{notify-async-output}}
238
239 @item @var{exec-async-output} @expansion{}
240 @code{[ @var{token} ] "*" @var{async-output}}
241
242 @item @var{status-async-output} @expansion{}
243 @code{[ @var{token} ] "+" @var{async-output}}
244
245 @item @var{notify-async-output} @expansion{}
246 @code{[ @var{token} ] "=" @var{async-output}}
247
248 @item @var{async-output} @expansion{}
249 @code{@var{async-class} ( "," @var{result} )* @var{nl}}
250
251 @item @var{result-class} @expansion{}
252 @code{"done" | "running" | "connected" | "error" | "exit"}
253
254 @item @var{async-class} @expansion{}
255 @code{"stopped" | @var{others}} (where @var{others} will be added
256 depending on the needs---this is still in development).
257
258 @item @var{result} @expansion{}
259 @code{[ @var{string} "=" ] @var{value}}
260
261 @item @var{value} @expansion{}
262 @code{@var{const} | "@{" @var{result} ( "," @var{result} )* "@}"}
263
264 @item @var{const} @expansion{}
265 @code{@var{c-string}}
266
267 @item @var{stream-record} @expansion{}
268 @code{@var{console-stream-output} | @var{target-stream-output} | @var{log-stream-output}}
269
270 @item @var{console-stream-output} @expansion{}
271 @code{"~" @var{c-string}}
272
273 @item @var{target-stream-output} @expansion{}
274 @code{"@@" @var{c-string}}
275
276 @item @var{log-stream-output} @expansion{}
277 @code{"&" @var{c-string}}
278
279 @item @var{nl} @expansion{}
280 @code{CR | CR-LF}
281
282 @item @var{token} @expansion{}
283 @emph{any sequence of digits}.
284 @end table
285
286 In addition, the following are still being developed:
287
288 @table @code
289 @item @var{query}
290 This action is currently undefined.
291 @end table
292
293 Notes:
294
295 @itemize @bullet
296 @item
297 All output sequences end in a single line containing a period.
298
299 @item
300 The @code{@var{token}} is from the corresponding request. If an execution
301 command is interrupted by the @samp{-exec-interrupt} command, the
302 @var{token} associated with the `*stopped' message is the one of the
303 original execution command, not the one of the interrupt-command.
304
305 @item
306 @cindex status output in @sc{gdb/mi}
307 @var{status-async-output} contains on-going status information about the
308 progress of a slow operation. It can be discarded. All status output is
309 prefixed by @samp{+}.
310
311 @item
312 @cindex async output in @sc{gdb/mi}
313 @var{exec-async-output} contains asynchronous state change on the target
314 (stopped, started, disappeared). All async output is prefixed by
315 @samp{*}.
316
317 @item
318 @cindex notify output in @sc{gdb/mi}
319 @var{notify-async-output} contains supplementary information that the
320 client should handle (e.g., a new breakpoint information). All notify
321 output is prefixed by @samp{=}.
322
323 @item
324 @cindex console output in @sc{gdb/mi}
325 @var{console-stream-output} is output that should be displayed as is in the
326 console. It is the textual response to a CLI command. All the console
327 output is prefixed by @samp{~}.
328
329 @item
330 @cindex target output in @sc{gdb/mi}
331 @var{target-stream-output} is the output produced by the target program.
332 All the target output is prefixed by @samp{@@}.
333
334 @item
335 @cindex log output in @sc{gdb/mi}
336 @var{log-stream-output} is output text coming from GDB's internals, for
337 instance messages that should be displayed as part of an error log. All
338 the log output is prefixed by @samp{&}.
339 @end itemize
340
341 @xref{GDB/MI Stream Records, , @sc{gdb/mi} Stream Records}, for more
342 details about the various output records.
343
344 @xref{GDB/MI Draft Changes to Output Syntax, , @sc{gdb/mi} Draft Changes
345 to Output Syntax}, for proposed revisions to the current output syntax.
346
347 @node GDB/MI Simple Examples
348 @subsection Simple Examples of @sc{gdb/mi} Interaction
349 @cindex @sc{gdb/mi}, simple examples
350
351 This subsection presents several simple examples of interaction using
352 the @sc{gdb/mi} interface. In these examples, @samp{->} means that the
353 following line is passed to @sc{gdb/mi} as input, while @samp{<-} means
354 the output received from @sc{gdb/mi}.
355
356 @subsubheading Target Stop
357
358 Here's an example of stopping the inferior process:
359
360 @example
361 -> -stop
362 <- (gdb)
363 @end example
364
365 @noindent
366 and later:
367
368 @example
369 <- *stop,reason="stop",address="0x123",source="a.c:123"
370 <- (gdb)
371 @end example
372
373 @subsubheading Simple CLI Command
374
375 Here's an example of a simple CLI command being passed through
376 @sc{gdb/mi} and on to the CLI.
377
378 @example
379 -> print 1+2
380 <- ~3\n
381 <- (gdb)
382 @end example
383
384 @subsubheading Command With Side Effects
385
386 @example
387 -> -symbol-file xyz.exe
388 <- *breakpoint,nr="3",address="0x123",source="a.c:123"
389 <- (gdb)
390 @end example
391
392 @subsubheading A Bad Command
393
394 Here's what happens if you pass a non-existent command:
395
396 @example
397 -> -rubbish
398 <- error,"Rubbish not found"
399 <- (gdb)
400 @end example
401
402 @c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
403 @node GDB/MI Compatibility with CLI
404 @section @sc{gdb/mi} Compatibility with CLI
405
406 @cindex compatibility, @sc{gdb/mi} and CLI
407 @cindex @sc{gdb/mi}, compatibility with CLI
408 To help users familiar with the GDB's existing CLI interface, @sc{gdb/mi}
409 accepts existing CLI commands. As specified by the syntax, such
410 commands can be directly entered into the @sc{gdb/mi} interface and GDB will
411 respond.
412
413 This mechanism is provided as an aid to developers of @sc{gdb/mi}
414 clients and not as a reliable interface into the CLI. Since the command
415 is being interpreteted in an environment that assumes @sc{gdb/mi}
416 behaviour, the exact output of such commands is likely to end up being
417 an un-supported hybrid of @sc{gdb/mi} and CLI output.
418
419 @c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
420 @node GDB/MI Output Records
421 @section @sc{gdb/mi} Output Records
422
423 @menu
424 * GDB/MI Result Records::
425 * GDB/MI Stream Records::
426 * GDB/MI Out-of-band Records::
427 @end menu
428
429 @node GDB/MI Result Records
430 @subsection @sc{gdb/mi} Result Records
431
432 @cindex result records in @sc{gdb/mi}
433 @cindex @sc{gdb/mi}, result records
434 In addition to a number of out-of-band notifications, the response to a
435 @sc{gdb/mi} command includes one of the following result indications:
436
437 @table @code
438 @findex ^done
439 @item "^done" [ "," @var{results} ]
440 The synchronous operation was successful, @code{@var{results}} is the return
441 value.
442
443 @item "^running"
444 @findex ^running
445 @c Is this one correct? Should it be an out-of-band notification?
446 The asynchronous operation was successfully started. The target is
447 running.
448
449 @item "^error" "," @var{c-string}
450 @cindex ^error
451 The operation failed. The @code{@var{c-string}} contains the corresponding
452 error message.
453 @end table
454
455 @node GDB/MI Stream Records
456 @subsection @sc{gdb/mi} Stream Records
457
458 @cindex @sc{gdb/mi}, stream records
459 @cindex stream records in @sc{gdb/mi}
460 GDB internally maintains a number of output streams: the console, the
461 target, and the log. The output intended for each of these streams is
462 funneled through the @sc{gdb/mi} interface using @dfn{stream records}.
463
464 Each stream record begins with a unique @dfn{prefix character} which
465 identifies its stream (@pxref{GDB/MI Output Syntax, , @sc{gdb/mi} Output
466 Syntax}). In addition to the prefix, each stream record contains a
467 @code{@var{string-output}}. This is either raw text (with an implicit new
468 line) or a quoted C string (which does not contain an implicit newline).
469
470 @table @code
471 @item "~" @var{string-output}
472 The console output stream contains text that should be displayed in the
473 CLI console window. It contains the textual responses to CLI commands.
474
475 @item "@@" @var{string-output}
476 The target output stream contains any textual output from the running
477 target.
478
479 @item "&" @var{string-output}
480 The LOG stream contains debugging messages being produced by GDB's
481 internals.
482 @end table
483
484 @node GDB/MI Out-of-band Records
485 @subsection @sc{gdb/mi} Out-of-band Records
486
487 @cindex out-of-band records in @sc{gdb/mi}
488 @cindex @sc{gdb/mi}, out-of-band records
489 @dfn{Out-of-band} records are used to notify the @sc{gdb/mi} client of
490 additional changes that have occurred. Those changes can either be a
491 consequence of @sc{gdb/mi} (e.g., a breakpoint modified) or a result of
492 target activity (e.g., target stopped).
493
494 The following is a preliminary list of possible out-of-band records.
495
496 @table @code
497 @item "*" "stop"
498 @end table
499
500
501 @c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
502 @node GDB/MI Command Description Format
503 @section @sc{gdb/mi} Command Description Format
504
505 The remaining sections describe blocks of commands. Each block of
506 commands is laid out in a fashion similar to this chapter.
507
508 Note the the line breaks shown in the examples are here only for
509 readability. They don't appear in the real output.
510 Also note that the commands with a non-available example (N.A.@:) are
511 not yet implemented.
512
513 @subheading Motivation
514
515 The motivation for this collection of commands
516
517 @subheading Introduction
518
519 A brief introduction to this collection of commands as a whole.
520
521 @subheading Commands
522
523 For each command in the block, the following is described:
524
525 @subsubheading Synopsis
526
527 @example
528 -command @var{args}...
529 @end example
530
531 @subsubheading GDB Command
532
533 The corresponding GDB CLI command.
534
535 @subsubheading Result
536
537 @subsubheading Out-of-band
538
539 @subsubheading Notes
540
541 @subsubheading Example
542
543
544 @c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
545 @node GDB/MI Breakpoint Table Commands
546 @section @sc{gdb/mi} Breakpoint table commands
547
548 @cindex breakpoint commands for @sc{gdb/mi}
549 @cindex @sc{gdb/mi}, breakpoint commands
550 This section documents @sc{gdb/mi} commands for manipulating
551 breakpoints.
552
553 @subheading The @code{-break-after} Command
554 @findex -break-after
555
556 @subsubheading Synopsis
557
558 @example
559 -break-after @var{number} @var{count}
560 @end example
561
562 The breakpoint number @var{number} is not in effect until it has been
563 hit @var{count} times. To see how this is reflected in the output of
564 the @samp{-break-list} command, see the description of the
565 @samp{-break-list} command below.
566
567 @subsubheading GDB Command
568
569 The corresponding GDB command is @samp{ignore}.
570
571 @subsubheading Example
572
573 @smallexample
574 (gdb)
575 -break-insert main
576 ^done,bkpt=@{number="1",addr="0x000100d0",file="hello.c",line="5"@}
577 (gdb)
578 -break-after 1 3
579 ~
580 ^done
581 (gdb)
582 -break-list
583 ^done,BreakpointTable=@{hdr=@{"Num","Type","Disp","Enb","Address","What"@},
584 bkpt=@{number="1",type="breakpoint",disp="keep",enabled="y",
585 addr="0x000100d0",func="main",file="hello.c",line="5",times="0",
586 ignore="3"@}@}
587 (gdb)
588 @end smallexample
589
590 @ignore
591 @subheading The @code{-break-catch} Command
592 @findex -break-catch
593
594 @subheading The @code{-break-commands} Command
595 @findex -break-commands
596 @end ignore
597
598
599 @subheading -break-condition
600 @findex -break-condition
601
602 @subsubheading Synopsis
603
604 @example
605 -break-condition @var{number} @var{expr}
606 @end example
607
608 Breakpoint @var{number} will stop the program only if the condition in
609 @var{expr} is true. The condition becomes part of the
610 @samp{-break-list} output (see the description of the @samp{-break-list}
611 command below).
612
613 @subsubheading GDB Command
614
615 The corresponding GDB command is @samp{condition}.
616
617 @subsubheading Example
618
619 @smallexample
620 (gdb)
621 -break-condition 1 1
622 ^done
623 (gdb)
624 -break-list
625 ^done,BreakpointTable=@{hdr=@{"Num","Type","Disp","Enb","Address","What"@},
626 bkpt=@{number="1",type="breakpoint",disp="keep",enabled="y",
627 addr="0x000100d0",func="main",file="hello.c",line="5",cond="1",
628 times="0",ignore="3"@}@}
629 (gdb)
630 @end smallexample
631
632 @subheading The @code{-break-delete} Command
633 @findex -break-delete
634
635 @subsubheading Synopsis
636
637 @example
638 -break-delete ( @var{breakpoint} )+
639 @end example
640
641 Delete the breakpoint(s) whose number(s) are specified in the argument
642 list. This is obviously reflected in the breakpoint list.
643
644 @subsubheading GDB command
645
646 The corresponding GDB command is @samp{delete}.
647
648 @subsubheading Example
649
650 @example
651 (gdb)
652 -break-delete 1
653 ^done
654 (gdb)
655 -break-list
656 ^done,BreakpointTable=@{@}
657 (gdb)
658 @end example
659
660 @subheading The @code{-break-disable} Command
661 @findex -break-disable
662
663 @subsubheading Synopsis
664
665 @example
666 -break-disable ( @var{breakpoint} )+
667 @end example
668
669 Disable the named @var{breakpoint}(s). The field @samp{enabled} in the
670 break list is now set to @samp{n} for the named @var{breakpoint}(s).
671
672 @subsubheading GDB Command
673
674 The corresponding GDB command is @samp{disable}.
675
676 @subsubheading Example
677
678 @smallexample
679 (gdb)
680 -break-disable 2
681 ^done
682 (gdb)
683 -break-list
684 ^done,BreakpointTable=@{hdr=@{"Num","Type","Disp","Enb","Address","What"@},
685 bkpt=@{number="2",type="breakpoint",disp="keep",enabled="n",
686 addr="0x000100d0",func="main",file="hello.c",line="5",times="0"@}@}
687 (gdb)
688 @end smallexample
689
690 @subheading The @code{-break-enable} Command
691 @findex -break-enable
692
693 @subsubheading Synopsis
694
695 @example
696 -break-enable ( @var{breakpoint} )+
697 @end example
698
699 Enable (previously disabled) @var{breakpoint}(s).
700
701 @subsubheading GDB Command
702
703 The corresponding GDB command is @samp{enable}.
704
705 @subsubheading Example
706
707 @smallexample
708 (gdb)
709 -break-enable 2
710 ^done
711 (gdb)
712 -break-list
713 ^done,BreakpointTable=@{hdr=@{"Num","Type","Disp","Enb","Address","What"@},
714 bkpt=@{number="2",type="breakpoint",disp="keep",enabled="y",
715 addr="0x000100d0",func="main",file="hello.c",line="5",times="0"@}@}
716 (gdb)
717 @end smallexample
718
719 @subheading The @code{-break-info} Command
720 @findex -break-info
721
722 @subsubheading Synopsis
723
724 @example
725 -break-info @var{breakpoint}
726 @end example
727
728 @c REDUNDANT???
729 Get information about a single breakpoint.
730
731 @subsubheading GDB command
732
733 The corresponding GDB command is @samp{info break @var{breakpoint}}.
734
735 @subsubheading Example
736 N.A.
737
738 @subheading The @code{-break-insert} Command
739 @findex -break-insert
740
741 @subsubheading Synopsis
742
743 @example
744 -break-insert [ -t ] [ -h ] [ -r ]
745 [ -c @var{condition} ] [ -i @var{ignore-count} ]
746 [ -p @var{thread} ] [ @var{line} | @var{addr} ]
747 @end example
748
749 @noindent
750 If specified, @var{line}, can be one of:
751
752 @itemize @bullet
753 @item function
754 @c @item +offset
755 @c @item -offset
756 @c @item linenum
757 @item filename:linenum
758 @item filename:function
759 @item *address
760 @end itemize
761
762 The possible optional parameters of this command are:
763
764 @table @samp
765 @item -t
766 Insert a tempoary breakpoint.
767 @item -h
768 Insert a hardware breakpoint.
769 @item -c @var{condition}
770 Make the breakpoint conditional on @var{condition}.
771 @item -i @var{ignore-count}
772 Initialize the @var{ignore-count}.
773 @item -r
774 Insert a regular breakpoint in all the functions whose names match the
775 given regular expression. Other flags are not applicable to regular
776 expresson.
777 @end table
778
779 @subsubheading Result
780
781 The result is in the form:
782
783 @example
784 ^done,bkptno="@var{number}",func="@var{funcname}",
785 file="@var{filename}",line="@var{lineno}"
786 @end example
787
788 @noindent
789 where @var{number} is the GDB number for this breakpoint, @var{funcname}
790 is the name of the function where the breakpoint was inserted,
791 @var{filename} is the name of the source file which contains this
792 function, and @var{lineno} is the source line number within that file.
793
794 Note: this format is open to change.
795 @c An out-of-band breakpoint instead of part of the result?
796
797 @subsubheading GDB Command
798
799 The corresponding GDB commands are @samp{break}, @samp{tbreak},
800 @samp{hbreak}, @samp{thbreak}, and @samp{rbreak}.
801
802 @subsubheading Example
803
804 @smallexample
805 (gdb)
806 -break-insert main
807 ^done,bkpt=@{number="1",addr="0x0001072c",file="recursive2.c",line="4"@}
808 (gdb)
809 -break-insert -t foo
810 ^done,bkpt=@{number="2",addr="0x00010774",file="recursive2.c",line="11"@}
811 (gdb)
812 -break-list
813 ^done,BreakpointTable=@{hdr=@{"Num","Type","Disp","Enb","Address","What"@},
814 bkpt=@{number="1",type="breakpoint",disp="keep",enabled="y",
815 addr="0x0001072c", func="main",file="recursive2.c",line="4",times="0"@},
816 bkpt=@{number="2",type="breakpoint",disp="del",enabled="y",
817 addr="0x00010774",func="foo",file="recursive2.c",line="11",times="0"@}@}
818 (gdb)
819 -break-insert -r foo.*
820 ~int foo(int, int);
821 ^done,bkpt=@{number="3",addr="0x00010774",file="recursive2.c",line="11"@}
822 (gdb)
823 @end smallexample
824
825 @subheading The @code{-break-list} Command
826 @findex -break-list
827
828 @subsubheading Synopsis
829
830 @example
831 -break-list
832 @end example
833
834 Displays the list of inserted breakpoints, showing the following fields:
835
836 @table @samp
837 @item Number
838 number of the breakpoint
839 @item Type
840 type of the breakpoint: @samp{breakpoint} or @samp{watchpoint}
841 @item Disposition
842 should the breakpoint be deleted or disabled when it is hit: @samp{keep}
843 or @samp{nokeep}
844 @item Enabled
845 is the breakpoint enabled or no: @samp{y} or @samp{n}
846 @item Address
847 memory location at which the breakpoint is set
848 @item What
849 logical location of the breakpoint, expressed by function name, file
850 name, line number
851 @item times
852 number of times the breakpoint has been hit
853 @end table
854
855 If there are no breakpoints or watchpoints, the BreakpointTable field is
856 an empty list.
857
858 @subsubheading GDB Command
859
860 The corresponding GDB command is @samp{info break}.
861
862 @subsubheading Example
863
864 @smallexample
865 (gdb)
866 -break-list
867 ^done,BreakpointTable=@{hdr=@{"Num","Type","Disp","Enb","Address","What"@},
868 bkpt=@{number="1",type="breakpoint",disp="keep",enabled="y",
869 addr="0x000100d0",func="main",file="hello.c",line="5",times="0"@},
870 bkpt=@{number="2",type="breakpoint",disp="keep",enabled="y",
871 addr="0x00010114",func="foo",file="hello.c",line="13",times="0"@}@}
872 (gdb)
873 @end smallexample
874
875 Here's an example of the result when there are no breakpoints:
876
877 @smallexample
878 (gdb)
879 -break-list
880 ^done,BreakpointTable=@{@}
881 (gdb)
882 @end smallexample
883
884 @subheading The @code{-break-watch} Command
885 @findex -break-watch
886
887 @subsubheading Synopsis
888
889 @example
890 -break-watch [ -a | -r ]
891 @end example
892
893 Create a watchpoint. With the @samp{-a} option it will create an
894 @dfn{access} watchpoint, i.e. a watchpoints that triggers either on a
895 read from or on a write to the memory location. With the @samp{-r}
896 option, the watchpoint created is a @dfn{read} watchpoint, i.e. it will
897 trigger only when the memory location is accessed for reading. Without
898 either of the options, the watchpoint created is a regular watchpoint,
899 i.e. it will trigger when the memory location is accessed for writing.
900 @xref{Set Watchpoints, , Setting watchpoints}.
901
902 Note that @samp{-break-list} will report a single list of watchpoints and
903 breakpoints inserted.
904
905 @subsubheading GDB Command
906
907 The corresponding GDB commands are @samp{watch}, @samp{awatch}, and
908 @samp{rwatch}.
909
910 @subsubheading Example
911
912 Setting a watchpoint on a variable in the @code{main} function:
913
914 @smallexample
915 (gdb)
916 -break-watch x
917 ^done,wpt=@{number="2",exp="x"@}
918 (gdb)
919 -exec-continue
920 ^running
921 ^done,reason="watchpoint-trigger",wpt=@{number="2",exp="x"@},
922 value=@{old="-268439212",new="55"@},
923 frame=@{func="main",args=@{@},file="recursive2.c",line="5"@}
924 (gdb)
925 @end smallexample
926
927 Setting a watchpoint on a variable local to a function. GDB will stop
928 the program execution twice: first for the variable changing value, then
929 for the watchpoint going out of scope.
930
931 @smallexample
932 (gdb)
933 -break-watch C
934 ^done,wpt=@{number="5",exp="C"@}
935 (gdb)
936 -exec-continue
937 ^running
938 ^done,reason="watchpoint-trigger",
939 wpt=@{number="5",exp="C"@},value=@{old="-276895068",new="3"@},
940 frame=@{func="callee4",args=@{@},
941 file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="13"@}
942 (gdb)
943 -exec-continue
944 ^running
945 ^done,reason="watchpoint-scope",wpnum="5",
946 frame=@{func="callee3",args=@{@{name="strarg",
947 value="0x11940 \"A string argument.\""@}@},
948 file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="18"@}
949 (gdb)
950 @end smallexample
951
952 Listing breakpoints and watchpoints, at different points in the program
953 execution. Note that once the watchpoint goes out of scope, it is
954 deleted.
955
956 @smallexample
957 (gdb)
958 -break-watch C
959 ^done,wpt=@{number="2",exp="C"@}
960 (gdb)
961 -break-list
962 ^done,BreakpointTable=@{hdr=@{"Num","Type","Disp","Enb","Address","What"@},
963 bkpt=@{number="1",type="breakpoint",disp="keep",enabled="y",
964 addr="0x00010734",func="callee4",
965 file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="8",times="1"@},
966 bkpt=@{number="2",type="watchpoint",disp="keep",
967 enabled="y",addr="",what="C",times="0"@}@}
968 (gdb)
969 -exec-continue
970 ^running
971 ^done,reason="watchpoint-trigger",wpt=@{number="2",exp="C"@},
972 value=@{old="-276895068",new="3"@},
973 frame=@{func="callee4",args=@{@},
974 file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="13"@}
975 (gdb)
976 -break-list
977 ^done,BreakpointTable=@{hdr=@{"Num","Type","Disp","Enb","Address","What"@},
978 bkpt=@{number="1",type="breakpoint",disp="keep",enabled="y",
979 addr="0x00010734",func="callee4",
980 file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="8",times="1"@},
981 bkpt=@{number="2",type="watchpoint",disp="keep",
982 enabled="y",addr="",what="C",times="-5"@}@}
983 (gdb)
984 -exec-continue
985 ^running
986 ^done,reason="watchpoint-scope",wpnum="2",
987 frame=@{func="callee3",args=@{@{name="strarg",
988 value="0x11940 \"A string argument.\""@}@},
989 file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="18"@}
990 (gdb)
991 -break-list
992 ^done,BreakpointTable=@{hdr=@{"Num","Type","Disp","Enb","Address","What"@},
993 bkpt=@{number="1",type="breakpoint",disp="keep",enabled="y",
994 addr="0x00010734",func="callee4",
995 file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="8",times="1"@}@}
996 (gdb)
997 @end smallexample
998
999 @c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1000 @node GDB/MI Data Manipulation
1001 @section @sc{gdb/mi} Data Manipulation
1002
1003 @cindex data manipulation, in @sc{gdb/mi}
1004 @cindex @sc{gdb/mi}, data manipulation
1005 This section describes the @sc{gdb/mi} commands that manipulate data:
1006 examine memory and registers, evaluate expressions, etc.
1007
1008 @c REMOVED FROM THE INTERFACE.
1009 @c @subheading -data-assign
1010 @c Change the value of a program variable. Plenty of side effects.
1011 @c @subsubheading GDB command
1012 @c set variable
1013 @c @subsubheading Example
1014 @c N.A.
1015
1016 @subheading The @code{-data-disassemble} Command
1017 @findex -data-disassemble
1018
1019 @subsubheading Synopsis
1020
1021 @example
1022 -data-disassemble
1023 [ -s @var{start-addr} -e @var{end-addr} ]
1024 | [ -f @var{filename} -l @var{linenum} [ -n @var{lines} ] ]
1025 -- @var{mode}
1026 @end example
1027
1028 @noindent
1029 Where:
1030
1031 @table @samp
1032 @item @var{start-addr}
1033 is the beginning address (or @code{$pc})
1034 @item @var{end-addr}
1035 is the end address
1036 @item @var{filename}
1037 is the name of the file to disassemble
1038 @item @var{linenum}
1039 is the line number to disassemble around
1040 @item @var{lines}
1041 is the the number of disassembly lines to be produced. If it is -1,
1042 the whole function will be disassembled, in case no @var{end-add} is
1043 specified. If @var{end-addr} is specified as a non-zero value, and
1044 @var{lines} is lower that the number of disassembly lines between
1045 @var{start-addr} and @var{end-addr}, only @var{lines} lines are
1046 displayed; if @var{lines} is higher than the number of lines between
1047 @var{start-addr} and @var{end-addr}, only the lines up to @var{end-addr}
1048 are displayed.
1049 @item @var{mode}
1050 is either 0 (meaning only disassembly) or 1 (meaning mixed source and
1051 disassembly)
1052 @end table
1053
1054 @subsubheading Result
1055
1056 The output for each instruction is composed of two fields:
1057
1058 @itemize @bullet
1059 @item Address
1060 @item Func-name
1061 @item Offset
1062 @item Instruction
1063 @end itemize
1064
1065 Note that whatever included in the instruction field, is not manipulated
1066 directely by flathead, i.e. it is not possible to adjust its format.
1067
1068 @subsubheading GDB Command
1069
1070 There's no direct mapping from this command to the CLI.
1071
1072 @subsubheading Example
1073
1074 Disassemble from the current value of @code{$pc} to @code{$pc + 20}:
1075
1076 @smallexample
1077 (gdb)
1078 -data-disassemble -s $pc -e "$pc + 20" -- 0
1079 ^done,
1080 asm_insns=@{
1081 @{address="0x000107c0",func-name="main",offset="4",
1082 inst="mov 2, %o0"@},
1083 @{address="0x000107c4",func-name="main",offset="8",
1084 inst="sethi %hi(0x11800), %o2"@},
1085 @{address="0x000107c8",func-name="main",offset="12",
1086 inst="or %o2, 0x140, %o1\t! 0x11940 <_lib_version+8>"@},
1087 @{address="0x000107cc",func-name="main",offset="16",
1088 inst="sethi %hi(0x11800), %o2"@},
1089 @{address="0x000107d0",func-name="main",offset="20",
1090 inst="or %o2, 0x168, %o4\t! 0x11968 <_lib_version+48>"@}@}
1091 (gdb)
1092 @end smallexample
1093
1094 Disassemble the whole @code{main} function. Line 32 is part of
1095 @code{main}.
1096
1097 @smallexample
1098 -data-disassemble -f basics.c -l 32 -- 0
1099 ^done,asm_insns=@{
1100 @{address="0x000107bc",func-name="main",offset="0",
1101 inst="save %sp, -112, %sp"@},
1102 @{address="0x000107c0",func-name="main",offset="4",
1103 inst="mov 2, %o0"@},
1104 @{address="0x000107c4",func-name="main",offset="8",
1105 inst="sethi %hi(0x11800), %o2"@},
1106 [...]
1107 @{address="0x0001081c",func-name="main",offset="96",inst="ret "@},
1108 @{address="0x00010820",func-name="main",offset="100",inst="restore "@}@}
1109 (gdb)
1110 @end smallexample
1111
1112 Disassemble 3 instruction from the start of @code{main}:
1113
1114 @smallexample
1115 (gdb)
1116 -data-disassemble -f basics.c -l 32 -n 3 -- 0
1117 ^done,asm_insns=@{
1118 @{address="0x000107bc",func-name="main",offset="0",
1119 inst="save %sp, -112, %sp"@},
1120 @{address="0x000107c0",func-name="main",offset="4",
1121 inst="mov 2, %o0"@},
1122 @{address="0x000107c4",func-name="main",offset="8",
1123 inst="sethi %hi(0x11800), %o2"@}@}
1124 (gdb)
1125 @end smallexample
1126
1127 Disassemble 3 instruction from the start of @code{main} in mixed mode:
1128
1129 @smallexample
1130 (gdb)
1131 -data-disassemble -f basics.c -l 32 -n 3 -- 1
1132 ^done,asm_insns=@{
1133 src_and_asm_line=@{line="31",
1134 file="/kwikemart/marge/ezannoni/flathead-dev/devo/gdb/ \
1135 testsuite/gdb.mi/basics.c",line_asm_insn=@{
1136 @{address="0x000107bc",func-name="main",offset="0",
1137 inst="save %sp, -112, %sp"@}@}@},
1138
1139 src_and_asm_line=@{line="32",
1140 file="/kwikemart/marge/ezannoni/flathead-dev/devo/gdb/ \
1141 testsuite/gdb.mi/basics.c",line_asm_insn=@{
1142 @{address="0x000107c0",func-name="main",offset="4",
1143 inst="mov 2, %o0"@},
1144 @{address="0x000107c4",func-name="main",offset="8",
1145 inst="sethi %hi(0x11800), %o2"@}@}@}@}
1146 (gdb)
1147 @end smallexample
1148
1149
1150 @subheading The @code{-data-evaluate-expression} Command
1151 @findex -data-evaluate-expression
1152
1153 @subsubheading Synopsis
1154
1155 @example
1156 -data-evaluate-expression @var{expr}
1157 @end example
1158
1159 Evaluate @var{expr} as an expression. The expression could contain an
1160 inferior function call. The function call will execute synchronously.
1161 If the expression contains spaces, it must be enclosed in double quotes.
1162
1163 @subsubheading GDB Command
1164
1165 The corresponding GDB commands are @samp{print}, @samp{output}, and
1166 @code{call}. In @code{gdbtk} only, there's a corresponding
1167 @samp{gdb_eval} command.
1168
1169 @subsubheading Example
1170
1171 In the following example, the numbers that precede the commands are the
1172 @dfn{tokens} described in @ref{GDB/MI Command Syntax, , @sc{gdb/mi}
1173 Command Syntax}. Notice how @sc{gdb/mi} returns the same tokens in its
1174 output.
1175
1176 @smallexample
1177 211-data-evaluate-expression A
1178 211^done,value="1"
1179 (gdb)
1180 311-data-evaluate-expression &A
1181 311^done,value="0xefffeb7c"
1182 (gdb)
1183 411-data-evaluate-expression A+3
1184 411^done,value="4"
1185 (gdb)
1186 511-data-evaluate-expression "A + 3"
1187 511^done,value="4"
1188 (gdb)
1189 @end smallexample
1190
1191
1192 @subheading The @code{-data-list-changed-registers} Command
1193 @findex -data-list-changed-registers
1194
1195 @subsubheading Synopsis
1196
1197 @example
1198 -data-list-changed-registers
1199 @end example
1200
1201 Display a list of the registers that have changed.
1202
1203 @subsubheading GDB Command
1204
1205 GDB doesn't have a direct analog for this command; @code{gdbtk} has the
1206 corresponding command @samp{gdb_changed_register_list}.
1207
1208 @subsubheading Example
1209
1210 On a PPC MBX board:
1211
1212 @smallexample
1213 (gdb)
1214 -exec-continue
1215 ^running
1216
1217 (gdb)
1218 *stopped,reason="breakpoint-hit",bkptno="1",frame=@{func="main",
1219 args=@{@},file="try.c",line="5"@}
1220 (gdb)
1221 -data-list-changed-registers
1222 ^done,changed-registers=@{"0","1","2","4","5","6","7","8","9",
1223 "10","11","13","14","15","16","17","18","19","20","21","22","23",
1224 "24","25","26","27","28","30","31","64","65","66","67","69"@}
1225 (gdb)
1226 @end smallexample
1227
1228
1229 @subheading The @code{-data-list-register-names} Command
1230 @findex -data-list-register-names
1231
1232 @subsubheading Synopsis
1233
1234 @example
1235 -data-list-register-names [ ( @var{regno} )+ ]
1236 @end example
1237
1238 Show a list of register names for the current target. If no arguments
1239 are given, it shows a list of the names of all the registers. If
1240 integer numbers are given as arguments, it will print a list of the
1241 names of the registers corresponding to the arguments.
1242
1243 @subsubheading GDB Command
1244
1245 GDB does not have a command which corresponds to
1246 @samp{-data-list-register-names}. In @code{gdbtk} there is a
1247 corresponding command @samp{gdb_regnames}.
1248
1249 @subsubheading Example
1250
1251 For the PPC MBX board:
1252 @smallexample
1253 (gdb)
1254 -data-list-register-names
1255 ^done,register-names=@{"r0","r1","r2","r3","r4","r5","r6","r7",
1256 "r8","r9","r10","r11","r12","r13","r14","r15","r16","r17","r18",
1257 "r19","r20","r21","r22","r23","r24","r25","r26","r27","r28","r29",
1258 "r30","r31","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9",
1259 "f10","f11","f12","f13","f14","f15","f16","f17","f18","f19","f20",
1260 "f21","f22","f23","f24","f25","f26","f27","f28","f29","f30","f31",
1261 "pc","ps","cr","lr","ctr","xer"@}
1262 (gdb)
1263 -data-list-register-names 1 2 3
1264 ^done,register-names=@{"r1","r2","r3"@}
1265 (gdb)
1266 @end smallexample
1267
1268 @subheading The @code{-data-list-register-values} Command
1269 @findex -data-list-register-values
1270
1271 @subsubheading Synopsis
1272
1273 @example
1274 -data-list-register-values @var{fmt} [ ( @var{regno} )*]
1275 @end example
1276
1277 Display the registers contents. @var{fmt} is the format according to
1278 which the registers contents are to be returned, followed by an optional
1279 list of numbers specifying the registers to display. A missing list of
1280 numbers indicates that the contents of all the registers must be returned.
1281
1282 Allowed formats for @var{fmt} are:
1283
1284 @table @code
1285 @item x
1286 Hexadecimal
1287 @item o
1288 Octal
1289 @item t
1290 Binary
1291 @item d
1292 Decimal
1293 @item r
1294 Raw
1295 @item N
1296 Natural
1297 @end table
1298
1299 @subsubheading GDB Command
1300
1301 The corresponding GDB commands are @samp{info reg}, @samp{info all-reg},
1302 and (in @code{gdbtk}) @samp{gdb_fetch_registers}.
1303
1304 @subsubheading Example
1305
1306 For a PPC MBX board (note: line breaks are for readability only, they
1307 don't appear in the actual output):
1308
1309 @smallexample
1310 (gdb)
1311 -data-list-register-values r 64 65
1312 ^done,register-values=@{@{number="64",value="0xfe00a300"@},
1313 @{number="65",value="0x00029002"@}@}
1314 (gdb)
1315 -data-list-register-values x
1316 ^done,register-values=@{@{number="0",value="0xfe0043c8"@},
1317 @{number="1",value="0x3fff88"@},@{number="2",value="0xfffffffe"@},
1318 @{number="3",value="0x0"@},@{number="4",value="0xa"@},
1319 @{number="5",value="0x3fff68"@},@{number="6",value="0x3fff58"@},
1320 @{number="7",value="0xfe011e98"@},@{number="8",value="0x2"@},
1321 @{number="9",value="0xfa202820"@},@{number="10",value="0xfa202808"@},
1322 @{number="11",value="0x1"@},@{number="12",value="0x0"@},
1323 @{number="13",value="0x4544"@},@{number="14",value="0xffdfffff"@},
1324 @{number="15",value="0xffffffff"@},@{number="16",value="0xfffffeff"@},
1325 @{number="17",value="0xefffffed"@},@{number="18",value="0xfffffffe"@},
1326 @{number="19",value="0xffffffff"@},@{number="20",value="0xffffffff"@},
1327 @{number="21",value="0xffffffff"@},@{number="22",value="0xfffffff7"@},
1328 @{number="23",value="0xffffffff"@},@{number="24",value="0xffffffff"@},
1329 @{number="25",value="0xffffffff"@},@{number="26",value="0xfffffffb"@},
1330 @{number="27",value="0xffffffff"@},@{number="28",value="0xf7bfffff"@},
1331 @{number="29",value="0x0"@},@{number="30",value="0xfe010000"@},
1332 @{number="31",value="0x0"@},@{number="32",value="0x0"@},
1333 @{number="33",value="0x0"@},@{number="34",value="0x0"@},
1334 @{number="35",value="0x0"@},@{number="36",value="0x0"@},
1335 @{number="37",value="0x0"@},@{number="38",value="0x0"@},
1336 @{number="39",value="0x0"@},@{number="40",value="0x0"@},
1337 @{number="41",value="0x0"@},@{number="42",value="0x0"@},
1338 @{number="43",value="0x0"@},@{number="44",value="0x0"@},
1339 @{number="45",value="0x0"@},@{number="46",value="0x0"@},
1340 @{number="47",value="0x0"@},@{number="48",value="0x0"@},
1341 @{number="49",value="0x0"@},@{number="50",value="0x0"@},
1342 @{number="51",value="0x0"@},@{number="52",value="0x0"@},
1343 @{number="53",value="0x0"@},@{number="54",value="0x0"@},
1344 @{number="55",value="0x0"@},@{number="56",value="0x0"@},
1345 @{number="57",value="0x0"@},@{number="58",value="0x0"@},
1346 @{number="59",value="0x0"@},@{number="60",value="0x0"@},
1347 @{number="61",value="0x0"@},@{number="62",value="0x0"@},
1348 @{number="63",value="0x0"@},@{number="64",value="0xfe00a300"@},
1349 @{number="65",value="0x29002"@},@{number="66",value="0x202f04b5"@},
1350 @{number="67",value="0xfe0043b0"@},@{number="68",value="0xfe00b3e4"@},
1351 @{number="69",value="0x20002b03"@}@}
1352 (gdb)
1353 @end smallexample
1354
1355
1356 @subheading The @code{-data-read-memory} Command
1357 @findex -data-read-memory
1358
1359 @subsubheading Synopsis
1360
1361 @example
1362 -data-read-memory [ -o @var{byte-offset} ]
1363 @var{address} @var{word-format} @var{word-size}
1364 @var{nr-rows} @var{nr-cols} [ @var{aschar} ]
1365 @end example
1366
1367 @noindent
1368 where:
1369
1370 @table @samp
1371 @item @var{address}
1372 An expression specifying the address of the first memory word to be
1373 read. Complex expressions containing embedded white space should be
1374 quoted using the C convention.
1375
1376 @item @var{word-format}
1377 The format to be used to print the memory words. The notation is the
1378 same as for GDB's @code{print} command (@pxref{Output Formats, , Output
1379 formats}).
1380
1381 @item @var{word-size}
1382 The size of each memory word in bytes.
1383
1384 @item @var{nr-rows}
1385 The number of rows in the output table.
1386
1387 @item @var{nr-cols}
1388 The number of columns in the output table.
1389
1390 @item @var{aschar}
1391 If present, indicates that each row should include an @sc{ascii} dump. The
1392 value of @var{aschar} is used as a padding character when a byte is not a
1393 member of the printable @sc{ascii} character set (printable @sc{ascii}
1394 characters are those whose code is between 32 and 126, inclusively).
1395
1396 @item @var{byte-offset}
1397 An offset to add to the @var{address} before fetching memory.
1398 @end table
1399
1400 This command displays memory contents as a table of @var{nr-rows} by
1401 @var{nr-cols} words, each word being @var{word-size} bytes. In total,
1402 @code{@var{nr-rows} * @var{nr-cols} * @var{word-size}} bytes are read
1403 (returned as @samp{total-bytes}. Should less then the requested number
1404 of bytes be returned by the target, the missing words are identified
1405 using @samp{N/A}. The number of bytes read from the target is returned
1406 in @samp{nr-bytes} and the starting address used to read memory in
1407 @samp{addr}.
1408
1409 The address of the next/previous page or row is available in
1410 @samp{next-row} and @samp{prev-row}, @samp{next-page} and
1411 @samp{prev-page}.
1412
1413 @subsubheading GDB Command
1414
1415 The corresponding GDB command is @samp{x}. @code{gdbtk} has
1416 @samp{gdb_get_mem} memory read.
1417
1418 @subsubheading Example
1419
1420 Read six bytes of memory starting at @code{bytes+6} but then offset by
1421 @code{-6} bytes. Format as three rows of two columns. One byte per
1422 word. Display each word in hex.
1423
1424 @smallexample
1425 (gdb)
1426 9-data-read-memory -o -6 -- bytes+6 x 1 3 2
1427 9^done,addr="0x00001390",nr-bytes="6",total-bytes="6",
1428 next-row="0x00001396",prev-row="0x0000138e",next-page="0x00001396",
1429 prev-page="0x0000138a",memory=@{
1430 @{addr="0x00001390",data=@{"0x00","0x01"@}@},
1431 @{addr="0x00001392",data=@{"0x02","0x03"@}@},
1432 @{addr="0x00001394",data=@{"0x04","0x05"@}@}@}
1433 (gdb)
1434 @end smallexample
1435
1436 Read two bytes of memory starting at address @code{shorts + 64} and
1437 display as a single word formatted in decimal.
1438
1439 @smallexample
1440 (gdb)
1441 5-data-read-memory shorts+64 d 2 1 1
1442 5^done,addr="0x00001510",nr-bytes="2",total-bytes="2",
1443 next-row="0x00001512",prev-row="0x0000150e",
1444 next-page="0x00001512",prev-page="0x0000150e",memory=@{
1445 @{addr="0x00001510",data=@{"128"@}@}@}
1446 (gdb)
1447 @end smallexample
1448
1449 Read thirty two bytes of memory starting at @code{bytes+16} and format
1450 as eight rows of four columns. Include a string encoding with @code{x}
1451 used as the non-printable character.
1452
1453 @smallexample
1454 (gdb)
1455 4-data-read-memory bytes+16 x 1 8 4 x
1456 4^done,addr="0x000013a0",nr-bytes="32",total-bytes="32",
1457 next-row="0x000013c0",prev-row="0x0000139c",
1458 next-page="0x000013c0",prev-page="0x00001380",memory=@{
1459 @{addr="0x000013a0",data=@{"0x10","0x11","0x12","0x13"@},ascii="xxxx"@},
1460 @{addr="0x000013a4",data=@{"0x14","0x15","0x16","0x17"@},ascii="xxxx"@},
1461 @{addr="0x000013a8",data=@{"0x18","0x19","0x1a","0x1b"@},ascii="xxxx"@},
1462 @{addr="0x000013ac",data=@{"0x1c","0x1d","0x1e","0x1f"@},ascii="xxxx"@},
1463 @{addr="0x000013b0",data=@{"0x20","0x21","0x22","0x23"@},ascii=" !\"#"@},
1464 @{addr="0x000013b4",data=@{"0x24","0x25","0x26","0x27"@},ascii="$%&'"@},
1465 @{addr="0x000013b8",data=@{"0x28","0x29","0x2a","0x2b"@},ascii="()*+"@},
1466 @{addr="0x000013bc",data=@{"0x2c","0x2d","0x2e","0x2f"@},ascii=",-./"@}@}
1467 (gdb)
1468 @end smallexample
1469
1470 @subheading The @code{-display-delete} Command
1471 @findex -display-delete
1472
1473 @subsubheading Synopsis
1474
1475 @example
1476 -display-delete @var{number}
1477 @end example
1478
1479 Delete the display @var{number}.
1480
1481 @subsubheading GDB Command
1482
1483 The corresponding GDB command is @samp{delete display}.
1484
1485 @subsubheading Example
1486 N.A.
1487
1488
1489 @subheading The @code{-display-disable} Command
1490 @findex -display-disable
1491
1492 @subsubheading Synopsis
1493
1494 @example
1495 -display-disable @var{number}
1496 @end example
1497
1498 Disable display @var{number}.
1499
1500 @subsubheading GDB Command
1501
1502 the corresponding GDB command is @samp{disable display}.
1503
1504 @subsubheading Example
1505 N.A.
1506
1507
1508 @subheading The @code{-display-enable} Command
1509 @findex -display-enable
1510
1511 @subsubheading Synopsis
1512
1513 @example
1514 -display-enable @var{number}
1515 @end example
1516
1517 Enable display @var{number}.
1518
1519 @subsubheading GDB Command
1520
1521 The corresponding GDB command is @samp{enable display}.
1522
1523 @subsubheading Example
1524 N.A.
1525
1526
1527 @subheading The @code{-display-insert} Command
1528 @findex -display-insert
1529
1530 @subsubheading Synopsis
1531
1532 @example
1533 -display-insert @var{expression}
1534 @end example
1535
1536 Display @var{expression} every time the program stops.
1537
1538 @subsubheading GDB Command
1539
1540 The corresponding GDB command is @samp{display}.
1541
1542 @subsubheading Example
1543 N.A.
1544
1545
1546 @subheading The @code{-display-list} Command
1547 @findex -display-list
1548
1549 @subsubheading Synopsis
1550
1551 @example
1552 -display-list
1553 @end example
1554
1555 List the displays. Do not show the current values.
1556
1557 @subsubheading GDB Command
1558
1559 The corresponding GDB command is @samp{info display}.
1560
1561 @subsubheading Example
1562 N.A.
1563
1564
1565 @subheading The @code{-environment-cd} Command
1566 @findex -environment-cd
1567
1568 @subsubheading Synopsis
1569
1570 @example
1571 -environment-cd @var{pathdir}
1572 @end example
1573
1574 Set GDB's working directory.
1575
1576 @subsubheading GDB Command
1577
1578 the corresponding GDB command is @samp{cd}.
1579
1580 @subsubheading Example
1581
1582 @smallexample
1583 (gdb)
1584 -environment-cd /kwikemart/marge/ezannoni/flathead-dev/devo/gdb
1585 ^done
1586 (gdb)
1587 @end smallexample
1588
1589
1590 @subheading The @code{-environment-directory} Command
1591 @findex -environment-directory
1592
1593 @subsubheading Synopsis
1594
1595 @example
1596 -environment-directory @var{pathdir}
1597 @end example
1598
1599 Add directory @var{pathdir} to beginning of search path for source files.
1600
1601 @subsubheading GDB Command
1602
1603 The corresponding GDB command is @samp{dir}.
1604
1605 @subsubheading Example
1606
1607 @smallexample
1608 (gdb)
1609 -environment-directory /kwikemart/marge/ezannoni/flathead-dev/devo/gdb
1610 ^done
1611 (gdb)
1612 @end smallexample
1613
1614
1615 @subheading The @code{-environment-path} Command
1616 @findex -environment-path
1617
1618 @subsubheading Synopsis
1619
1620 @example
1621 -environment-path ( @var{pathdir} )+
1622 @end example
1623
1624 Add directories to beginning of search path for object files.
1625
1626 @subsubheading GDB Command
1627
1628 The corresponding GDB command is @samp{path}.
1629
1630 @subsubheading Example
1631
1632 @smallexample
1633 (gdb)
1634 -environment-path /kwikemart/marge/ezannoni/flathead-dev/ppc-eabi/gdb
1635 ^done
1636 (gdb)
1637 @end smallexample
1638
1639
1640 @subheading The @code{-environment-pwd} Command
1641 @findex -environment-pwd
1642
1643 @subsubheading Synopsis
1644
1645 @example
1646 -environment-pwd
1647 @end example
1648
1649 Show the current working directory.
1650
1651 @subsubheading GDB command
1652
1653 The corresponding GDB command is @samp{pwd}.
1654
1655 @subsubheading Example
1656
1657 @smallexample
1658 (gdb)
1659 -environment-pwd
1660 ~Working directory /kwikemart/marge/ezannoni/flathead-dev/devo/gdb.
1661 ^done
1662 (gdb)
1663 @end smallexample
1664
1665 @c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1666 @node GDB/MI Program Control
1667 @section @sc{gdb/mi} Program control
1668
1669 @subsubheading Program termination
1670
1671 As a result of execution, the inferior program can run to completion, if
1672 it doesn't encouter any breakpoints. In this case the ouput will
1673 include an exit code, if the program has exited exceptionally.
1674
1675 @subsubheading Examples:
1676
1677 @noindent
1678 Program exited normally:
1679
1680 @smallexample
1681 (gdb)
1682 -exec-run
1683 ^running
1684 (gdb)
1685 x = 55
1686 *stopped,reason="exited-normally"
1687 (gdb)
1688 @end smallexample
1689
1690 @noindent
1691 Program exited exceptionally:
1692
1693 @smallexample
1694 (gdb)
1695 -exec-run
1696 ^running
1697 (gdb)
1698 x = 55
1699 *stopped,reason="exited",exit-code="01"
1700 (gdb)
1701 @end smallexample
1702
1703 Another way the program can terminate is if it receives a signal such as
1704 @code{SIGINT}. In this case, @sc{gdb/mi} displays this:
1705
1706 @smallexample
1707 (gdb)
1708 *stopped,reason="exited-signalled",signal-name="SIGINT",
1709 signal-meaning="Interrupt"
1710 @end smallexample
1711
1712
1713 @subheading The @code{-exec-abort} Command
1714 @findex -exec-abort
1715
1716 @subsubheading Synopsis
1717
1718 @example
1719 -exec-abort
1720 @end example
1721
1722 Kill the inferior running program.
1723
1724 @subsubheading GDB Command
1725
1726 The corresponding GDB command is @samp{kill}.
1727
1728 @subsubheading Example
1729 N.A.
1730
1731
1732 @subheading The @code{-exec-arguments} Command
1733 @findex -exec-arguments
1734
1735 @subsubheading Synopsis
1736
1737 @example
1738 -exec-arguments @var{args}
1739 @end example
1740
1741 Set the inferior program arguments, to be used in the next
1742 @samp{-exec-run}.
1743
1744 @subsubheading GDB Command
1745
1746 The corresponding GDB command is @samp{set args}.
1747
1748 @subsubheading Example
1749
1750 @c FIXME!
1751 Don't have one around.
1752
1753
1754 @subheading The @code{-exec-continue} Command
1755 @findex -exec-continue
1756
1757 @subsubheading Synopsis
1758
1759 @example
1760 -exec-continue
1761 @end example
1762
1763 Asynchronous command. Resumes the execution of the inferior program
1764 until a breakpoint is encountered, or until the inferior exits.
1765
1766 @subsubheading GDB Command
1767
1768 The corresponding GDB corresponding is @samp{continue}.
1769
1770 @subsubheading Example
1771
1772 @smallexample
1773 -exec-continue
1774 ^running
1775 (gdb)
1776 @@Hello world
1777 *stopped,reason="breakpoint-hit",bkptno="2",frame=@{func="foo",args=@{@},
1778 file="hello.c",line="13"@}
1779 (gdb)
1780 @end smallexample
1781
1782
1783 @subheading The @code{-exec-finish} Command
1784 @findex -exec-finish
1785
1786 @subsubheading Synopsis
1787
1788 @example
1789 -exec-finish
1790 @end example
1791
1792 Asynchronous command. Resumes the execution of the inferior program
1793 until the current function is exited. Displays the results returned by
1794 the function.
1795
1796 @subsubheading GDB Command
1797
1798 The corresponding GDB command is @samp{finish}.
1799
1800 @subsubheading Example
1801
1802 Function returning @code{void}.
1803
1804 @smallexample
1805 -exec-finish
1806 ^running
1807 (gdb)
1808 @@hello from foo
1809 *stopped,reason="function-finished",frame=@{func="main",args=@{@},
1810 file="hello.c",line="7"@}
1811 (gdb)
1812 @end smallexample
1813
1814 Function returning other than @code{void}. The name of the internal GDB
1815 variable storing the result is printed, together with the value itself.
1816
1817 @smallexample
1818 -exec-finish
1819 ^running
1820 (gdb)
1821 *stopped,reason="function-finished",frame=@{addr="0x000107b0",func="foo",
1822 args=@{@{name="a",value="1"@},@{name="b",value="9"@}@},
1823 file="recursive2.c",line="14"@},
1824 gdb-result-var="$1",return-value="0"
1825 (gdb)
1826 @end smallexample
1827
1828
1829 @subheading The @code{-exec-interrupt} Command
1830 @findex -exec-interrupt
1831
1832 @subsubheading Synopsis
1833
1834 @example
1835 -exec-interrupt
1836 @end example
1837
1838 Asynchronous command. Interrupts the background execution of the target.
1839 Note how the token associated with the stop message is the one for the
1840 execution command that has been interrupted. The token for the interrupt
1841 itself only appears in the '^done' output. If the user is trying to
1842 interrupt a non-running program, an error message will be printed.
1843
1844 @subsubheading GDB Command
1845
1846 The corresponding GDB command is @samp{interrupt}.
1847
1848 @subsubheading Example
1849
1850 @smallexample
1851 (gdb)
1852 111-exec-continue
1853 111^running
1854
1855 (gdb)
1856 222-exec-interrupt
1857 222^done
1858 (gdb)
1859 111*stopped,signal-name="SIGINT",signal-meaning="Interrupt",
1860 frame=@{addr="0x00010140",func="foo",args=@{@},file="try.c",line="13"@}
1861 (gdb)
1862
1863 (gdb)
1864 -exec-interrupt
1865 ^error,msg="mi_cmd_exec_interrupt: Inferior not executing."
1866 (gdb)
1867 @end smallexample
1868
1869
1870 @subheading The @code{-exec-next} Command
1871 @findex -exec-next
1872
1873 @subsubheading Synopsis
1874
1875 @example
1876 -exec-next
1877 @end example
1878
1879 Asynchronous command. Resumes execution of the inferior program, stopping
1880 when the beginning of the next source line is reached.
1881
1882 @subsubheading GDB Command
1883
1884 The corresponding GDB command is @samp{next}.
1885
1886 @subsubheading Example
1887
1888 @smallexample
1889 -exec-next
1890 ^running
1891 (gdb)
1892 *stopped,reason="end-stepping-range",line="8",file="hello.c"
1893 (gdb)
1894 @end smallexample
1895
1896
1897 @subheading The @code{-exec-next-instruction} Command
1898 @findex -exec-next-instruction
1899
1900 @subsubheading Synopsis
1901
1902 @example
1903 -exec-next-instruction
1904 @end example
1905
1906 Asynchronous command. Executes one machine instruction. If the
1907 instruction is a function call continues until the function returns. If
1908 the program stops at an instruction in the middle of a source line, the
1909 address will be printed as well.
1910
1911 @subsubheading GDB Command
1912
1913 The corresponding GDB command is @samp{nexti}.
1914
1915 @subsubheading Example
1916
1917 @smallexample
1918 (gdb)
1919 -exec-next-instruction
1920 ^running
1921
1922 (gdb)
1923 *stopped,reason="end-stepping-range",
1924 addr="0x000100d4",line="5",file="hello.c"
1925 (gdb)
1926 @end smallexample
1927
1928
1929 @subheading The @code{-exec-return} Command
1930 @findex -exec-return
1931
1932 @subsubheading Synopsis
1933
1934 @example
1935 -exec-return
1936 @end example
1937
1938 Makes current function return immediately. Doesn't execute the inferior.
1939 Displays the new current frame.
1940
1941 @subsubheading GDB Command
1942
1943 The corresponding GDB command is @samp{return}.
1944
1945 @subsubheading Example
1946
1947 @smallexample
1948 (gdb)
1949 200-break-insert callee4
1950 200^done,bkpt=@{number="1",addr="0x00010734",
1951 file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="8"@}
1952 (gdb)
1953 000-exec-run
1954 000^running
1955 (gdb)
1956 000*stopped,reason="breakpoint-hit",bkptno="1",
1957 frame=@{func="callee4",args=@{@},
1958 file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="8"@}
1959 (gdb)
1960 205-break-delete
1961 205^done
1962 (gdb)
1963 111-exec-return
1964 111^done,frame=@{level="0 ",func="callee3",
1965 args=@{@{name="strarg",
1966 value="0x11940 \"A string argument.\""@}@},
1967 file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="18"@}
1968 (gdb)
1969 @end smallexample
1970
1971
1972 @subheading The @code{-exec-run} Command
1973 @findex -exec-run
1974
1975 @subsubheading Synopsis
1976
1977 @example
1978 -exec-run
1979 @end example
1980
1981 Asynchronous command. Starts execution of the inferior from the
1982 beginning. The inferior executes until either a breakpoint is
1983 encountered or the program exits.
1984
1985 @subsubheading GDB Command
1986
1987 The corresponding GDB command is @samp{run}
1988
1989 @subsubheading Example
1990
1991 @smallexample
1992 (gdb)
1993 -break-insert main
1994 ^done,bkpt=@{number="1",addr="0x0001072c",file="recursive2.c",line="4"@}
1995 (gdb)
1996 -exec-run
1997 ^running
1998 (gdb)
1999 *stopped,reason="breakpoint-hit",bkptno="1",
2000 frame=@{func="main",args=@{@},file="recursive2.c",line="4"@}
2001 (gdb)
2002 @end smallexample
2003
2004
2005 @subheading The @code{-exec-show-arguments} Command
2006 @findex -exec-show-arguments
2007
2008 @subsubheading Synopsis
2009
2010 @example
2011 -exec-show-arguments
2012 @end example
2013
2014 Print the arguments of the program.
2015
2016 @subsubheading GDB Command
2017
2018 The corresponding GDB command is @samp{show args}.
2019
2020 @subsubheading Example
2021 N.A.
2022
2023 @c @subheading -exec-signal
2024
2025 @subheading The @code{-exec-step} Command
2026 @findex -exec-step
2027
2028 @subsubheading Synopsis
2029
2030 @example
2031 -exec-step
2032 @end example
2033
2034 Asynchronous command. Resumes execution of the inferior program, stopping
2035 when the beginning of the next source line is reached, if the next
2036 source line is not a function call. If it is, stop at the first
2037 instruction of the called function.
2038
2039 @subsubheading GDB Command
2040
2041 The corresponding GDB command is @samp{step}.
2042
2043 @subsubheading Example
2044
2045 Stepping into a function:
2046
2047 @smallexample
2048 -exec-step
2049 ^running
2050 (gdb)
2051 *stopped,reason="end-stepping-range",
2052 frame=@{func="foo",args=@{@{name="a",value="10"@},
2053 @{name="b",value="0"@}@},file="recursive2.c",line="11"@}
2054 (gdb)
2055 @end smallexample
2056
2057 Regular stepping:
2058
2059 @smallexample
2060 -exec-step
2061 ^running
2062 (gdb)
2063 *stopped,reason="end-stepping-range",line="14",file="recursive2.c"
2064 (gdb)
2065 @end smallexample
2066
2067
2068 @subheading The @code{-exec-step-instruction} Command
2069 @findex -exec-step-instruction
2070
2071 @subsubheading Synopsis
2072
2073 @example
2074 -exec-step-instruction
2075 @end example
2076
2077 Asynchronous command. Resumes the inferior which executes one machine
2078 instruction. The output, once stop, will vary depend on whether we have
2079 stopped in the middle of a source line or not. In the former case, the
2080 address at which the program stopped will be printed as well.
2081
2082 @subsubheading GDB Command
2083
2084 The corresponding GDB command is @samp{stepi}.
2085
2086 @subsubheading Example
2087
2088 @smallexample
2089 (gdb)
2090 -exec-step-instruction
2091 ^running
2092
2093 (gdb)
2094 *stopped,reason="end-stepping-range",
2095 frame=@{func="foo",args=@{@},file="try.c",line="10"@}
2096 (gdb)
2097 -exec-step-instruction
2098 ^running
2099
2100 (gdb)
2101 *stopped,reason="end-stepping-range",
2102 frame=@{addr="0x000100f4",func="foo",args=@{@},file="try.c",line="10"@}
2103 (gdb)
2104 @end smallexample
2105
2106
2107 @subheading The @code{-exec-until} Command
2108 @findex -exec-until
2109
2110 @subsubheading Synopsis
2111
2112 @example
2113 -exec-until [ @var{location} ]
2114 @end example
2115
2116 Asynchronous command. Executes the inferior until the @var{location}
2117 specified in the argument is reached. If there is no argument, the inferior
2118 executes until a source line greater than the current one is reached.
2119 The reason for stopping in this case will be ``location-reached''.
2120
2121 @subsubheading GDB Command
2122
2123 The corresponding GDB command is @samp{until}.
2124
2125 @subsubheading Example
2126
2127 @smallexample
2128 (gdb)
2129 -exec-until recursive2.c:6
2130 ^running
2131 (gdb)
2132 x = 55
2133 *stopped,reason="location-reached",frame=@{func="main",args=@{@},
2134 file="recursive2.c",line="6"@}
2135 (gdb)
2136 @end smallexample
2137
2138 @ignore
2139 @subheading -file-clear
2140 Is this going away????
2141 @end ignore
2142
2143
2144 @subheading The @code{-file-exec-and-symbols} Command
2145 @findex -file-exec-and-symbols
2146
2147 @subsubheading Synopsis
2148
2149 @example
2150 -file-exec-and-symbols @var{file}
2151 @end example
2152
2153 Specify the executable file to be debugged. This file is the one from
2154 which the symbol table is also read. If no file is specified, the
2155 command clears the executable and symbol information. If breakpoints
2156 are set when using this command with no arguments, gdb will produce
2157 error messages. Oterwise, no output is produced, except a completion
2158 notification.
2159
2160 @subsubheading GDB Command
2161
2162 The corresponding GDB command is @samp{file}.
2163
2164 @subsubheading Example
2165
2166 @smallexample
2167 (gdb)
2168 -file-exec-and-symbols /kwikemart/marge/ezannoni/TRUNK/mbx/hello.mbx
2169 ^done
2170 (gdb)
2171 @end smallexample
2172
2173
2174 @subheading The @code{-file-exec-file} Command
2175 @findex -file-exec-file
2176
2177 @subsubheading Synopsis
2178
2179 @example
2180 -file-exec-file @var{file}
2181 @end example
2182
2183 Specify the executable file to be debugged. Unlike
2184 @samp{-file-exec-and-symbols}, the symbol table is @emph{not} read
2185 from this file. If used without argument, GDB clears the information
2186 about the executable file. No output is produced, except a completion
2187 notification.
2188
2189 @subsubheading GDB Command
2190
2191 The corresponding GDB command is @samp{exec-file}.
2192
2193 @subsubheading Example
2194
2195 @smallexample
2196 (gdb)
2197 -file-exec-file /kwikemart/marge/ezannoni/TRUNK/mbx/hello.mbx
2198 ^done
2199 (gdb)
2200 @end smallexample
2201
2202
2203 @subheading The @code{-file-list-exec-sections} Command
2204 @findex -file-list-exec-sections
2205
2206 @subsubheading Synopsis
2207
2208 @example
2209 -file-list-exec-sections
2210 @end example
2211
2212 List the sections of the current executable file.
2213
2214 @subsubheading GDB Command
2215
2216 The GDB command @samp{info file} shows, among the rest, the same
2217 information as this command. @code{gdbtk} has a corresponding command
2218 @samp{gdb_load_info}.
2219
2220 @subsubheading Example
2221 N.A.
2222
2223
2224 @subheading The @code{-file-list-exec-source-files} Command
2225 @findex -file-list-exec-source-files
2226
2227 @subsubheading Synopsis
2228
2229 @example
2230 -file-list-exec-source-files
2231 @end example
2232
2233 List the source files for the current executable.
2234
2235 @subsubheading GDB Command
2236
2237 There's no GDB command which directly corresponds to this one.
2238 @code{gdbtk} has an analogous command @samp{gdb_listfiles}.
2239
2240 @subsubheading Example
2241 N.A.
2242
2243
2244 @subheading The @code{-file-list-shared-libraries} Command
2245 @findex -file-list-shared-libraries
2246
2247 @subsubheading Synopsis
2248
2249 @example
2250 -file-list-shared-libraries
2251 @end example
2252
2253 List the shared libraries in the program.
2254
2255 @subsubheading GDB Command
2256
2257 The corresponding GDB command os @samp{info shared}.
2258
2259 @subsubheading Example
2260 N.A.
2261
2262
2263 @subheading The @code{-file-list-symbol-files} Command
2264 @findex -file-list-symbol-files
2265
2266 @subsubheading Synopsis
2267
2268 @example
2269 -file-list-symbol-files
2270 @end example
2271
2272 List symbol files.
2273
2274 @subsubheading GDB Command
2275
2276 The corresponding GDB command is @samp{info file} (part of it).
2277
2278 @subsubheading Example
2279 N.A.
2280
2281
2282 @subheading The @code{-file-symbol-file} Command
2283 @findex -file-symbol-file
2284
2285 @subsubheading Synopsis
2286
2287 @example
2288 -file-symbol-file @var{file}
2289 @end example
2290
2291 Read symbol table info from the specified @var{file} argument. When
2292 used without arguments, clears GDB'S symbol table info. No output is
2293 produced, except for a completion notification.
2294
2295 @subsubheading GDB Command
2296
2297 The corresponding GDB command is @samp{symbol-file}.
2298
2299 @subsubheading Example
2300
2301 @smallexample
2302 (gdb)
2303 -file-symbol-file /kwikemart/marge/ezannoni/TRUNK/mbx/hello.mbx
2304 ^done
2305 (gdb)
2306 @end smallexample
2307
2308 @c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2309 @node GDB/MI Misc Commands
2310 @section Misc GDB commands in @sc{gdb/mi}
2311
2312 @c @subheading -gdb-complete
2313
2314 @subheading The @code{-gdb-exit} Command
2315 @findex -gdb-exit
2316
2317 @subsubheading Synopsis
2318
2319 @example
2320 -gdb-exit
2321 @end example
2322
2323 Exit GDB immediately.
2324
2325 @subsubheading GDB Command
2326
2327 Approximately corresponds to @samp{quit}.
2328
2329 @subsubheading Example
2330
2331 @smallexample
2332 (gdb)
2333 -gdb-exit
2334 @end smallexample
2335
2336 @subheading The @code{-gdb-set} Command
2337 @findex -gdb-set
2338
2339 @subsubheading Synopsis
2340
2341 @example
2342 -gdb-set
2343 @end example
2344
2345 Set an internal GDB variable.
2346 @c IS THIS A DOLLAR VARIABLE? OR SOMETHING LIKE ANNOTATE ?????
2347
2348 @subsubheading GDB Command
2349
2350 The corresponding GDB command is @samp{set}.
2351
2352 @subsubheading Example
2353
2354 @smallexample
2355 (gdb)
2356 -gdb-set $foo=3
2357 ^done
2358 (gdb)
2359 @end smallexample
2360
2361
2362 @subheading The @code{-gdb-show} Command
2363 @findex -gdb-show
2364
2365 @subsubheading Synopsis
2366
2367 @example
2368 -gdb-show
2369 @end example
2370
2371 Show the current value of a GDB variable.
2372
2373 @subsubheading GDB command
2374
2375 The corresponding GDB command is @samp{show}.
2376
2377 @subsubheading Example
2378
2379 @smallexample
2380 (gdb)
2381 -gdb-show annotate
2382 ^done,value="0"
2383 (gdb)
2384 @end smallexample
2385
2386 @c @subheading -gdb-source
2387
2388
2389 @subheading The @code{-gdb-version} Command
2390 @findex -gdb-version
2391
2392 @subsubheading Synopsis
2393
2394 @example
2395 -gdb-version
2396 @end example
2397
2398 Show version information for GDB. Used mostly in testing.
2399
2400 @subsubheading GDB Command
2401
2402 There's no equivalent GDB command. GDB by default shows this
2403 information when you start an interactive session.
2404
2405 @subsubheading Example
2406
2407 @c This example modifies the actual output from GDB to avoid overfull
2408 @c box in TeX.
2409 @smallexample
2410 (gdb)
2411 -gdb-version
2412 ~GNU gdb 5.2.1
2413 ~Copyright 2000 Free Software Foundation, Inc.
2414 ~GDB is free software, covered by the GNU General Public License, and
2415 ~you are welcome to change it and/or distribute copies of it under
2416 ~ certain conditions.
2417 ~Type "show copying" to see the conditions.
2418 ~There is absolutely no warranty for GDB. Type "show warranty" for
2419 ~ details.
2420 ~This GDB was configured as
2421 "--host=sparc-sun-solaris2.5.1 --target=ppc-eabi".
2422 ^done
2423 (gdb)
2424 @end smallexample
2425
2426 @ignore
2427 @c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2428 @node GDB/MI Kod Commands
2429 @section @sc{gdb/mi} Kod Commands
2430
2431 The Kod commands are not implemented.
2432
2433 @c @subheading -kod-info
2434
2435 @c @subheading -kod-list
2436
2437 @c @subheading -kod-list-object-types
2438
2439 @c @subheading -kod-show
2440
2441 @c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2442 @node GDB/MI Memory Overlay Commands
2443 @section @sc{gdb/mi} Memory Overlay Commands
2444
2445 The memory overlay commands are not implemented.
2446
2447 @c @subheading -overlay-auto
2448
2449 @c @subheading -overlay-list-mapping-state
2450
2451 @c @subheading -overlay-list-overlays
2452
2453 @c @subheading -overlay-map
2454
2455 @c @subheading -overlay-off
2456
2457 @c @subheading -overlay-on
2458
2459 @c @subheading -overlay-unmap
2460
2461 @c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2462 @node GDB/MI Signal Handling Commands
2463 @section @sc{gdb/mi} Signal Handling Commands
2464
2465 Signal handling commands are not implemented.
2466
2467 @c @subheading -signal-handle
2468
2469 @c @subheading -signal-list-handle-actions
2470
2471 @c @subheading -signal-list-signal-types
2472 @end ignore
2473
2474
2475 @c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2476 @node GDB/MI Stack Manipulation
2477 @section Stack manipulation commands in @sc{gdb/mi}
2478
2479
2480 @subheading The @code{-stack-info-frame} Command
2481 @findex -stack-info-frame
2482
2483 @subsubheading Synopsis
2484
2485 @example
2486 -stack-info-frame
2487 @end example
2488
2489 Get info on the current frame.
2490
2491 @subsubheading GDB Command
2492
2493 The corresponding GDB command is @samp{info frame} or @samp{frame}
2494 (without arguments).
2495
2496 @subsubheading Example
2497 N.A.
2498
2499 @subheading The @code{-stack-info-depth} Command
2500 @findex -stack-info-depth
2501
2502 @subsubheading Synopsis
2503
2504 @example
2505 -stack-info-depth [ @var{max-depth} ]
2506 @end example
2507
2508 Return the depth of the stack. If the integer argument @var{max-depth}
2509 is specified, do not count beyond @var{max-depth} frames.
2510
2511 @subsubheading GDB Command
2512
2513 There's no equivalent GDB command.
2514
2515 @subsubheading Example
2516
2517 For a stack with frame levels 0 through 11:
2518
2519 @smallexample
2520 (gdb)
2521 -stack-info-depth
2522 ^done,depth="12"
2523 (gdb)
2524 -stack-info-depth 4
2525 ^done,depth="4"
2526 (gdb)
2527 -stack-info-depth 12
2528 ^done,depth="12"
2529 (gdb)
2530 -stack-info-depth 11
2531 ^done,depth="11"
2532 (gdb)
2533 -stack-info-depth 13
2534 ^done,depth="12"
2535 (gdb)
2536 @end smallexample
2537
2538 @subheading The @code{-stack-list-arguments} Command
2539 @findex -stack-list-arguments
2540
2541 @subsubheading Synopsis
2542
2543 @example
2544 -stack-list-arguments @var{show-values}
2545 [ @var{low-frame} @var{high-frame} ]
2546 @end example
2547
2548 Display a list of the arguments for the frames between @var{low-frame}
2549 and @var{high-frame} (inclusive). If @var{low-frame} and
2550 @var{high-frame} are not provided, list the arguments for the whole call
2551 stack.
2552
2553 The @var{show-values} argument must have a value of 0 or 1. A value of
2554 0 means that only the names of the arguments are listed, a value of 1
2555 means that both names and values of the argumetns are printed.
2556
2557 @subsubheading GDB Command
2558
2559 GDB does not have an equivalent command. @code{gdbtk} has a
2560 @samp{gdb_get_args} command which partially overlaps with the
2561 functionality of @samp{-stack-list-arguments}.
2562
2563 @subsubheading Example
2564
2565 @smallexample
2566 (gdb)
2567 -stack-list-frames
2568 ^done,
2569 stack=@{
2570 frame=@{level="0 ",addr="0x00010734",func="callee4",
2571 file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="8"@},
2572 frame=@{level="1 ",addr="0x0001076c",func="callee3",
2573 file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="17"@},
2574 frame=@{level="2 ",addr="0x0001078c",func="callee2",
2575 file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="22"@},
2576 frame=@{level="3 ",addr="0x000107b4",func="callee1",
2577 file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="27"@},
2578 frame=@{level="4 ",addr="0x000107e0",func="main",
2579 file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="32"@}@}
2580 (gdb)
2581 -stack-list-arguments 0
2582 ^done,
2583 stack-args=@{
2584 frame=@{level="0",args=@{@}@},
2585 frame=@{level="1",args=@{name="strarg"@}@},
2586 frame=@{level="2",args=@{name="intarg",name="strarg"@}@},
2587 frame=@{level="3",args=@{name="intarg",name="strarg",name="fltarg"@}@},
2588 frame=@{level="4",args=@{@}@}@}
2589 (gdb)
2590 -stack-list-arguments 1
2591 ^done,
2592 stack-args=@{
2593 frame=@{level="0",args=@{@}@},
2594 frame=@{level="1",
2595 args=@{@{name="strarg",value="0x11940 \"A string argument.\""@}@}@},
2596 frame=@{level="2",args=@{
2597 @{name="intarg",value="2"@},
2598 @{name="strarg",value="0x11940 \"A string argument.\""@}@}@},
2599 @{frame=@{level="3",args=@{
2600 @{name="intarg",value="2"@},
2601 @{name="strarg",value="0x11940 \"A string argument.\""@},
2602 @{name="fltarg",value="3.5"@}@}@},
2603 frame=@{level="4",args=@{@}@}@}
2604 (gdb)
2605 -stack-list-arguments 0 2 2
2606 ^done,stack-args=@{frame=@{level="2",args=@{name="intarg",name="strarg"@}@}@}
2607 (gdb)
2608 -stack-list-arguments 1 2 2
2609 ^done,stack-args=@{frame=@{level="2",
2610 args=@{@{name="intarg",value="2"@},
2611 @{name="strarg",value="0x11940 \"A string argument.\""@}@}@}@}
2612 (gdb)
2613 @end smallexample
2614
2615 @c @subheading -stack-list-exception-handlers
2616
2617
2618 @subheading The @code{-stack-list-frames} Command
2619 @findex -stack-list-frames
2620
2621 @subsubheading Synopsis
2622
2623 @example
2624 -stack-list-frames [ @var{low-frame} @var{high-frame} ]
2625 @end example
2626
2627 List the frames currently on the stack. For each frame it displays the
2628 following info:
2629
2630 @table @samp
2631 @item @var{level}
2632 The frame number, 0 being the topmost frame, i.e. the innermost function.
2633 @item @var{addr}
2634 The @code{$pc} value for that frame.
2635 @item @var{func}
2636 Function name.
2637 @item @var{file}
2638 File name of the source file where the function lives.
2639 @item @var{line}
2640 Line number corresponding to the @code{$pc}.
2641 @end table
2642
2643 If invoked without arguments, this command prints a backtrace for the
2644 whole stack. If given two integer arguments, it shows the frames whose
2645 levels are between the two arguments (inclusive). If the two arguments
2646 are equal, it shows the single frame at the corresponding level.
2647
2648 @subsubheading GDB Command
2649
2650 The corresponding GDB commands are @samp{backtrace} and @samp{where}.
2651
2652 @subsubheading Example
2653
2654 Full stack backtrace:
2655
2656 @smallexample
2657 (gdb)
2658 -stack-list-frames
2659 ^done,stack=
2660 @{frame=@{level="0 ",addr="0x0001076c",func="foo",
2661 file="recursive2.c",line="11"@},
2662 frame=@{level="1 ",addr="0x000107a4",func="foo",
2663 file="recursive2.c",line="14"@},
2664 frame=@{level="2 ",addr="0x000107a4",func="foo",
2665 file="recursive2.c",line="14"@},
2666 frame=@{level="3 ",addr="0x000107a4",func="foo",
2667 file="recursive2.c",line="14"@},
2668 frame=@{level="4 ",addr="0x000107a4",func="foo",
2669 file="recursive2.c",line="14"@},
2670 frame=@{level="5 ",addr="0x000107a4",func="foo",
2671 file="recursive2.c",line="14"@},
2672 frame=@{level="6 ",addr="0x000107a4",func="foo",
2673 file="recursive2.c",line="14"@},
2674 frame=@{level="7 ",addr="0x000107a4",func="foo",
2675 file="recursive2.c",line="14"@},
2676 frame=@{level="8 ",addr="0x000107a4",func="foo",
2677 file="recursive2.c",line="14"@},
2678 frame=@{level="9 ",addr="0x000107a4",func="foo",
2679 file="recursive2.c",line="14"@},
2680 frame=@{level="10",addr="0x000107a4",func="foo",
2681 file="recursive2.c",line="14"@},
2682 frame=@{level="11",addr="0x00010738",func="main",
2683 file="recursive2.c",line="4"@}@}
2684 (gdb)
2685 @end smallexample
2686
2687 Show frames between low_frame and high_frame:
2688
2689 @smallexample
2690 (gdb)
2691 -stack-list-frames 3 5
2692 ^done,stack=
2693 @{frame=@{level="3 ",addr="0x000107a4",func="foo",
2694 file="recursive2.c",line="14"@},
2695 frame=@{level="4 ",addr="0x000107a4",func="foo",
2696 file="recursive2.c",line="14"@},
2697 frame=@{level="5 ",addr="0x000107a4",func="foo",
2698 file="recursive2.c",line="14"@}@}
2699 (gdb)
2700 @end smallexample
2701
2702 Show a single frame:
2703
2704 @smallexample
2705 (gdb)
2706 -stack-list-frames 3 3
2707 ^done,stack=
2708 @{frame=@{level="3 ",addr="0x000107a4",func="foo",
2709 file="recursive2.c",line="14"@}@}
2710 (gdb)
2711 @end smallexample
2712
2713
2714 @subheading The @code{-stack-list-locals} Command
2715 @findex -stack-list-locals
2716
2717 @subsubheading Synopsis
2718
2719 @example
2720 -stack-list-locals @var{print-values}
2721 @end example
2722
2723 Display the local variables names for the current frame. With an
2724 argument of 0 prints only the names of the variables, with argument of 1
2725 prints also their values.
2726
2727 @subsubheading GDB Command
2728
2729 @samp{info locals} in GDB, @samp{gdb_get_locals} in @code{gdbtk}.
2730
2731 @subsubheading Example
2732
2733 @smallexample
2734 (gdb)
2735 -stack-list-locals 0
2736 ^done,locals=@{name="A",name="B",name="C"@}
2737 (gdb)
2738 -stack-list-locals 1
2739 ^done,locals=@{@{name="A",value="1"@},@{name="B",value="2"@},
2740 @{name="C",value="3"@}@}
2741 (gdb)
2742 @end smallexample
2743
2744
2745 @subheading The @code{-stack-select-frame} Command
2746 @findex -stack-select-frame
2747
2748 @subsubheading Synopsis
2749
2750 @example
2751 -stack-select-frame @var{framenum}
2752 @end example
2753
2754 Change the current frame. Select a different frame @var{framenum} on
2755 the stack.
2756
2757 @subsubheading GDB Command
2758
2759 The corresponding GDB commands are @samp{frame}, @samp{up}, @samp{down},
2760 @samp{select-frame}, @samp{up-silent}, and @samp{down-silent}.
2761
2762 @subsubheading Example
2763
2764 @smallexample
2765 (gdb)
2766 -stack-select-frame 2
2767 ^done
2768 (gdb)
2769 @end smallexample
2770
2771 @c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2772 @node GDB/MI Symbol Query
2773 @section @sc{gdb/mi} Symbol Query Commands
2774
2775
2776 @subheading The @code{-symbol-info-address} Command
2777 @findex -symbol-info-address
2778
2779 @subsubheading Synopsis
2780
2781 @example
2782 -symbol-info-address @var{symbol}
2783 @end example
2784
2785 Describe where @var{symbol} is stored.
2786
2787 @subsubheading GDB Command
2788
2789 the corresponding GDB command is @samp{info address}.
2790
2791 @subsubheading Example
2792 N.A.
2793
2794
2795 @subheading The @code{-symbol-info-file} Command
2796 @findex -symbol-info-file
2797
2798 @subsubheading Synopsis
2799
2800 @example
2801 -symbol-info-file
2802 @end example
2803
2804 Show the file for the symbol.
2805
2806 @subsubheading GDB Command
2807
2808 There's no equivalent GDB command. @code{gdbtk} has
2809 @samp{gdb_filnd_file}.
2810
2811 @subsubheading Example
2812 N.A.
2813
2814
2815 @subheading The @code{-symbol-info-function} Command
2816 @findex -symbol-info-function
2817
2818 @subsubheading Synopsis
2819
2820 @example
2821 -symbol-info-function
2822 @end example
2823
2824 Show which function the symbol lives in.
2825
2826 @subsubheading GDB Command
2827
2828 @samp{gdb_get_function} in @code{gdbtk}.
2829
2830 @subsubheading Example
2831 N.A.
2832
2833
2834 @subheading The @code{-symbol-info-line} Command
2835 @findex -symbol-info-line
2836
2837 @subsubheading Synopsis
2838
2839 @example
2840 -symbol-info-line
2841 @end example
2842
2843 Show the core addresses of the code for a source line.
2844
2845 @subsubheading GDB Command
2846
2847 The corresponding GDB comamnd is @samp{info line}. @code{gdbtk} has the
2848 @samp{gdb_get_line} @samp{gdb_get_file} commands.
2849
2850 @subsubheading Example
2851 N.A.
2852
2853
2854 @subheading The @code{-symbol-info-symbol} Command
2855 @findex -symbol-info-symbol
2856
2857 @subsubheading Synopsis
2858
2859 @example
2860 -symbol-info-symbol @var{addr}
2861 @end example
2862
2863 Describe what symbol is at location @var{addr}.
2864
2865 @subsubheading GDB Command
2866
2867 The corresponding GDB command is @samp{info symbol}.
2868
2869 @subsubheading Example
2870 N.A.
2871
2872
2873 @subheading The @code{-symbol-list-functions} Command
2874 @findex -symbol-list-functions
2875
2876 @subsubheading Synopsis
2877
2878 @example
2879 -symbol-list-functions
2880 @end example
2881
2882 List the functions in the executable.
2883
2884 @subsubheading GDB Command
2885
2886 @samp{info functions} in GDB, @samp{gdb_listfunc} @samp{gdb_search} in
2887 @code{gdbtk}.
2888
2889 @subsubheading Example
2890 N.A.
2891
2892
2893 @subheading The @code{-symbol-list-types} Command
2894 @findex -symbol-list-types
2895
2896 @subsubheading Synopsis
2897
2898 @example
2899 -symbol-list-types
2900 @end example
2901
2902 List all the type names.
2903
2904 @subsubheading GDB Command
2905
2906 The corresponding commands are @samp{info types} in GDB,
2907 @samp{gdb_search} in @code{gdbtk}.
2908
2909 @subsubheading Example
2910 N.A.
2911
2912
2913 @subheading The @code{-symbol-list-variables} Command
2914 @findex -symbol-list-variables
2915
2916 @subsubheading Synopsis
2917
2918 @example
2919 -symbol-list-variables
2920 @end example
2921
2922 List all the global and static variable names.
2923
2924 @subsubheading GDB Command
2925
2926 @samp{info variables} in GDB, @samp{gdb_search} in @code{gdbtk}.
2927
2928 @subsubheading Example
2929 N.A.
2930
2931
2932 @subheading The @code{-symbol-locate} Command
2933 @findex -symbol-locate
2934
2935 @subsubheading Synopsis
2936
2937 @example
2938 -symbol-locate
2939 @end example
2940
2941 @subsubheading GDB Command
2942
2943 @samp{gdb_loc} in @code{gdbtk}.
2944
2945 @subsubheading Example
2946 N.A.
2947
2948
2949 @subheading The @code{-symbol-type} Command
2950 @findex -symbol-type
2951
2952 @subsubheading Synopsis
2953
2954 @example
2955 -symbol-type @var{variable}
2956 @end example
2957
2958 Show type of @var{variable}.
2959
2960 @subsubheading GDB Command
2961
2962 The corresponding GDB command is @samp{ptype}, @code{gdbtk} has
2963 @samp{gdb_obj_variable}.
2964
2965 @subsubheading Example
2966 N.A.
2967
2968
2969 @c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2970 @node GDB/MI Target Manipulation
2971 @section @sc{gdb/mi} Target Manipulation Commands
2972
2973
2974 @subheading The @code{-target-attach} Command
2975 @findex -target-attach
2976
2977 @subsubheading Synopsis
2978
2979 @example
2980 -target-attach @var{pid} | @var{file}
2981 @end example
2982
2983 Attach to a process @var{pid} or a file @var{file} outside of GDB.
2984
2985 @subsubheading GDB command
2986
2987 The corresponding GDB command is @samp{attach}.
2988
2989 @subsubheading Example
2990 N.A.
2991
2992
2993 @subheading The @code{-target-compare-sections} Command
2994 @findex -target-compare-sections
2995
2996 @subsubheading Synopsis
2997
2998 @example
2999 -target-compare-sections [ @var{section} ]
3000 @end example
3001
3002 Compare data of section @var{section} on target to the exec file.
3003 Without the argument, all sections are compared.
3004
3005 @subsubheading GDB Command
3006
3007 The GDB equivalent is @samp{compare-sections}.
3008
3009 @subsubheading Example
3010 N.A.
3011
3012
3013 @subheading The @code{-target-detach} Command
3014 @findex -target-detach
3015
3016 @subsubheading Synopsis
3017
3018 @example
3019 -target-detach
3020 @end example
3021
3022 Disconnect from the remote target. There's no output.
3023
3024 @subsubheading GDB command
3025
3026 The corresponding GDB command is @samp{detach}.
3027
3028 @subsubheading Example
3029
3030 @smallexample
3031 (gdb)
3032 -target-detach
3033 ^done
3034 (gdb)
3035 @end smallexample
3036
3037
3038 @subheading The @code{-target-download} Command
3039 @findex -target-download
3040
3041 @subsubheading Synopsis
3042
3043 @example
3044 -target-download
3045 @end example
3046
3047 Loads the executable onto the remote target.
3048 It prints out an update message every half second, which includes the fields:
3049
3050 @table @samp
3051 @item section
3052 The name of the section.
3053 @item section-sent
3054 The size of what has been sent so far for that section.
3055 @item section-size
3056 The size of the section.
3057 @item total-sent
3058 The total size of what was sent so far (the current and the previous sections).
3059 @item total-size
3060 The size of the overall executable to download.
3061 @end table
3062
3063 @noindent
3064 Each message is sent as status record (@pxref{GDB/MI Output Syntax, ,
3065 @sc{gdb/mi} Output Syntax}).
3066
3067 In addition, it prints the name and size of the sections, as they are
3068 downloaded. These messages include the following fields:
3069
3070 @table @samp
3071 @item section
3072 The name of the section.
3073 @item section-size
3074 The size of the section.
3075 @item total-size
3076 The size of the overall executable to download.
3077 @end table
3078
3079 @noindent
3080 At the end, a summary is printed.
3081
3082 @subsubheading GDB Command
3083
3084 The corresponding GDB command is @samp{load}.
3085
3086 @subsubheading Example
3087
3088 Note: each status message appears on a single line. Here the messages
3089 have been broken down, so they can fit into a page.
3090
3091 @smallexample
3092 (gdb)
3093 -target-download
3094 +download,@{section=".text",section-size="6668",total-size="9880"@}
3095 +download,@{section=".text",section-sent="512",section-size="6668",
3096 total-sent="512",total-size="9880"@}
3097 +download,@{section=".text",section-sent="1024",section-size="6668",
3098 total-sent="1024",total-size="9880"@}
3099 +download,@{section=".text",section-sent="1536",section-size="6668",
3100 total-sent="1536",total-size="9880"@}
3101 +download,@{section=".text",section-sent="2048",section-size="6668",
3102 total-sent="2048",total-size="9880"@}
3103 +download,@{section=".text",section-sent="2560",section-size="6668",
3104 total-sent="2560",total-size="9880"@}
3105 +download,@{section=".text",section-sent="3072",section-size="6668",
3106 total-sent="3072",total-size="9880"@}
3107 +download,@{section=".text",section-sent="3584",section-size="6668",
3108 total-sent="3584",total-size="9880"@}
3109 +download,@{section=".text",section-sent="4096",section-size="6668",
3110 total-sent="4096",total-size="9880"@}
3111 +download,@{section=".text",section-sent="4608",section-size="6668",
3112 total-sent="4608",total-size="9880"@}
3113 +download,@{section=".text",section-sent="5120",section-size="6668",
3114 total-sent="5120",total-size="9880"@}
3115 +download,@{section=".text",section-sent="5632",section-size="6668",
3116 total-sent="5632",total-size="9880"@}
3117 +download,@{section=".text",section-sent="6144",section-size="6668",
3118 total-sent="6144",total-size="9880"@}
3119 +download,@{section=".text",section-sent="6656",section-size="6668",
3120 total-sent="6656",total-size="9880"@}
3121 +download,@{section=".init",section-size="28",total-size="9880"@}
3122 +download,@{section=".fini",section-size="28",total-size="9880"@}
3123 +download,@{section=".data",section-size="3156",total-size="9880"@}
3124 +download,@{section=".data",section-sent="512",section-size="3156",
3125 total-sent="7236",total-size="9880"@}
3126 +download,@{section=".data",section-sent="1024",section-size="3156",
3127 total-sent="7748",total-size="9880"@}
3128 +download,@{section=".data",section-sent="1536",section-size="3156",
3129 total-sent="8260",total-size="9880"@}
3130 +download,@{section=".data",section-sent="2048",section-size="3156",
3131 total-sent="8772",total-size="9880"@}
3132 +download,@{section=".data",section-sent="2560",section-size="3156",
3133 total-sent="9284",total-size="9880"@}
3134 +download,@{section=".data",section-sent="3072",section-size="3156",
3135 total-sent="9796",total-size="9880"@}
3136 ^done,address="0x10004",load-size="9880",transfer-rate="6586",
3137 write-rate="429"
3138 (gdb)
3139 @end smallexample
3140
3141
3142 @subheading The @code{-target-exec-status} Command
3143 @findex -target-exec-status
3144
3145 @subsubheading Synopsis
3146
3147 @example
3148 -target-exec-status
3149 @end example
3150
3151 Provide information on the state of the target (whether it is running or
3152 not, for instance).
3153
3154 @subsubheading GDB Command
3155
3156 There's no equivalent GDB command.
3157
3158 @subsubheading Example
3159 N.A.
3160
3161
3162 @subheading The @code{-target-list-available-targets} Command
3163 @findex -target-list-available-targets
3164
3165 @subsubheading Synopsis
3166
3167 @example
3168 -target-list-available-targets
3169 @end example
3170
3171 List the possible targets to connect to.
3172
3173 @subsubheading GDB Command
3174
3175 The corresponding GDB command is @samp{help target}.
3176
3177 @subsubheading Example
3178 N.A.
3179
3180
3181 @subheading The @code{-target-list-current-targets} Command
3182 @findex -target-list-current-targets
3183
3184 @subsubheading Synopsis
3185
3186 @example
3187 -target-list-current-targets
3188 @end example
3189
3190 Describe the current target.
3191
3192 @subsubheading GDB Command
3193
3194 The corresponding information is printed by @samp{info file} (among
3195 other things).
3196
3197 @subsubheading Example
3198 N.A.
3199
3200
3201 @subheading The @code{-target-list-parameters} Command
3202 @findex -target-list-parameters
3203
3204 @subsubheading Synopsis
3205
3206 @example
3207 -target-list-parameters
3208 @end example
3209
3210 @c ????
3211
3212 @subsubheading GDB Command
3213
3214 No equivalent.
3215
3216 @subsubheading Example
3217 N.A.
3218
3219
3220 @subheading The @code{-target-select} Command
3221 @findex -target-select
3222
3223 @subsubheading Synopsis
3224
3225 @example
3226 -target-select @var{type} @var{parameters ...}
3227 @end example
3228
3229 Connect GDB to the remote target. This command takes two args:
3230
3231 @table @samp
3232 @item @var{type}
3233 The type of target, for instance @samp{async}, @samp{remote}, etc.
3234 @item @var{parameters}
3235 Device names, host names and the like. @xref{Target Commands, ,
3236 Commands for managing targets}, for more details.
3237 @end table
3238
3239 The output is a connection notification, followed by the address at
3240 which the target program is, in the following form:
3241
3242 @smallexample
3243 ^connected,addr="@var{address}",func="@var{function name}",
3244 args=@{@var{arg list}@}
3245 @end smallexample
3246
3247 @subsubheading GDB Command
3248
3249 The corresponding GDB command is @samp{target}.
3250
3251 @subsubheading Example
3252
3253 @smallexample
3254 (gdb)
3255 -target-select async /dev/ttya
3256 ^connected,addr="0xfe00a300",func="??",args=@{@}
3257 (gdb)
3258 @end smallexample
3259
3260 @c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3261 @node GDB/MI Thread Commands
3262 @section @sc{gdb/mi} Thread Commands
3263
3264
3265 @subheading The @code{-thread-info} Command
3266 @findex -thread-info
3267
3268 @subsubheading Synopsis
3269
3270 @example
3271 -thread-info
3272 @end example
3273
3274 @subsubheading GDB command
3275
3276 No equivalent.
3277
3278 @subsubheading Example
3279 N.A.
3280
3281
3282 @subheading The @code{-thread-list-all-threads} Command
3283 @findex -thread-list-all-threads
3284
3285 @subsubheading Synopsis
3286
3287 @example
3288 -thread-list-all-threads
3289 @end example
3290
3291 @subsubheading GDB Command
3292
3293 The equivalent GDB command is @samp{info threads}.
3294
3295 @subsubheading Example
3296 N.A.
3297
3298
3299 @subheading The @code{-thread-list-ids} Command
3300 @findex -thread-list-ids
3301
3302 @subsubheading Synopsis
3303
3304 @example
3305 -thread-list-ids
3306 @end example
3307
3308 Produces a list of the currently known gdb thread ids. At the end of the
3309 list it also prints the total number of such threads.
3310
3311 @subsubheading GDB Command
3312
3313 Part of @samp{info threads} supplies the same information.
3314
3315 @subsubheading Example
3316
3317 No threads present, besides the main process.
3318
3319 @smallexample
3320 (gdb)
3321 -thread-list-ids
3322 ^done,thread-ids=@{@},number-of-threads="0"
3323 (gdb)
3324 @end smallexample
3325
3326
3327 Several threads.
3328
3329 @smallexample
3330 (gdb)
3331 -thread-list-ids
3332 ^done,thread-ids=@{thread-id="3",thread-id="2",thread-id="1"@},
3333 number-of-threads="3"
3334 (gdb)
3335 @end smallexample
3336
3337
3338 @subheading The @code{-thread-select} Command
3339 @findex -thread-select
3340
3341 @subsubheading Synopsis
3342
3343 @example
3344 -thread-select @var{threadnum}
3345 @end example
3346
3347 Make @var{threadnum} the current thread. It prints the number of the new
3348 current thread, and the topmost frame for that thread.
3349
3350 @subsubheading GDB Command
3351
3352 The corresponding GDB command is @samp{thread}.
3353
3354 @subsubheading Example
3355
3356 @smallexample
3357 (gdb)
3358 -exec-next
3359 ^running
3360 (gdb)
3361 *stopped,reason="end-stepping-range",thread-id="2",line="187",
3362 file="../../../devo/gdb/testsuite/gdb.threads/linux-dp.c"
3363 (gdb)
3364 -thread-list-ids
3365 ^done,
3366 thread-ids=@{thread-id="3",thread-id="2",thread-id="1"@},
3367 number-of-threads="3"
3368 (gdb)
3369 -thread-select 3
3370 ^done,new-thread-id="3",
3371 frame=@{level="0 ",func="vprintf",
3372 args=@{@{name="format",value="0x8048e9c \"%*s%c %d %c\\n\""@},
3373 @{name="arg",value="0x2"@}@},file="vprintf.c",line="31"@}
3374 (gdb)
3375 @end smallexample
3376
3377 @c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3378 @node GDB/MI Tracepoint Commands
3379 @section @sc{gdb/mi} Tracepoint Commands
3380
3381 The tracepoint commands are not yet implemented.
3382
3383 @c @subheading -trace-actions
3384
3385 @c @subheading -trace-delete
3386
3387 @c @subheading -trace-disable
3388
3389 @c @subheading -trace-dump
3390
3391 @c @subheading -trace-enable
3392
3393 @c @subheading -trace-exists
3394
3395 @c @subheading -trace-find
3396
3397 @c @subheading -trace-frame-number
3398
3399 @c @subheading -trace-info
3400
3401 @c @subheading -trace-insert
3402
3403 @c @subheading -trace-list
3404
3405 @c @subheading -trace-pass-count
3406
3407 @c @subheading -trace-save
3408
3409 @c @subheading -trace-start
3410
3411 @c @subheading -trace-stop
3412
3413
3414 @c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3415 @node GDB/MI Variable Objects
3416 @section @sc{gdb/mi} Variable Objects
3417
3418
3419 @subheading Motivation for Variable Objects in @sc{gdb/mi}
3420
3421 For the implementation of a variable debugger window (locals, watched
3422 expressions, etc.), we are proposing the adaptation of the existent code
3423 used by @code{Insight}.
3424
3425 The two main reasons for that are:
3426
3427 @enumerate 1
3428 @item
3429 It has been proven in practice (it is already on its second generation).
3430
3431 @item
3432 It will shorten development time (needless to say how important it is
3433 now).
3434 @end enumerate
3435
3436 The original interface was designed to be used by Tcl code, so it was
3437 slightly changed so it could be used through flathead. This document
3438 describes the flathead operations that will be available and gives some
3439 hints about their use.
3440
3441 @emph{Note}: In addition to the set of operations described here, we
3442 expect the @sc{gui} implementation of a variable window to require, at
3443 least, the following operations:
3444
3445 @itemize @bullet
3446 @item -gdb-show output-radix
3447 @item -stack-list-arguments
3448 @item -stack-list-locals
3449 @item -stack-select-frame
3450 @end itemize
3451
3452 @subheading Introduction to Variable Objects in @sc{gdb/mi}
3453
3454 @cindex variable objects in @sc{gdb/mi}
3455 The basic idea behind variable objects is the creation of a named object
3456 to represent a variable, an expression, a memory location or even a CPU
3457 register. For each object created, a set of operations is available for
3458 examining or changing its properties.
3459
3460 Furthermore, complex data types, such as C structures, are represented
3461 in a tree format. For instance, the @code{struct} type variable is the
3462 root and the children will represent the struct members. If a child
3463 is itself of a complex type, it will also have children of its own.
3464 Appropriate language differences are handled for C, C@t{++} and Java.
3465
3466 When returning the actual values of the objects, this facility allows
3467 for the individual selection of the display format used in the result
3468 creation. It can be chosen among: binary, decimal, hexadecimal, octal
3469 and natural. Natural refers to the a default format automatically
3470 chosen based on the variable type (like decimal for an @code{int}, hex
3471 for pointers, etc.).
3472
3473 The following is the complete set of flathead operations defined to
3474 access this functionality:
3475
3476 @multitable @columnfractions .3 .6
3477 @item @strong{Operation}
3478 @tab @strong{Description}
3479
3480 @item -var-create
3481 @tab create a variable object
3482 @item -var-delete
3483 @tab delete the variable object and its children
3484 @item -var-set-format
3485 @tab set the display format of this variable
3486 @item -var-show-format
3487 @tab show the display format of this variable
3488 @item -var-info-num-children
3489 @tab tells how many children this object has
3490 @item -var-list-children
3491 @tab return a list of the object's children
3492 @item -var-info-type
3493 @tab show the type of this variable object
3494 @item -var-info-expression
3495 @tab print what this variable object represents
3496 @item -var-show-attributes
3497 @tab is this variable editable? does it exist here?
3498 @item -var-evaluate-expression
3499 @tab get the value of this variable
3500 @item -var-assign
3501 @tab set the value of this variable
3502 @item -var-update
3503 @tab update the variable and its children
3504 @end multitable
3505
3506 In the next subsection we describe each operation in detail and suggest
3507 how it can be used.
3508
3509 @subheading Description And Use of Operations on Variable Objects
3510
3511 @subheading The @code{-var-create} Command
3512 @findex -var-create
3513
3514 @subsubheading Synopsis
3515
3516 @example
3517 -var-create @{@var{name} | "-"@}
3518 @{@var{frame-addr} | "*"@} @var{expression}
3519 @end example
3520
3521 This operation creates a variable object, which allows the monitoring of
3522 a variable, the result of an expression, a memory cell or a CPU
3523 register.
3524
3525 The @var{name} parameter is the string by which the object can be
3526 referenced. It must be unique. If @samp{-} is specified, the varobj
3527 system will generate a string "varNNNNNN'' automatically. It will be
3528 unique provided that one does not specify @var{name} on that format.
3529 The command fails if a duplicate name is found.
3530
3531 The frame under which the expression should be evaluated can be
3532 specified by @var{frame-addr}. A @samp{*} indicates that the current
3533 frame should be used.
3534
3535 Expression is any expression valid on the current language set (must not
3536 begin with a @samp{*}), or one of the following:
3537
3538 @itemize @bullet
3539 @item
3540 @samp{*@var{addr}}, where @var{addr} is the address of a memory cell
3541
3542 @item
3543 @samp{*@var{addr}-@var{addr}} -- a memory address range (TBD)
3544
3545 @item
3546 @samp{$@var{regname}} -- a CPU register name
3547 @end itemize
3548
3549 @subsubheading Result
3550
3551 This operation returns the name, number of children and the type of the
3552 object created. Type is returned as a string as the ones generated by
3553 the GDB CLI:
3554
3555 @example
3556 name="@var{name}",numchild="N",type="@var{type}"
3557 @end example
3558
3559
3560 @subheading The @code{-var-delete} Command
3561 @findex -var-delete
3562
3563 @subsubheading Synopsis
3564
3565 @example
3566 -var-delete @var{name}
3567 @end example
3568
3569 Deletes a previously created variable object and all of its children.
3570
3571 Returns an error if the object @var{name} is not found.
3572
3573
3574 @subheading The @code{-var-set-format} Command
3575 @findex -var-set-format
3576
3577 @subsubheading Synopsis
3578
3579 @example
3580 -var-set-format @var{name} @var{format-spec}
3581 @end example
3582
3583 Sets the output format for the value of the object @var{name} to be
3584 @var{format-spec}.
3585
3586 The syntax for the @var{format-spec} is as follows:
3587
3588 @example
3589 @var{format-spec} @expansion{}
3590 @{binary | decimal | hexadecimal | octal | natural@}
3591 @end example
3592
3593
3594 @subheading The @code{-var-show-format} Command
3595 @findex -var-show-format
3596
3597 @subsubheading Synopsis
3598
3599 @example
3600 -var-show-format @var{name}
3601 @end example
3602
3603 Returns the format used to display the value of the object @var{name}.
3604
3605 @example
3606 format @expansion{}
3607 @var{format-spec}
3608 @end example
3609
3610
3611 @subheading The @code{-var-info-num-children} Command
3612 @findex -var-info-num-children
3613
3614 @subsubheading Synopsis
3615
3616 @example
3617 -var-info-num-children @var{name}
3618 @end example
3619
3620 Returns the number of children of a variable object @var{name}:
3621
3622 @example
3623 numchild=@var{n}
3624 @end example
3625
3626
3627 @subheading The @code{-var-list-children} Command
3628 @findex -var-list-children
3629
3630 @subsubheading Synopsis
3631
3632 @example
3633 -var-list-children @var{name}
3634 @end example
3635
3636 Returns a list of the children of the specified variable object:
3637
3638 @example
3639 numchild=@var{n},children=@{@{name=@var{name},
3640 numchild=@var{n},type=@var{type}@},(repeats N times)@}
3641 @end example
3642
3643
3644 @subheading The @code{-var-info-type} Command
3645 @findex -var-info-type
3646
3647 @subsubheading Synopsis
3648
3649 @example
3650 -var-info-type @var{name}
3651 @end example
3652
3653 Returns the type of the specified variable @var{name}. The type is
3654 returned as a string in the same format as it is output by the GDB CLI:
3655
3656 @example
3657 type=@var{typename}
3658 @end example
3659
3660
3661 @subheading The @code{-var-info-expression} Command
3662 @findex -var-info-expression
3663
3664 @subsubheading Synopsis
3665
3666 @example
3667 -var-info-expression @var{name}
3668 @end example
3669
3670 Returns what is represented by the variable object @var{name}:
3671
3672 @example
3673 lang=@var{lang-spec},exp=@var{expression}
3674 @end example
3675
3676 @noindent
3677 where @var{lang-spec} is @code{@{"C" | "C++" | "Java"@}}.
3678
3679 @subheading The @code{-var-show-attributes} Command
3680 @findex -var-show-attributes
3681
3682 @subsubheading Synopsis
3683
3684 @example
3685 -var-show-attributes @var{name}
3686 @end example
3687
3688 List attributes of the specified variable object @var{name}:
3689
3690 @example
3691 status=@var{attr} [ ( ,@var{attr} )* ]
3692 @end example
3693
3694 @noindent
3695 where @var{attr} is @code{@{ @{ editable | noneditable @} | TBD @}}.
3696
3697 @subheading The @code{-var-evaluate-expression} Command
3698 @findex -var-evaluate-expression
3699
3700 @subsubheading Synopsis
3701
3702 @example
3703 -var-evaluate-expression @var{name}
3704 @end example
3705
3706 Evaluates the expression that is represented by the specified variable
3707 object and returns its value as a string in the current format specified
3708 for the object:
3709
3710 @example
3711 value=@var{value}
3712 @end example
3713
3714 @subheading The @code{-var-assign} Command
3715 @findex -var-assign
3716
3717 @subsubheading Synopsis
3718
3719 @example
3720 -var-assign @var{name} @var{expression}
3721 @end example
3722
3723 Assigns the value of @var{expression} to the variable object specified
3724 by @var{name}. The object must be ``editable''.
3725
3726 @subheading The @code{-var-update} Command
3727 @findex -var-update
3728
3729 @subsubheading Synopsis
3730
3731 @example
3732 -var-update @{@var{name} | "*"@}
3733 @end example
3734
3735 Update the value of the variable object @var{name} by evaluating its
3736 expression after fetching all the new values from memory or registers.
3737 A @samp{*} causes all existing variable objects to be updated.
3738
3739 @c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3740 @node GDB/MI Draft Changes to Output Syntax
3741 @section @sc{gdb/mi} Draft Changes to Output Syntax
3742
3743 @cindex draft changes to output syntax of @sc{gdb/mi}
3744 @cindex @sc{gdb/mi}, draft changes to output syntax
3745
3746 One problem identified in the existing @sc{gdb/mi} output syntax was the
3747 difficulty in differentiating between a tuple such as:
3748
3749 @example
3750 @{number="1",type="breakpoint",disp="keep",enabled="y"@}
3751 @end example
3752
3753 where each value has a unique label, and a list such as:
3754
3755 @example
3756 @{"1","2","4"@}
3757 @{bp="1",bp="2",bp="4"@}
3758 @end example
3759
3760 where values are un-labeled or the label is duplicated.
3761
3762 What follows is a draft revision to the output specification that
3763 addresses this problem.
3764
3765 The output from @sc{gdb/mi} consists of zero or more out-of-band records
3766 optionally followed by a single result record. The result record being
3767 for the most recent command input. The sequence being terminated by
3768 ``(gdb)''.
3769
3770 Asynchronous @sc{gdb/mi} output is similar.
3771
3772 Each output record directly associated with an input command is prefixed
3773 by the input commands @code{@var{token}}.
3774
3775 @table @code
3776 @item @var{output} @expansion{}
3777 @{ @var{out-of-band-record} @} @code{[} @var{result-record} @code{]} "(gdb)" @var{nl}
3778
3779 @item @var{result-record} @expansion{}
3780 @code{[} @var{token} @code{]} "^" @var{result-class} @{ "," @var{result} @} @var{nl}
3781
3782 @item @var{out-of-band-record} @expansion{}
3783 @var{async-record} @code{|} @var{stream-record}
3784
3785 @item @var{async-record} @expansion{}
3786 @var{exec-async-output} @code{|} @var{status-async-output} @code{|} @var{notify-async-output}
3787
3788 @item @var{exec-async-output} @expansion{}
3789 @code{[} @var{token} @code{]} "*" @var{async-output}
3790
3791 @item @var{status-async-output} @expansion{}
3792 @code{[} @var{token} @code{]} "+" @var{async-output}
3793
3794 @item @var{notify-async-output} @expansion{}
3795 @code{[} @var{token} @code{]} "=" @var{async-output}
3796
3797 @item @var{async-output} @expansion{}
3798 @var{async-class} @{ "," @var{result} @} @var{nl}
3799
3800 @item @var{result-class} @expansion{}
3801 "done" @code{|} "running" @code{|} "connected" @code{|} "error" @code{|} "exit"
3802
3803 @item @var{async-class} @expansion{}
3804 "stopped" @code{|} @emph{others depending on need as still in development}
3805
3806 @item @var{result} @expansion{}
3807 @var{string} "=" @var{value}
3808
3809 @item @var{value} @expansion{}
3810 @var{c-string} @code{|} @var{tupple} @code{|} @var{list}
3811
3812 @item @var{tupple} @expansion{}
3813 "@{@}" @code{|} "@{" @var{result} @{ "," @var{result} @} "@}"
3814
3815 @item @var{list} @expansion{}
3816 "@code{[]}" @code{|} "@code{[}" @var{value} @{ "," @var{value} @} "@code{]}"
3817
3818 @item @var{string} @expansion{}
3819 @emph{[-A-Za-z\.0-9_]*}
3820
3821 @item @var{c-string} @expansion{}
3822 @emph{See the input specification}
3823
3824 @item @var{stream-record} @expansion{}
3825 @var{console-stream-output} @code{|} @var{target-stream-output} @code{|} @var{log-stream-output}
3826
3827 @item @var{console-stream-output} @expansion{}
3828 "~" @var{c-string}
3829
3830 @item @var{target-stream-output} @expansion{}
3831 "@@" @var{c-string}
3832
3833 @item @var{log-stream-output} @expansion{}
3834 "&" @var{c-string}
3835
3836 @item @var{nl} @expansion{}
3837 CR @code{|} CR-LF
3838
3839 @item @var{token} @expansion{}
3840 "any sequence of digits"
3841
3842 @end table
3843
3844 In addition, the following are still being developed.
3845
3846 @table @code
3847
3848 @item @var{query}
3849 This action is currently undefined.
3850
3851 @end table
3852
3853 Notes:
3854
3855 @itemize @bullet
3856
3857 @item
3858 All output sequences end in a single line containing a period.
3859
3860 @item
3861 The @code{@var{token}} is from the corresponding request. If an execution
3862 command is interrupted by the -exec-interrupt command, the token
3863 associated with the `*stopped' message is the one of the original
3864 execution command, not the one of the interrupt-command.
3865
3866 @item
3867 @var{status-async-output} contains on-going status information about the progress
3868 of a slow operation. It can be discarded. All status output is prefixed by
3869 the prefix `+'.
3870
3871 @item
3872 @var{exec-async-output} contains asynchronous state change on the target
3873 (stopped, started, disappeared). All async output is prefixed by
3874 the prefix `*'.
3875
3876 @item
3877 @var{notify-async-output} contains supplementary information that the client should
3878 handle (new breakpoint information). All notify output is prefixed by
3879 the prefix `='.
3880
3881 @item
3882 @var{console-stream-output} is output that should be displayed as is in the
3883 console. It is the textual response to a CLI command. All the console
3884 output is prefixed by the prefix ``~''.
3885
3886 @item
3887 @var{target-stream-output} is the output produced by the target program.
3888 All the target output is prefixed by the prefix ``@@''.
3889
3890 @item
3891 @var{log-stream-output} is output text coming from GDB's internals, for
3892 instance messages that should be displayed as part of an error log. All
3893 the log output is prefixed by the prefix ``&''.
3894
3895 @end itemize
3896
3897 @c Local variables:
3898 @c change-log-default-name: "ChangeLog-mi"
3899 @c End: