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