OSDN Git Service

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