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