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

Subversion Repositories or1k

[/] [or1k/] [trunk/] [gdb-5.0/] [gdb/] [doc/] [gdb.info-10] - Blame information for rev 107

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

Line No. Rev Author Line
1 106 markom
This is ./gdb.info, produced by Makeinfo version 3.12f from gdb.texinfo.
2
 
3
INFO-DIR-SECTION Programming & development tools.
4
START-INFO-DIR-ENTRY
5
* Gdb: (gdb).                     The GNU debugger.
6
END-INFO-DIR-ENTRY
7
 
8
   This file documents the GNU debugger GDB.
9
 
10
   This is the Eighth Edition, March 2000, of `Debugging with GDB: the
11
GNU Source-Level Debugger' for GDB Version 5.0.
12
 
13
   Copyright (C) 1988-2000 Free Software Foundation, Inc.
14
 
15
   Permission is granted to make and distribute verbatim copies of this
16
manual provided the copyright notice and this permission notice are
17
preserved on all copies.
18
 
19
   Permission is granted to copy and distribute modified versions of
20
this manual under the conditions for verbatim copying, provided also
21
that the entire resulting derived work is distributed under the terms
22
of a permission notice identical to this one.
23
 
24
   Permission is granted to copy and distribute translations of this
25
manual into another language, under the above conditions for modified
26
versions.
27
 
28

29
File: gdb.info,  Node: GDB/MI Result Records,  Next: GDB/MI Stream Records,  Up: GDB/MI Output Records
30
 
31
GDB/MI Result Records
32
---------------------
33
 
34
   In addition to a number of out-of-band notifications, the response
35
to a GDB/MI command includes one of the following result indications:
36
 
37
`"^done" [ "," RESULTS ]'
38
     The synchronous operation was successful, `RESULTS' is the return
39
     value.
40
 
41
`"^running"'
42
     The asynchronous operation was successfully started.  The target is
43
     running.
44
 
45
`"^error" "," C-STRING'
46
     The operation failed.  The `C-STRING' contains the corresponding
47
     error message.
48
 
49

50
File: gdb.info,  Node: GDB/MI Stream Records,  Next: GDB/MI Out-of-band Records,  Prev: GDB/MI Result Records,  Up: GDB/MI Output Records
51
 
52
GDB/MI Stream Records
53
---------------------
54
 
55
   GDB internally maintains a number of output streams: the console, the
56
target, and the log.  The output intended for each of these streams is
57
funneled through the GDB/MI interface using "stream records".
58
 
59
   Each stream record begins with a unique "prefix character" which
60
identifies its stream (*note GDB/MI Output Syntax: GDB/MI Output
61
Syntax.). In addition to the prefix, each stream record contains a
62
`STRING-OUTPUT'.  This is either raw text (with an implicit new line)
63
or a quoted C string (which does not contain an implicit newline).
64
 
65
`"~" STRING-OUTPUT'
66
     The console output stream contains text that should be displayed
67
     in the CLI console window.  It contains the textual responses to
68
     CLI commands.
69
 
70
`"@" STRING-OUTPUT'
71
     The target output stream contains any textual output from the
72
     running target.
73
 
74
`"&" STRING-OUTPUT'
75
     The LOG stream contains debugging messages being produced by GDB's
76
     internals.
77
 
78

79
File: gdb.info,  Node: GDB/MI Out-of-band Records,  Prev: GDB/MI Stream Records,  Up: GDB/MI Output Records
80
 
81
GDB/MI Out-of-band Records
82
--------------------------
83
 
84
   "Out-of-band" records are used to notify the GDB/MI client of
85
additional changes that have occurred.  Those changes can either be a
86
consequence of GDB/MI (e.g., a breakpoint modified) or a result of
87
target activity (e.g., target stopped).
88
 
89
   The following is a preliminary list of possible out-of-band records.
90
 
91
`"*" "stop"'
92

93
File: gdb.info,  Node: GDB/MI Command Description Format,  Next: GDB/MI Breakpoint Table Commands,  Prev: GDB/MI Output Records,  Up: GDB/MI
94
 
95
GDB/MI Command Description Format
96
=================================
97
 
98
   The remaining sections describe blocks of commands.  Each block of
99
commands is laid out in a fashion similar to this chapter.
100
 
101
   Note the the line breaks shown in the examples are here only for
102
readability. They don't appear in the real output.  Also note that the
103
commands with a non-available example (N.A.) are not yet implemented.
104
 
105
Motivation
106
----------
107
 
108
   The motivation for this collection of commands
109
 
110
Introduction
111
------------
112
 
113
   A brief introduction to this collection of commands as a whole.
114
 
115
Commands
116
--------
117
 
118
   For each command in the block, the following is described:
119
 
120
Synopsis
121
........
122
 
123
      -command ARGS...
124
 
125
GDB Command
126
...........
127
 
128
   The corresponding GDB CLI command.
129
 
130
Result
131
......
132
 
133
Out-of-band
134
...........
135
 
136
Notes
137
.....
138
 
139
Example
140
.......
141
 
142

143
File: gdb.info,  Node: GDB/MI Breakpoint Table Commands,  Next: GDB/MI Data Manipulation,  Prev: GDB/MI Command Description Format,  Up: GDB/MI
144
 
145
GDB/MI Breakpoint table commands
146
================================
147
 
148
   This section documents GDB/MI commands for manipulating breakpoints.
149
 
150
The `-break-after' Command
151
--------------------------
152
 
153
Synopsis
154
........
155
 
156
      -break-after NUMBER COUNT
157
 
158
   The breakpoint number NUMBER is not in effect until it has been hit
159
COUNT times.  To see how this is reflected in the output of the
160
`-break-list' command, see the description of the `-break-list' command
161
below.
162
 
163
GDB Command
164
...........
165
 
166
   The corresponding GDB command is `ignore'.
167
 
168
Example
169
.......
170
 
171
     (gdb)
172
     -break-insert main
173
     ^done,bkpt={number="1",addr="0x000100d0",file="hello.c",line="5"}
174
     (gdb)
175
     -break-after 1 3
176
     ~
177
     ^done
178
     (gdb)
179
     -break-list
180
     ^done,BreakpointTable={hdr={"Num","Type","Disp","Enb","Address","What"},
181
     bkpt={number="1",type="breakpoint",disp="keep",enabled="y",
182
     addr="0x000100d0",func="main",file="hello.c",line="5",times="0",
183
     ignore="3"}}
184
     (gdb)
185
 
186
-break-condition
187
----------------
188
 
189
Synopsis
190
........
191
 
192
      -break-condition NUMBER EXPR
193
 
194
   Breakpoint NUMBER will stop the program only if the condition in
195
EXPR is true.  The condition becomes part of the `-break-list' output
196
(see the description of the `-break-list' command below).
197
 
198
GDB Command
199
...........
200
 
201
   The corresponding GDB command is `condition'.
202
 
203
Example
204
.......
205
 
206
     (gdb)
207
     -break-condition 1 1
208
     ^done
209
     (gdb)
210
     -break-list
211
     ^done,BreakpointTable={hdr={"Num","Type","Disp","Enb","Address","What"},
212
     bkpt={number="1",type="breakpoint",disp="keep",enabled="y",
213
     addr="0x000100d0",func="main",file="hello.c",line="5",cond="1",
214
     times="0",ignore="3"}}
215
     (gdb)
216
 
217
The `-break-delete' Command
218
---------------------------
219
 
220
Synopsis
221
........
222
 
223
      -break-delete ( BREAKPOINT )+
224
 
225
   Delete the breakpoint(s) whose number(s) are specified in the
226
argument list. This is obviously reflected in the breakpoint list.
227
 
228
GDB command
229
...........
230
 
231
   The corresponding GDB command is `delete'.
232
 
233
Example
234
.......
235
 
236
     (gdb)
237
     -break-delete 1
238
     ^done
239
     (gdb)
240
     -break-list
241
     ^done,BreakpointTable={}
242
     (gdb)
243
 
244
The `-break-disable' Command
245
----------------------------
246
 
247
Synopsis
248
........
249
 
250
      -break-disable ( BREAKPOINT )+
251
 
252
   Disable the named BREAKPOINT(s).  The field `enabled' in the break
253
list is now set to `n' for the named BREAKPOINT(s).
254
 
255
GDB Command
256
...........
257
 
258
   The corresponding GDB command is `disable'.
259
 
260
Example
261
.......
262
 
263
     (gdb)
264
     -break-disable 2
265
     ^done
266
     (gdb)
267
     -break-list
268
     ^done,BreakpointTable={hdr={"Num","Type","Disp","Enb","Address","What"},
269
     bkpt={number="2",type="breakpoint",disp="keep",enabled="n",
270
     addr="0x000100d0",func="main",file="hello.c",line="5",times="0"}}
271
     (gdb)
272
 
273
The `-break-enable' Command
274
---------------------------
275
 
276
Synopsis
277
........
278
 
279
      -break-enable ( BREAKPOINT )+
280
 
281
   Enable (previously disabled) BREAKPOINT(s).
282
 
283
GDB Command
284
...........
285
 
286
   The corresponding GDB command is `enable'.
287
 
288
Example
289
.......
290
 
291
     (gdb)
292
     -break-enable 2
293
     ^done
294
     (gdb)
295
     -break-list
296
     ^done,BreakpointTable={hdr={"Num","Type","Disp","Enb","Address","What"},
297
     bkpt={number="2",type="breakpoint",disp="keep",enabled="y",
298
     addr="0x000100d0",func="main",file="hello.c",line="5",times="0"}}
299
     (gdb)
300
 
301
The `-break-info' Command
302
-------------------------
303
 
304
Synopsis
305
........
306
 
307
      -break-info BREAKPOINT
308
 
309
   Get information about a single breakpoint.
310
 
311
GDB command
312
...........
313
 
314
   The corresponding GDB command is `info break BREAKPOINT'.
315
 
316
Example
317
.......
318
 
319
   N.A.
320
 
321
The `-break-insert' Command
322
---------------------------
323
 
324
Synopsis
325
........
326
 
327
      -break-insert [ -t ] [ -h ] [ -r ]
328
         [ -c CONDITION ] [ -i IGNORE-COUNT ]
329
         [ -p THREAD ] [ LINE | ADDR ]
330
 
331
If specified, LINE, can be one of:
332
 
333
   * function
334
 
335
   * filename:linenum
336
 
337
   * filename:function
338
 
339
   * *address
340
 
341
   The possible optional parameters of this command are:
342
 
343
`-t'
344
     Insert a tempoary breakpoint.
345
 
346
`-h'
347
     Insert a hardware breakpoint.
348
 
349
`-c CONDITION'
350
     Make the breakpoint conditional on CONDITION.
351
 
352
`-i IGNORE-COUNT'
353
     Initialize the IGNORE-COUNT.
354
 
355
`-r'
356
     Insert a regular breakpoint in all the functions whose names match
357
     the given regular expression.  Other flags are not applicable to
358
     regular expresson.
359
 
360
Result
361
......
362
 
363
   The result is in the form:
364
 
365
      ^done,bkptno="NUMBER",func="FUNCNAME",
366
       file="FILENAME",line="LINENO"
367
 
368
where NUMBER is the GDB number for this breakpoint, FUNCNAME is the
369
name of the function where the breakpoint was inserted, FILENAME is the
370
name of the source file which contains this function, and LINENO is the
371
source line number within that file.
372
 
373
   Note: this format is open to change.
374
 
375
GDB Command
376
...........
377
 
378
   The corresponding GDB commands are `break', `tbreak', `hbreak',
379
`thbreak', and `rbreak'.
380
 
381
Example
382
.......
383
 
384
     (gdb)
385
     -break-insert main
386
     ^done,bkpt={number="1",addr="0x0001072c",file="recursive2.c",line="4"}
387
     (gdb)
388
     -break-insert -t foo
389
     ^done,bkpt={number="2",addr="0x00010774",file="recursive2.c",line="11"}
390
     (gdb)
391
     -break-list
392
     ^done,BreakpointTable={hdr={"Num","Type","Disp","Enb","Address","What"},
393
     bkpt={number="1",type="breakpoint",disp="keep",enabled="y",
394
     addr="0x0001072c", func="main",file="recursive2.c",line="4",times="0"},
395
     bkpt={number="2",type="breakpoint",disp="del",enabled="y",
396
     addr="0x00010774",func="foo",file="recursive2.c",line="11",times="0"}}
397
     (gdb)
398
     -break-insert -r foo.*
399
     ~int foo(int, int);
400
     ^done,bkpt={number="3",addr="0x00010774",file="recursive2.c",line="11"}
401
     (gdb)
402
 
403
The `-break-list' Command
404
-------------------------
405
 
406
Synopsis
407
........
408
 
409
      -break-list
410
 
411
   Displays the list of inserted breakpoints, showing the following
412
fields:
413
 
414
`Number'
415
     number of the breakpoint
416
 
417
`Type'
418
     type of the breakpoint: `breakpoint' or `watchpoint'
419
 
420
`Disposition'
421
     should the breakpoint be deleted or disabled when it is hit: `keep'
422
     or `nokeep'
423
 
424
`Enabled'
425
     is the breakpoint enabled or no: `y' or `n'
426
 
427
`Address'
428
     memory location at which the breakpoint is set
429
 
430
`What'
431
     logical location of the breakpoint, expressed by function name,
432
     file name, line number
433
 
434
`times'
435
     number of times the breakpoint has been hit
436
 
437
   If there are no breakpoints or watchpoints, the BreakpointTable
438
field is an empty list.
439
 
440
GDB Command
441
...........
442
 
443
   The corresponding GDB command is `info break'.
444
 
445
Example
446
.......
447
 
448
     (gdb)
449
     -break-list
450
     ^done,BreakpointTable={hdr={"Num","Type","Disp","Enb","Address","What"},
451
     bkpt={number="1",type="breakpoint",disp="keep",enabled="y",
452
     addr="0x000100d0",func="main",file="hello.c",line="5",times="0"},
453
     bkpt={number="2",type="breakpoint",disp="keep",enabled="y",
454
     addr="0x00010114",func="foo",file="hello.c",line="13",times="0"}}
455
     (gdb)
456
 
457
   Here's an example of the result when there are no breakpoints:
458
 
459
     (gdb)
460
     -break-list
461
     ^done,BreakpointTable={}
462
     (gdb)
463
 
464
The `-break-watch' Command
465
--------------------------
466
 
467
Synopsis
468
........
469
 
470
      -break-watch [ -a | -r ]
471
 
472
   Create a watchpoint.  With the `-a' option it will create an
473
"access" watchpoint, i.e. a watchpoint that triggers either on a read
474
from or on a write to the memory location.  With the `-r' option, the
475
watchpoint created is a "read" watchpoint, i.e. it will trigger only
476
when the memory location is accessed for reading.  Without either of
477
the options, the watchpoint created is a regular watchpoint, i.e. it
478
will trigger when the memory location is accessed for writing.  *Note
479
Setting watchpoints: Set Watchpoints.
480
 
481
   Note that `-break-list' will report a single list of watchpoints and
482
breakpoints inserted.
483
 
484
GDB Command
485
...........
486
 
487
   The corresponding GDB commands are `watch', `awatch', and `rwatch'.
488
 
489
Example
490
.......
491
 
492
   Setting a watchpoint on a variable in the `main' function:
493
 
494
     (gdb)
495
     -break-watch x
496
     ^done,wpt={number="2",exp="x"}
497
     (gdb)
498
     -exec-continue
499
     ^running
500
     ^done,reason="watchpoint-trigger",wpt={number="2",exp="x"},
501
     value={old="-268439212",new="55"},
502
     frame={func="main",args={},file="recursive2.c",line="5"}
503
     (gdb)
504
 
505
   Setting a watchpoint on a variable local to a function.  GDB will
506
stop the program execution twice: first for the variable changing
507
value, then for the watchpoint going out of scope.
508
 
509
     (gdb)
510
     -break-watch C
511
     ^done,wpt={number="5",exp="C"}
512
     (gdb)
513
     -exec-continue
514
     ^running
515
     ^done,reason="watchpoint-trigger",
516
     wpt={number="5",exp="C"},value={old="-276895068",new="3"},
517
     frame={func="callee4",args={},
518
     file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="13"}
519
     (gdb)
520
     -exec-continue
521
     ^running
522
     ^done,reason="watchpoint-scope",wpnum="5",
523
     frame={func="callee3",args={{name="strarg",
524
     value="0x11940 \"A string argument.\""}},
525
     file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="18"}
526
     (gdb)
527
 
528
   Listing breakpoints and watchpoints, at different points in the
529
program execution.  Note that once the watchpoint goes out of scope, it
530
is deleted.
531
 
532
     (gdb)
533
     -break-watch C
534
     ^done,wpt={number="2",exp="C"}
535
     (gdb)
536
     -break-list
537
     ^done,BreakpointTable={hdr={"Num","Type","Disp","Enb","Address","What"},
538
     bkpt={number="1",type="breakpoint",disp="keep",enabled="y",
539
     addr="0x00010734",func="callee4",
540
     file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="8",times="1"},
541
     bkpt={number="2",type="watchpoint",disp="keep",
542
     enabled="y",addr="",what="C",times="0"}}
543
     (gdb)
544
     -exec-continue
545
     ^running
546
     ^done,reason="watchpoint-trigger",wpt={number="2",exp="C"},
547
     value={old="-276895068",new="3"},
548
     frame={func="callee4",args={},
549
     file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="13"}
550
     (gdb)
551
     -break-list
552
     ^done,BreakpointTable={hdr={"Num","Type","Disp","Enb","Address","What"},
553
     bkpt={number="1",type="breakpoint",disp="keep",enabled="y",
554
     addr="0x00010734",func="callee4",
555
     file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="8",times="1"},
556
     bkpt={number="2",type="watchpoint",disp="keep",
557
     enabled="y",addr="",what="C",times="-5"}}
558
     (gdb)
559
     -exec-continue
560
     ^running
561
     ^done,reason="watchpoint-scope",wpnum="2",
562
     frame={func="callee3",args={{name="strarg",
563
     value="0x11940 \"A string argument.\""}},
564
     file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="18"}
565
     (gdb)
566
     -break-list
567
     ^done,BreakpointTable={hdr={"Num","Type","Disp","Enb","Address","What"},
568
     bkpt={number="1",type="breakpoint",disp="keep",enabled="y",
569
     addr="0x00010734",func="callee4",
570
     file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="8",times="1"}}
571
     (gdb)
572
 
573

574
File: gdb.info,  Node: GDB/MI Data Manipulation,  Next: GDB/MI Program Control,  Prev: GDB/MI Breakpoint Table Commands,  Up: GDB/MI
575
 
576
GDB/MI Data Manipulation
577
========================
578
 
579
   This section describes the GDB/MI commands that manipulate data:
580
examine memory and registers, evaluate expressions, etc.
581
 
582
The `-data-disassemble' Command
583
-------------------------------
584
 
585
Synopsis
586
........
587
 
588
      -data-disassemble
589
         [ -s START-ADDR -e END-ADDR ]
590
       | [ -f FILENAME -l LINENUM [ -n LINES ] ]
591
       -- MODE
592
 
593
Where:
594
 
595
`START-ADDR'
596
     is the beginning address (or `$pc')
597
 
598
`END-ADDR'
599
     is the end address
600
 
601
`FILENAME'
602
     is the name of the file to disassemble
603
 
604
`LINENUM'
605
     is the line number to disassemble around
606
 
607
`LINES'
608
     is the the number of disassembly lines to be produced.  If it is
609
     -1, the whole function will be disassembled, in case no END-ADDR is
610
     specified.  If END-ADDR is specified as a non-zero value, and
611
     LINES is lower than the number of disassembly lines between
612
     START-ADDR and END-ADDR, only LINES lines are displayed; if LINES
613
     is higher than the number of lines between START-ADDR and
614
     END-ADDR, only the lines up to END-ADDR are displayed.
615
 
616
`MODE'
617
     is either 0 (meaning only disassembly) or 1 (meaning mixed source
618
     and disassembly)
619
 
620
Result
621
......
622
 
623
   The output for each instruction is composed of two fields:
624
 
625
   * Address
626
 
627
   * Func-name
628
 
629
   * Offset
630
 
631
   * Instruction
632
 
633
   Note that whatever included in the instruction field, is not
634
manipulated directely by flathead, i.e. it is not possible to adjust
635
its format.
636
 
637
GDB Command
638
...........
639
 
640
   There's no direct mapping from this command to the CLI.
641
 
642
Example
643
.......
644
 
645
   Disassemble from the current value of `$pc' to `$pc + 20':
646
 
647
     (gdb)
648
     -data-disassemble -s $pc -e "$pc + 20" -- 0
649
     ^done,
650
     asm_insns={
651
     {address="0x000107c0",func-name="main",offset="4",
652
     inst="mov  2, %o0"},
653
     {address="0x000107c4",func-name="main",offset="8",
654
     inst="sethi  %hi(0x11800), %o2"},
655
     {address="0x000107c8",func-name="main",offset="12",
656
     inst="or  %o2, 0x140, %o1\t! 0x11940 <_lib_version+8>"},
657
     {address="0x000107cc",func-name="main",offset="16",
658
     inst="sethi  %hi(0x11800), %o2"},
659
     {address="0x000107d0",func-name="main",offset="20",
660
     inst="or  %o2, 0x168, %o4\t! 0x11968 <_lib_version+48>"}}
661
     (gdb)
662
 
663
   Disassemble the whole `main' function.  Line 32 is part of `main'.
664
 
665
     -data-disassemble -f basics.c -l 32 -- 0
666
     ^done,asm_insns={
667
     {address="0x000107bc",func-name="main",offset="0",
668
     inst="save  %sp, -112, %sp"},
669
     {address="0x000107c0",func-name="main",offset="4",
670
     inst="mov   2, %o0"},
671
     {address="0x000107c4",func-name="main",offset="8",
672
     inst="sethi %hi(0x11800), %o2"},
673
     [...]
674
     {address="0x0001081c",func-name="main",offset="96",inst="ret "},
675
     {address="0x00010820",func-name="main",offset="100",inst="restore "}}
676
     (gdb)
677
 
678
   Disassemble 3 instructions from the start of `main':
679
 
680
     (gdb)
681
     -data-disassemble -f basics.c -l 32 -n 3 -- 0
682
     ^done,asm_insns={
683
     {address="0x000107bc",func-name="main",offset="0",
684
     inst="save  %sp, -112, %sp"},
685
     {address="0x000107c0",func-name="main",offset="4",
686
     inst="mov  2, %o0"},
687
     {address="0x000107c4",func-name="main",offset="8",
688
     inst="sethi  %hi(0x11800), %o2"}}
689
     (gdb)
690
 
691
   Disassemble 3 instructions from the start of `main' in mixed mode:
692
 
693
     (gdb)
694
     -data-disassemble -f basics.c -l 32 -n 3 -- 1
695
     ^done,asm_insns={
696
     src_and_asm_line={line="31",
697
     file="/kwikemart/marge/ezannoni/flathead-dev/devo/gdb/ \
698
       testsuite/gdb.mi/basics.c",line_asm_insn={
699
     {address="0x000107bc",func-name="main",offset="0",
700
     inst="save  %sp, -112, %sp"}}},
701
 
702
     src_and_asm_line={line="32",
703
     file="/kwikemart/marge/ezannoni/flathead-dev/devo/gdb/ \
704
       testsuite/gdb.mi/basics.c",line_asm_insn={
705
     {address="0x000107c0",func-name="main",offset="4",
706
     inst="mov  2, %o0"},
707
     {address="0x000107c4",func-name="main",offset="8",
708
     inst="sethi  %hi(0x11800), %o2"}}}}
709
     (gdb)
710
 
711
The `-data-evaluate-expression' Command
712
---------------------------------------
713
 
714
Synopsis
715
........
716
 
717
      -data-evaluate-expression EXPR
718
 
719
   Evaluate EXPR as an expression.  The expression could contain an
720
inferior function call.  The function call will execute synchronously.
721
If the expression contains spaces, it must be enclosed in double quotes.
722
 
723
GDB Command
724
...........
725
 
726
   The corresponding GDB commands are `print', `output', and `call'.
727
In `gdbtk' only, there's a corresponding `gdb_eval' command.
728
 
729
Example
730
.......
731
 
732
   In the following example, the numbers that precede the commands are
733
the "tokens" described in *Note GDB/MI Command Syntax: GDB/MI Command
734
Syntax.  Notice how GDB/MI returns the same tokens in its output.
735
 
736
     211-data-evaluate-expression A
737
     211^done,value="1"
738
     (gdb)
739
     311-data-evaluate-expression &A
740
     311^done,value="0xefffeb7c"
741
     (gdb)
742
     411-data-evaluate-expression A+3
743
     411^done,value="4"
744
     (gdb)
745
     511-data-evaluate-expression "A + 3"
746
     511^done,value="4"
747
     (gdb)
748
 
749
The `-data-list-changed-registers' Command
750
------------------------------------------
751
 
752
Synopsis
753
........
754
 
755
      -data-list-changed-registers
756
 
757
   Display a list of the registers that have changed.
758
 
759
GDB Command
760
...........
761
 
762
   GDB doesn't have a direct analog for this command; `gdbtk' has the
763
corresponding command `gdb_changed_register_list'.
764
 
765
Example
766
.......
767
 
768
   On a PPC MBX board:
769
 
770
     (gdb)
771
     -exec-continue
772
     ^running
773
 
774
     (gdb)
775
     *stopped,reason="breakpoint-hit",bkptno="1",frame={func="main",
776
     args={},file="try.c",line="5"}
777
     (gdb)
778
     -data-list-changed-registers
779
     ^done,changed-registers={"0","1","2","4","5","6","7","8","9",
780
     "10","11","13","14","15","16","17","18","19","20","21","22","23",
781
     "24","25","26","27","28","30","31","64","65","66","67","69"}
782
     (gdb)
783
 
784
The `-data-list-register-names' Command
785
---------------------------------------
786
 
787
Synopsis
788
........
789
 
790
      -data-list-register-names [ ( REGNO )+ ]
791
 
792
   Show a list of register names for the current target.  If no
793
arguments are given, it shows a list of the names of all the registers.
794
If integer numbers are given as arguments, it will print a list of the
795
names of the registers corresponding to the arguments.
796
 
797
GDB Command
798
...........
799
 
800
   GDB does not have a command which corresponds to
801
`-data-list-register-names'.  In `gdbtk' there is a corresponding
802
command `gdb_regnames'.
803
 
804
Example
805
.......
806
 
807
   For the PPC MBX board:
808
     (gdb)
809
     -data-list-register-names
810
     ^done,register-names={"r0","r1","r2","r3","r4","r5","r6","r7",
811
     "r8","r9","r10","r11","r12","r13","r14","r15","r16","r17","r18",
812
     "r19","r20","r21","r22","r23","r24","r25","r26","r27","r28","r29",
813
     "r30","r31","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9",
814
     "f10","f11","f12","f13","f14","f15","f16","f17","f18","f19","f20",
815
     "f21","f22","f23","f24","f25","f26","f27","f28","f29","f30","f31",
816
     "pc","ps","cr","lr","ctr","xer"}
817
     (gdb)
818
     -data-list-register-names 1 2 3
819
     ^done,register-names={"r1","r2","r3"}
820
     (gdb)
821
 
822
The `-data-list-register-values' Command
823
----------------------------------------
824
 
825
Synopsis
826
........
827
 
828
      -data-list-register-values FMT [ ( REGNO )*]
829
 
830
   Display the registers' contents.  FMT is the format according to
831
which the registers' contents are to be returned, followed by an
832
optional list of numbers specifying the registers to display.  A
833
missing list of numbers indicates that the contents of all the
834
registers must be returned.
835
 
836
   Allowed formats for FMT are:
837
 
838
`x'
839
     Hexadecimal
840
 
841
`o'
842
     Octal
843
 
844
`t'
845
     Binary
846
 
847
`d'
848
     Decimal
849
 
850
`r'
851
     Raw
852
 
853
`N'
854
     Natural
855
 
856
GDB Command
857
...........
858
 
859
   The corresponding GDB commands are `info reg', `info all-reg', and
860
(in `gdbtk') `gdb_fetch_registers'.
861
 
862
Example
863
.......
864
 
865
   For a PPC MBX board (note: line breaks are for readability only, they
866
don't appear in the actual output):
867
 
868
     (gdb)
869
     -data-list-register-values r 64 65
870
     ^done,register-values={{number="64",value="0xfe00a300"},
871
     {number="65",value="0x00029002"}}
872
     (gdb)
873
     -data-list-register-values x
874
     ^done,register-values={{number="0",value="0xfe0043c8"},
875
     {number="1",value="0x3fff88"},{number="2",value="0xfffffffe"},
876
     {number="3",value="0x0"},{number="4",value="0xa"},
877
     {number="5",value="0x3fff68"},{number="6",value="0x3fff58"},
878
     {number="7",value="0xfe011e98"},{number="8",value="0x2"},
879
     {number="9",value="0xfa202820"},{number="10",value="0xfa202808"},
880
     {number="11",value="0x1"},{number="12",value="0x0"},
881
     {number="13",value="0x4544"},{number="14",value="0xffdfffff"},
882
     {number="15",value="0xffffffff"},{number="16",value="0xfffffeff"},
883
     {number="17",value="0xefffffed"},{number="18",value="0xfffffffe"},
884
     {number="19",value="0xffffffff"},{number="20",value="0xffffffff"},
885
     {number="21",value="0xffffffff"},{number="22",value="0xfffffff7"},
886
     {number="23",value="0xffffffff"},{number="24",value="0xffffffff"},
887
     {number="25",value="0xffffffff"},{number="26",value="0xfffffffb"},
888
     {number="27",value="0xffffffff"},{number="28",value="0xf7bfffff"},
889
     {number="29",value="0x0"},{number="30",value="0xfe010000"},
890
     {number="31",value="0x0"},{number="32",value="0x0"},
891
     {number="33",value="0x0"},{number="34",value="0x0"},
892
     {number="35",value="0x0"},{number="36",value="0x0"},
893
     {number="37",value="0x0"},{number="38",value="0x0"},
894
     {number="39",value="0x0"},{number="40",value="0x0"},
895
     {number="41",value="0x0"},{number="42",value="0x0"},
896
     {number="43",value="0x0"},{number="44",value="0x0"},
897
     {number="45",value="0x0"},{number="46",value="0x0"},
898
     {number="47",value="0x0"},{number="48",value="0x0"},
899
     {number="49",value="0x0"},{number="50",value="0x0"},
900
     {number="51",value="0x0"},{number="52",value="0x0"},
901
     {number="53",value="0x0"},{number="54",value="0x0"},
902
     {number="55",value="0x0"},{number="56",value="0x0"},
903
     {number="57",value="0x0"},{number="58",value="0x0"},
904
     {number="59",value="0x0"},{number="60",value="0x0"},
905
     {number="61",value="0x0"},{number="62",value="0x0"},
906
     {number="63",value="0x0"},{number="64",value="0xfe00a300"},
907
     {number="65",value="0x29002"},{number="66",value="0x202f04b5"},
908
     {number="67",value="0xfe0043b0"},{number="68",value="0xfe00b3e4"},
909
     {number="69",value="0x20002b03"}}
910
     (gdb)
911
 
912
The `-data-read-memory' Command
913
-------------------------------
914
 
915
Synopsis
916
........
917
 
918
      -data-read-memory [ -o BYTE-OFFSET ]
919
        ADDRESS WORD-FORMAT WORD-SIZE
920
        NR-ROWS NR-COLS [ ASCHAR ]
921
 
922
where:
923
 
924
`ADDRESS'
925
     An expression specifying the address of the first memory word to be
926
     read.  Complex expressions containing embedded white space should
927
     be quoted using the C convention.
928
 
929
`WORD-FORMAT'
930
     The format to be used to print the memory words.  The notation is
931
     the same as for GDB's `print' command (*note Output formats:
932
     Output Formats.).
933
 
934
`WORD-SIZE'
935
     The size of each memory word in bytes.
936
 
937
`NR-ROWS'
938
     The number of rows in the output table.
939
 
940
`NR-COLS'
941
     The number of columns in the output table.
942
 
943
`ASCHAR'
944
     If present, indicates that each row should include an ASCII dump.
945
     The value of ASCHAR is used as a padding character when a byte is
946
     not a member of the printable ASCII character set (printable ASCII
947
     characters are those whose code is between 32 and 126,
948
     inclusively).
949
 
950
`BYTE-OFFSET'
951
     An offset to add to the ADDRESS before fetching memory.
952
 
953
   This command displays memory contents as a table of NR-ROWS by
954
NR-COLS words, each word being WORD-SIZE bytes.  In total, `NR-ROWS *
955
NR-COLS * WORD-SIZE' bytes are read (returned as `total-bytes').
956
Should less then the requested number of bytes be returned by the
957
target, the missing words are identified using `N/A'.  The number of
958
bytes read from the target is returned in `nr-bytes' and the starting
959
address used to read memory in `addr'.
960
 
961
   The address of the next/previous page or row is available in
962
`next-row' and `prev-row', `next-page' and `prev-page'.
963
 
964
GDB Command
965
...........
966
 
967
   The corresponding GDB command is `x'.  `gdbtk' has `gdb_get_mem'
968
memory read.
969
 
970
Example
971
.......
972
 
973
   Read six bytes of memory starting at `bytes+6' but then offset by
974
`-6' bytes.  Format as three rows of two columns. One byte per word.
975
Display each word in hex.
976
 
977
     (gdb)
978
     9-data-read-memory -o -6 -- bytes+6 x 1 3 2
979
     9^done,addr="0x00001390",nr-bytes="6",total-bytes="6",
980
     next-row="0x00001396",prev-row="0x0000138e",next-page="0x00001396",
981
     prev-page="0x0000138a",memory={
982
     {addr="0x00001390",data={"0x00","0x01"}},
983
     {addr="0x00001392",data={"0x02","0x03"}},
984
     {addr="0x00001394",data={"0x04","0x05"}}}
985
     (gdb)
986
 
987
   Read two bytes of memory starting at address `shorts + 64' and
988
display as a single word formatted in decimal.
989
 
990
     (gdb)
991
     5-data-read-memory shorts+64 d 2 1 1
992
     5^done,addr="0x00001510",nr-bytes="2",total-bytes="2",
993
     next-row="0x00001512",prev-row="0x0000150e",
994
     next-page="0x00001512",prev-page="0x0000150e",memory={
995
     {addr="0x00001510",data={"128"}}}
996
     (gdb)
997
 
998
   Read thirty two bytes of memory starting at `bytes+16' and format as
999
eight rows of four columns.  Include a string encoding with `x' used as
1000
the non-printable character.
1001
 
1002
     (gdb)
1003
     4-data-read-memory bytes+16 x 1 8 4 x
1004
     4^done,addr="0x000013a0",nr-bytes="32",total-bytes="32",
1005
     next-row="0x000013c0",prev-row="0x0000139c",
1006
     next-page="0x000013c0",prev-page="0x00001380",memory={
1007
     {addr="0x000013a0",data={"0x10","0x11","0x12","0x13"},ascii="xxxx"},
1008
     {addr="0x000013a4",data={"0x14","0x15","0x16","0x17"},ascii="xxxx"},
1009
     {addr="0x000013a8",data={"0x18","0x19","0x1a","0x1b"},ascii="xxxx"},
1010
     {addr="0x000013ac",data={"0x1c","0x1d","0x1e","0x1f"},ascii="xxxx"},
1011
     {addr="0x000013b0",data={"0x20","0x21","0x22","0x23"},ascii=" !\"#"},
1012
     {addr="0x000013b4",data={"0x24","0x25","0x26","0x27"},ascii="$%&'"},
1013
     {addr="0x000013b8",data={"0x28","0x29","0x2a","0x2b"},ascii="()*+"},
1014
     {addr="0x000013bc",data={"0x2c","0x2d","0x2e","0x2f"},ascii=",-./"}}
1015
     (gdb)
1016
 
1017
The `-display-delete' Command
1018
-----------------------------
1019
 
1020
Synopsis
1021
........
1022
 
1023
      -display-delete NUMBER
1024
 
1025
   Delete the display NUMBER.
1026
 
1027
GDB Command
1028
...........
1029
 
1030
   The corresponding GDB command is `delete display'.
1031
 
1032
Example
1033
.......
1034
 
1035
   N.A.
1036
 
1037
The `-display-disable' Command
1038
------------------------------
1039
 
1040
Synopsis
1041
........
1042
 
1043
      -display-disable NUMBER
1044
 
1045
   Disable display NUMBER.
1046
 
1047
GDB Command
1048
...........
1049
 
1050
   The corresponding GDB command is `disable display'.
1051
 
1052
Example
1053
.......
1054
 
1055
   N.A.
1056
 
1057
The `-display-enable' Command
1058
-----------------------------
1059
 
1060
Synopsis
1061
........
1062
 
1063
      -display-enable NUMBER
1064
 
1065
   Enable display NUMBER.
1066
 
1067
GDB Command
1068
...........
1069
 
1070
   The corresponding GDB command is `enable display'.
1071
 
1072
Example
1073
.......
1074
 
1075
   N.A.
1076
 
1077
The `-display-insert' Command
1078
-----------------------------
1079
 
1080
Synopsis
1081
........
1082
 
1083
      -display-insert EXPRESSION
1084
 
1085
   Display EXPRESSION every time the program stops.
1086
 
1087
GDB Command
1088
...........
1089
 
1090
   The corresponding GDB command is `display'.
1091
 
1092
Example
1093
.......
1094
 
1095
   N.A.
1096
 
1097
The `-display-list' Command
1098
---------------------------
1099
 
1100
Synopsis
1101
........
1102
 
1103
      -display-list
1104
 
1105
   List the displays.  Do not show the current values.
1106
 
1107
GDB Command
1108
...........
1109
 
1110
   The corresponding GDB command is `info display'.
1111
 
1112
Example
1113
.......
1114
 
1115
   N.A.
1116
 
1117
The `-environment-cd' Command
1118
-----------------------------
1119
 
1120
Synopsis
1121
........
1122
 
1123
      -environment-cd PATHDIR
1124
 
1125
   Set GDB's working directory.
1126
 
1127
GDB Command
1128
...........
1129
 
1130
   The corresponding GDB command is `cd'.
1131
 
1132
Example
1133
.......
1134
 
1135
     (gdb)
1136
     -environment-cd /kwikemart/marge/ezannoni/flathead-dev/devo/gdb
1137
     ^done
1138
     (gdb)
1139
 
1140
The `-environment-directory' Command
1141
------------------------------------
1142
 
1143
Synopsis
1144
........
1145
 
1146
      -environment-directory PATHDIR
1147
 
1148
   Add directory PATHDIR to beginning of search path for source files.
1149
 
1150
GDB Command
1151
...........
1152
 
1153
   The corresponding GDB command is `dir'.
1154
 
1155
Example
1156
.......
1157
 
1158
     (gdb)
1159
     -environment-directory /kwikemart/marge/ezannoni/flathead-dev/devo/gdb
1160
     ^done
1161
     (gdb)
1162
 
1163
The `-environment-path' Command
1164
-------------------------------
1165
 
1166
Synopsis
1167
........
1168
 
1169
      -environment-path ( PATHDIR )+
1170
 
1171
   Add directories to beginning of search path for object files.
1172
 
1173
GDB Command
1174
...........
1175
 
1176
   The corresponding GDB command is `path'.
1177
 
1178
Example
1179
.......
1180
 
1181
     (gdb)
1182
     -environment-path /kwikemart/marge/ezannoni/flathead-dev/ppc-eabi/gdb
1183
     ^done
1184
     (gdb)
1185
 
1186
The `-environment-pwd' Command
1187
------------------------------
1188
 
1189
Synopsis
1190
........
1191
 
1192
      -environment-pwd
1193
 
1194
   Show the current working directory.
1195
 
1196
GDB command
1197
...........
1198
 
1199
   The corresponding GDB command is `pwd'.
1200
 
1201
Example
1202
.......
1203
 
1204
     (gdb)
1205
     -environment-pwd
1206
     ~Working directory /kwikemart/marge/ezannoni/flathead-dev/devo/gdb.
1207
     ^done
1208
     (gdb)
1209
 
1210

1211
File: gdb.info,  Node: GDB/MI Program Control,  Next: GDB/MI Miscellaneous Commands,  Prev: GDB/MI Data Manipulation,  Up: GDB/MI
1212
 
1213
GDB/MI Program control
1214
======================
1215
 
1216
Program termination
1217
...................
1218
 
1219
   As a result of execution, the inferior program can run to
1220
completion, if it doesn't encouter any breakpoints.  In this case the
1221
ouput will include an exit code, if the program has exited
1222
exceptionally.
1223
 
1224
Examples:
1225
.........
1226
 
1227
Program exited normally:
1228
 
1229
     (gdb)
1230
     -exec-run
1231
     ^running
1232
     (gdb)
1233
     x = 55
1234
     *stopped,reason="exited-normally"
1235
     (gdb)
1236
 
1237
Program exited exceptionally:
1238
 
1239
     (gdb)
1240
     -exec-run
1241
     ^running
1242
     (gdb)
1243
     x = 55
1244
     *stopped,reason="exited",exit-code="01"
1245
     (gdb)
1246
 
1247
   Another way the program can terminate is if it receives a signal
1248
such as `SIGINT'.  In this case, GDB/MI displays this:
1249
 
1250
     (gdb)
1251
     *stopped,reason="exited-signalled",signal-name="SIGINT",
1252
     signal-meaning="Interrupt"
1253
 
1254
The `-exec-abort' Command
1255
-------------------------
1256
 
1257
Synopsis
1258
........
1259
 
1260
      -exec-abort
1261
 
1262
   Kill the inferior running program.
1263
 
1264
GDB Command
1265
...........
1266
 
1267
   The corresponding GDB command is `kill'.
1268
 
1269
Example
1270
.......
1271
 
1272
   N.A.
1273
 
1274
The `-exec-arguments' Command
1275
-----------------------------
1276
 
1277
Synopsis
1278
........
1279
 
1280
      -exec-arguments ARGS
1281
 
1282
   Set the inferior program arguments, to be used in the next
1283
`-exec-run'.
1284
 
1285
GDB Command
1286
...........
1287
 
1288
   The corresponding GDB command is `set args'.
1289
 
1290
Example
1291
.......
1292
 
1293
   Don't have one around.
1294
 
1295
The `-exec-continue' Command
1296
----------------------------
1297
 
1298
Synopsis
1299
........
1300
 
1301
      -exec-continue
1302
 
1303
   Asynchronous command.  Resumes the execution of the inferior program
1304
until a breakpoint is encountered, or until the inferior exits.
1305
 
1306
GDB Command
1307
...........
1308
 
1309
   The corresponding GDB corresponding is `continue'.
1310
 
1311
Example
1312
.......
1313
 
1314
     -exec-continue
1315
     ^running
1316
     (gdb)
1317
     @Hello world
1318
     *stopped,reason="breakpoint-hit",bkptno="2",frame={func="foo",args={},
1319
     file="hello.c",line="13"}
1320
     (gdb)
1321
 
1322
The `-exec-finish' Command
1323
--------------------------
1324
 
1325
Synopsis
1326
........
1327
 
1328
      -exec-finish
1329
 
1330
   Asynchronous command.  Resumes the execution of the inferior program
1331
until the current function is exited.  Displays the results returned by
1332
the function.
1333
 
1334
GDB Command
1335
...........
1336
 
1337
   The corresponding GDB command is `finish'.
1338
 
1339
Example
1340
.......
1341
 
1342
   Function returning `void'.
1343
 
1344
     -exec-finish
1345
     ^running
1346
     (gdb)
1347
     @hello from foo
1348
     *stopped,reason="function-finished",frame={func="main",args={},
1349
     file="hello.c",line="7"}
1350
     (gdb)
1351
 
1352
   Function returning other than `void'.  The name of the internal GDB
1353
variable storing the result is printed, together with the value itself.
1354
 
1355
     -exec-finish
1356
     ^running
1357
     (gdb)
1358
     *stopped,reason="function-finished",frame={addr="0x000107b0",func="foo",
1359
     args={{name="a",value="1"},{name="b",value="9"}},
1360
     file="recursive2.c",line="14"},
1361
     gdb-result-var="$1",return-value="0"
1362
     (gdb)
1363
 
1364
The `-exec-interrupt' Command
1365
-----------------------------
1366
 
1367
Synopsis
1368
........
1369
 
1370
      -exec-interrupt
1371
 
1372
   Asynchronous command. Interrupts the background execution of the
1373
target.  Note how the token associated with the stop message is the one
1374
for the execution command that has been interrupted.  The token for the
1375
interrupt itself only appears in the '^done' output.  If the user is
1376
trying to interrupt a non-running program, an error message will be
1377
printed.
1378
 
1379
GDB Command
1380
...........
1381
 
1382
   The corresponding GDB command is `interrupt'.
1383
 
1384
Example
1385
.......
1386
 
1387
     (gdb)
1388
     111-exec-continue
1389
     111^running
1390
 
1391
     (gdb)
1392
     222-exec-interrupt
1393
     222^done
1394
     (gdb)
1395
     111*stopped,signal-name="SIGINT",signal-meaning="Interrupt",
1396
     frame={addr="0x00010140",func="foo",args={},file="try.c",line="13"}
1397
     (gdb)
1398
 
1399
     (gdb)
1400
     -exec-interrupt
1401
     ^error,msg="mi_cmd_exec_interrupt: Inferior not executing."
1402
     (gdb)
1403
 
1404
The `-exec-next' Command
1405
------------------------
1406
 
1407
Synopsis
1408
........
1409
 
1410
      -exec-next
1411
 
1412
   Asynchronous command.  Resumes execution of the inferior program,
1413
stopping when the beginning of the next source line is reached.
1414
 
1415
GDB Command
1416
...........
1417
 
1418
   The corresponding GDB command is `next'.
1419
 
1420
Example
1421
.......
1422
 
1423
     -exec-next
1424
     ^running
1425
     (gdb)
1426
     *stopped,reason="end-stepping-range",line="8",file="hello.c"
1427
     (gdb)
1428
 
1429
The `-exec-next-instruction' Command
1430
------------------------------------
1431
 
1432
Synopsis
1433
........
1434
 
1435
      -exec-next-instruction
1436
 
1437
   Asynchronous command.  Executes one machine instruction.  If the
1438
instruction is a function call continues until the function returns.  If
1439
the program stops at an instruction in the middle of a source line, the
1440
address will be printed as well.
1441
 
1442
GDB Command
1443
...........
1444
 
1445
   The corresponding GDB command is `nexti'.
1446
 
1447
Example
1448
.......
1449
 
1450
     (gdb)
1451
     -exec-next-instruction
1452
     ^running
1453
 
1454
     (gdb)
1455
     *stopped,reason="end-stepping-range",
1456
     addr="0x000100d4",line="5",file="hello.c"
1457
     (gdb)
1458
 
1459
The `-exec-return' Command
1460
--------------------------
1461
 
1462
Synopsis
1463
........
1464
 
1465
      -exec-return
1466
 
1467
   Makes current function return immediately.  Doesn't execute the
1468
inferior.  Displays the new current frame.
1469
 
1470
GDB Command
1471
...........
1472
 
1473
   The corresponding GDB command is `return'.
1474
 
1475
Example
1476
.......
1477
 
1478
     (gdb)
1479
     200-break-insert callee4
1480
     200^done,bkpt={number="1",addr="0x00010734",
1481
     file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="8"}
1482
     (gdb)
1483
     000-exec-run
1484
     000^running
1485
     (gdb)
1486
     000*stopped,reason="breakpoint-hit",bkptno="1",
1487
     frame={func="callee4",args={},
1488
     file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="8"}
1489
     (gdb)
1490
     205-break-delete
1491
     205^done
1492
     (gdb)
1493
     111-exec-return
1494
     111^done,frame={level="0 ",func="callee3",
1495
     args={{name="strarg",
1496
     value="0x11940 \"A string argument.\""}},
1497
     file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="18"}
1498
     (gdb)
1499
 
1500
The `-exec-run' Command
1501
-----------------------
1502
 
1503
Synopsis
1504
........
1505
 
1506
      -exec-run
1507
 
1508
   Asynchronous command.  Starts execution of the inferior from the
1509
beginning.  The inferior executes until either a breakpoint is
1510
encountered or the program exits.
1511
 
1512
GDB Command
1513
...........
1514
 
1515
   The corresponding GDB command is `run'.
1516
 
1517
Example
1518
.......
1519
 
1520
     (gdb)
1521
     -break-insert main
1522
     ^done,bkpt={number="1",addr="0x0001072c",file="recursive2.c",line="4"}
1523
     (gdb)
1524
     -exec-run
1525
     ^running
1526
     (gdb)
1527
     *stopped,reason="breakpoint-hit",bkptno="1",
1528
     frame={func="main",args={},file="recursive2.c",line="4"}
1529
     (gdb)
1530
 
1531
The `-exec-show-arguments' Command
1532
----------------------------------
1533
 
1534
Synopsis
1535
........
1536
 
1537
      -exec-show-arguments
1538
 
1539
   Print the arguments of the program.
1540
 
1541
GDB Command
1542
...........
1543
 
1544
   The corresponding GDB command is `show args'.
1545
 
1546
Example
1547
.......
1548
 
1549
   N.A.
1550
 
1551
The `-exec-step' Command
1552
------------------------
1553
 
1554
Synopsis
1555
........
1556
 
1557
      -exec-step
1558
 
1559
   Asynchronous command.  Resumes execution of the inferior program,
1560
stopping when the beginning of the next source line is reached, if the
1561
next source line is not a function call.  If it is, stop at the first
1562
instruction of the called function.
1563
 
1564
GDB Command
1565
...........
1566
 
1567
   The corresponding GDB command is `step'.
1568
 
1569
Example
1570
.......
1571
 
1572
   Stepping into a function:
1573
 
1574
     -exec-step
1575
     ^running
1576
     (gdb)
1577
     *stopped,reason="end-stepping-range",
1578
     frame={func="foo",args={{name="a",value="10"},
1579
     {name="b",value="0"}},file="recursive2.c",line="11"}
1580
     (gdb)
1581
 
1582
   Regular stepping:
1583
 
1584
     -exec-step
1585
     ^running
1586
     (gdb)
1587
     *stopped,reason="end-stepping-range",line="14",file="recursive2.c"
1588
     (gdb)
1589
 
1590
The `-exec-step-instruction' Command
1591
------------------------------------
1592
 
1593
Synopsis
1594
........
1595
 
1596
      -exec-step-instruction
1597
 
1598
   Asynchronous command.  Resumes the inferior which executes one
1599
machine instruction.  The output, once GDB has stopped, will vary
1600
depending on whether we have stopped in the middle of a source line or
1601
not.  In the former case, the address at which the program stopped will
1602
be printed as well.
1603
 
1604
GDB Command
1605
...........
1606
 
1607
   The corresponding GDB command is `stepi'.
1608
 
1609
Example
1610
.......
1611
 
1612
     (gdb)
1613
     -exec-step-instruction
1614
     ^running
1615
 
1616
     (gdb)
1617
     *stopped,reason="end-stepping-range",
1618
     frame={func="foo",args={},file="try.c",line="10"}
1619
     (gdb)
1620
     -exec-step-instruction
1621
     ^running
1622
 
1623
     (gdb)
1624
     *stopped,reason="end-stepping-range",
1625
     frame={addr="0x000100f4",func="foo",args={},file="try.c",line="10"}
1626
     (gdb)
1627
 
1628
The `-exec-until' Command
1629
-------------------------
1630
 
1631
Synopsis
1632
........
1633
 
1634
      -exec-until [ LOCATION ]
1635
 
1636
   Asynchronous command.  Executes the inferior until the LOCATION
1637
specified in the argument is reached.  If there is no argument, the
1638
inferior executes until a source line greater than the current one is
1639
reached.  The reason for stopping in this case will be
1640
"location-reached".
1641
 
1642
GDB Command
1643
...........
1644
 
1645
   The corresponding GDB command is `until'.
1646
 
1647
Example
1648
.......
1649
 
1650
     (gdb)
1651
     -exec-until recursive2.c:6
1652
     ^running
1653
     (gdb)
1654
     x = 55
1655
     *stopped,reason="location-reached",frame={func="main",args={},
1656
     file="recursive2.c",line="6"}
1657
     (gdb)
1658
 
1659
The `-file-exec-and-symbols' Command
1660
------------------------------------
1661
 
1662
Synopsis
1663
........
1664
 
1665
      -file-exec-and-symbols FILE
1666
 
1667
   Specify the executable file to be debugged.  This file is the one
1668
from which the symbol table is also read.  If no file is specified, the
1669
command clears the executable and symbol information.  If breakpoints
1670
are set when using this command with no arguments, gdb will produce
1671
error messages.  Otherwise, no output is produced, except a completion
1672
notification.
1673
 
1674
GDB Command
1675
...........
1676
 
1677
   The corresponding GDB command is `file'.
1678
 
1679
Example
1680
.......
1681
 
1682
     (gdb)
1683
     -file-exec-and-symbols /kwikemart/marge/ezannoni/TRUNK/mbx/hello.mbx
1684
     ^done
1685
     (gdb)
1686
 
1687
The `-file-exec-file' Command
1688
-----------------------------
1689
 
1690
Synopsis
1691
........
1692
 
1693
      -file-exec-file FILE
1694
 
1695
   Specify the executable file to be debugged.  Unlike
1696
`-file-exec-and-symbols', the symbol table is _not_ read from this
1697
file.  If used without argument, GDB clears the information about the
1698
executable file.  No output is produced, except a completion
1699
notification.
1700
 
1701
GDB Command
1702
...........
1703
 
1704
   The corresponding GDB command is `exec-file'.
1705
 
1706
Example
1707
.......
1708
 
1709
     (gdb)
1710
     -file-exec-file /kwikemart/marge/ezannoni/TRUNK/mbx/hello.mbx
1711
     ^done
1712
     (gdb)
1713
 
1714
The `-file-list-exec-sections' Command
1715
--------------------------------------
1716
 
1717
Synopsis
1718
........
1719
 
1720
      -file-list-exec-sections
1721
 
1722
   List the sections of the current executable file.
1723
 
1724
GDB Command
1725
...........
1726
 
1727
   The GDB command `info file' shows, among the rest, the same
1728
information as this command.  `gdbtk' has a corresponding command
1729
`gdb_load_info'.
1730
 
1731
Example
1732
.......
1733
 
1734
   N.A.
1735
 
1736
The `-file-list-exec-source-files' Command
1737
------------------------------------------
1738
 
1739
Synopsis
1740
........
1741
 
1742
      -file-list-exec-source-files
1743
 
1744
   List the source files for the current executable.
1745
 
1746
GDB Command
1747
...........
1748
 
1749
   There's no GDB command which directly corresponds to this one.
1750
`gdbtk' has an analogous command `gdb_listfiles'.
1751
 
1752
Example
1753
.......
1754
 
1755
   N.A.
1756
 
1757
The `-file-list-shared-libraries' Command
1758
-----------------------------------------
1759
 
1760
Synopsis
1761
........
1762
 
1763
      -file-list-shared-libraries
1764
 
1765
   List the shared libraries in the program.
1766
 
1767
GDB Command
1768
...........
1769
 
1770
   The corresponding GDB command is `info shared'.
1771
 
1772
Example
1773
.......
1774
 
1775
   N.A.
1776
 
1777
The `-file-list-symbol-files' Command
1778
-------------------------------------
1779
 
1780
Synopsis
1781
........
1782
 
1783
      -file-list-symbol-files
1784
 
1785
   List symbol files.
1786
 
1787
GDB Command
1788
...........
1789
 
1790
   The corresponding GDB command is `info file' (part of it).
1791
 
1792
Example
1793
.......
1794
 
1795
   N.A.
1796
 
1797
The `-file-symbol-file' Command
1798
-------------------------------
1799
 
1800
Synopsis
1801
........
1802
 
1803
      -file-symbol-file FILE
1804
 
1805
   Read symbol table info from the specified FILE argument.  When used
1806
without arguments, clears GDB's symbol table info.  No output is
1807
produced, except for a completion notification.
1808
 
1809
GDB Command
1810
...........
1811
 
1812
   The corresponding GDB command is `symbol-file'.
1813
 
1814
Example
1815
.......
1816
 
1817
     (gdb)
1818
     -file-symbol-file /kwikemart/marge/ezannoni/TRUNK/mbx/hello.mbx
1819
     ^done
1820
     (gdb)
1821
 
1822

1823
File: gdb.info,  Node: GDB/MI Miscellaneous Commands,  Next: GDB/MI Stack Manipulation,  Prev: GDB/MI Program Control,  Up: GDB/MI
1824
 
1825
Miscellaneous GDB commands in GDB/MI
1826
====================================
1827
 
1828
The `-gdb-exit' Command
1829
-----------------------
1830
 
1831
Synopsis
1832
........
1833
 
1834
      -gdb-exit
1835
 
1836
   Exit GDB immediately.
1837
 
1838
GDB Command
1839
...........
1840
 
1841
   Approximately corresponds to `quit'.
1842
 
1843
Example
1844
.......
1845
 
1846
     (gdb)
1847
     -gdb-exit
1848
 
1849
The `-gdb-set' Command
1850
----------------------
1851
 
1852
Synopsis
1853
........
1854
 
1855
      -gdb-set
1856
 
1857
   Set an internal GDB variable.
1858
 
1859
GDB Command
1860
...........
1861
 
1862
   The corresponding GDB command is `set'.
1863
 
1864
Example
1865
.......
1866
 
1867
     (gdb)
1868
     -gdb-set $foo=3
1869
     ^done
1870
     (gdb)
1871
 
1872
The `-gdb-show' Command
1873
-----------------------
1874
 
1875
Synopsis
1876
........
1877
 
1878
      -gdb-show
1879
 
1880
   Show the current value of a GDB variable.
1881
 
1882
GDB command
1883
...........
1884
 
1885
   The corresponding GDB command is `show'.
1886
 
1887
Example
1888
.......
1889
 
1890
     (gdb)
1891
     -gdb-show annotate
1892
     ^done,value="0"
1893
     (gdb)
1894
 
1895
The `-gdb-version' Command
1896
--------------------------
1897
 
1898
Synopsis
1899
........
1900
 
1901
      -gdb-version
1902
 
1903
   Show version information for GDB.  Used mostly in testing.
1904
 
1905
GDB Command
1906
...........
1907
 
1908
   There's no equivalent GDB command.  GDB by default shows this
1909
information when you start an interactive session.
1910
 
1911
Example
1912
.......
1913
 
1914
     (gdb)
1915
     -gdb-version
1916
     ~GNU gdb 5.2.1
1917
     ~Copyright 2000 Free Software Foundation, Inc.
1918
     ~GDB is free software, covered by the GNU General Public License, and
1919
     ~you are welcome to change it and/or distribute copies of it under
1920
     ~ certain conditions.
1921
     ~Type "show copying" to see the conditions.
1922
     ~There is absolutely no warranty for GDB.  Type "show warranty" for
1923
     ~ details.
1924
     ~This GDB was configured as
1925
      "--host=sparc-sun-solaris2.5.1 --target=ppc-eabi".
1926
     ^done
1927
     (gdb)
1928
 

powered by: WebSVN 2.1.0

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