OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [gdb-5.0/] [gdb/] [mi/] [gdbmi.texinfo] - Blame information for rev 1774

Go to most recent revision | Details | Compare with Previous | View Log

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

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.