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