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