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

Subversion Repositories or1k_old

[/] [or1k_old/] [trunk/] [gdb-5.3/] [gdb/] [doc/] [gdb.info-11] - Blame information for rev 1782

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1181 sfurman
This is gdb.info, produced by makeinfo version 4.1 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 Ninth Edition, December 2001, of `Debugging with GDB:
11
the GNU Source-Level Debugger' for GDB Version 5.3.
12
 
13
   Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996,
14
1998,
15
1999, 2000, 2001, 2002 Free Software Foundation, Inc.
16
 
17
   Permission is granted to copy, distribute and/or modify this document
18
under the terms of the GNU Free Documentation License, Version 1.1 or
19
any later version published by the Free Software Foundation; with the
20
Invariant Sections being "Free Software" and "Free Software Needs Free
21
Documentation", with the Front-Cover Texts being "A GNU Manual," and
22
with the Back-Cover Texts as in (a) below.
23
 
24
   (a) The Free Software Foundation's Back-Cover Text is: "You have
25
freedom to copy and modify this GNU Manual, like GNU software.  Copies
26
published by the Free Software Foundation raise funds for GNU
27
development."
28
 
29

30
File: gdb.info,  Node: GDB/MI Data Manipulation,  Next: GDB/MI Program Control,  Prev: GDB/MI Breakpoint Table Commands,  Up: GDB/MI
31
 
32
GDB/MI Data Manipulation
33
========================
34
 
35
   This section describes the GDB/MI commands that manipulate data:
36
examine memory and registers, evaluate expressions, etc.
37
 
38
The `-data-disassemble' Command
39
-------------------------------
40
 
41
Synopsis
42
........
43
 
44
      -data-disassemble
45
         [ -s START-ADDR -e END-ADDR ]
46
       | [ -f FILENAME -l LINENUM [ -n LINES ] ]
47
       -- MODE
48
 
49
Where:
50
 
51
`START-ADDR'
52
     is the beginning address (or `$pc')
53
 
54
`END-ADDR'
55
     is the end address
56
 
57
`FILENAME'
58
     is the name of the file to disassemble
59
 
60
`LINENUM'
61
     is the line number to disassemble around
62
 
63
`LINES'
64
     is the the number of disassembly lines to be produced.  If it is
65
     -1, the whole function will be disassembled, in case no END-ADDR is
66
     specified.  If END-ADDR is specified as a non-zero value, and
67
     LINES is lower than the number of disassembly lines between
68
     START-ADDR and END-ADDR, only LINES lines are displayed; if LINES
69
     is higher than the number of lines between START-ADDR and
70
     END-ADDR, only the lines up to END-ADDR are displayed.
71
 
72
`MODE'
73
     is either 0 (meaning only disassembly) or 1 (meaning mixed source
74
     and disassembly).
75
 
76
Result
77
......
78
 
79
   The output for each instruction is composed of four fields:
80
 
81
   * Address
82
 
83
   * Func-name
84
 
85
   * Offset
86
 
87
   * Instruction
88
 
89
   Note that whatever included in the instruction field, is not
90
manipulated directely by GDB/MI, i.e. it is not possible to adjust its
91
format.
92
 
93
GDB Command
94
...........
95
 
96
   There's no direct mapping from this command to the CLI.
97
 
98
Example
99
.......
100
 
101
   Disassemble from the current value of `$pc' to `$pc + 20':
102
 
103
     (gdb)
104
     -data-disassemble -s $pc -e "$pc + 20" -- 0
105
     ^done,
106
     asm_insns=[
107
     {address="0x000107c0",func-name="main",offset="4",
108
     inst="mov  2, %o0"},
109
     {address="0x000107c4",func-name="main",offset="8",
110
     inst="sethi  %hi(0x11800), %o2"},
111
     {address="0x000107c8",func-name="main",offset="12",
112
     inst="or  %o2, 0x140, %o1\t! 0x11940 <_lib_version+8>"},
113
     {address="0x000107cc",func-name="main",offset="16",
114
     inst="sethi  %hi(0x11800), %o2"},
115
     {address="0x000107d0",func-name="main",offset="20",
116
     inst="or  %o2, 0x168, %o4\t! 0x11968 <_lib_version+48>"}]
117
     (gdb)
118
 
119
   Disassemble the whole `main' function.  Line 32 is part of `main'.
120
 
121
     -data-disassemble -f basics.c -l 32 -- 0
122
     ^done,asm_insns=[
123
     {address="0x000107bc",func-name="main",offset="0",
124
     inst="save  %sp, -112, %sp"},
125
     {address="0x000107c0",func-name="main",offset="4",
126
     inst="mov   2, %o0"},
127
     {address="0x000107c4",func-name="main",offset="8",
128
     inst="sethi %hi(0x11800), %o2"},
129
     [...]
130
     {address="0x0001081c",func-name="main",offset="96",inst="ret "},
131
     {address="0x00010820",func-name="main",offset="100",inst="restore "}]
132
     (gdb)
133
 
134
   Disassemble 3 instructions from the start of `main':
135
 
136
     (gdb)
137
     -data-disassemble -f basics.c -l 32 -n 3 -- 0
138
     ^done,asm_insns=[
139
     {address="0x000107bc",func-name="main",offset="0",
140
     inst="save  %sp, -112, %sp"},
141
     {address="0x000107c0",func-name="main",offset="4",
142
     inst="mov  2, %o0"},
143
     {address="0x000107c4",func-name="main",offset="8",
144
     inst="sethi  %hi(0x11800), %o2"}]
145
     (gdb)
146
 
147
   Disassemble 3 instructions from the start of `main' in mixed mode:
148
 
149
     (gdb)
150
     -data-disassemble -f basics.c -l 32 -n 3 -- 1
151
     ^done,asm_insns=[
152
     src_and_asm_line={line="31",
153
     file="/kwikemart/marge/ezannoni/flathead-dev/devo/gdb/ \
154
       testsuite/gdb.mi/basics.c",line_asm_insn=[
155
     {address="0x000107bc",func-name="main",offset="0",
156
     inst="save  %sp, -112, %sp"}]},
157
     src_and_asm_line={line="32",
158
     file="/kwikemart/marge/ezannoni/flathead-dev/devo/gdb/ \
159
       testsuite/gdb.mi/basics.c",line_asm_insn=[
160
     {address="0x000107c0",func-name="main",offset="4",
161
     inst="mov  2, %o0"},
162
     {address="0x000107c4",func-name="main",offset="8",
163
     inst="sethi  %hi(0x11800), %o2"}]}]
164
     (gdb)
165
 
166
The `-data-evaluate-expression' Command
167
---------------------------------------
168
 
169
Synopsis
170
........
171
 
172
      -data-evaluate-expression EXPR
173
 
174
   Evaluate EXPR as an expression.  The expression could contain an
175
inferior function call.  The function call will execute synchronously.
176
If the expression contains spaces, it must be enclosed in double quotes.
177
 
178
GDB Command
179
...........
180
 
181
   The corresponding GDB commands are `print', `output', and `call'.
182
In `gdbtk' only, there's a corresponding `gdb_eval' command.
183
 
184
Example
185
.......
186
 
187
   In the following example, the numbers that precede the commands are
188
the "tokens" described in *Note GDB/MI Command Syntax: GDB/MI Command
189
Syntax.  Notice how GDB/MI returns the same tokens in its output.
190
 
191
     211-data-evaluate-expression A
192
     211^done,value="1"
193
     (gdb)
194
     311-data-evaluate-expression &A
195
     311^done,value="0xefffeb7c"
196
     (gdb)
197
     411-data-evaluate-expression A+3
198
     411^done,value="4"
199
     (gdb)
200
     511-data-evaluate-expression "A + 3"
201
     511^done,value="4"
202
     (gdb)
203
 
204
The `-data-list-changed-registers' Command
205
------------------------------------------
206
 
207
Synopsis
208
........
209
 
210
      -data-list-changed-registers
211
 
212
   Display a list of the registers that have changed.
213
 
214
GDB Command
215
...........
216
 
217
   GDB doesn't have a direct analog for this command; `gdbtk' has the
218
corresponding command `gdb_changed_register_list'.
219
 
220
Example
221
.......
222
 
223
   On a PPC MBX board:
224
 
225
     (gdb)
226
     -exec-continue
227
     ^running
228
 
229
     (gdb)
230
     *stopped,reason="breakpoint-hit",bkptno="1",frame={func="main",
231
     args=[],file="try.c",line="5"}
232
     (gdb)
233
     -data-list-changed-registers
234
     ^done,changed-registers=["0","1","2","4","5","6","7","8","9",
235
     "10","11","13","14","15","16","17","18","19","20","21","22","23",
236
     "24","25","26","27","28","30","31","64","65","66","67","69"]
237
     (gdb)
238
 
239
The `-data-list-register-names' Command
240
---------------------------------------
241
 
242
Synopsis
243
........
244
 
245
      -data-list-register-names [ ( REGNO )+ ]
246
 
247
   Show a list of register names for the current target.  If no
248
arguments are given, it shows a list of the names of all the registers.
249
If integer numbers are given as arguments, it will print a list of the
250
names of the registers corresponding to the arguments.  To ensure
251
consistency between a register name and its number, the output list may
252
include empty register names.
253
 
254
GDB Command
255
...........
256
 
257
   GDB does not have a command which corresponds to
258
`-data-list-register-names'.  In `gdbtk' there is a corresponding
259
command `gdb_regnames'.
260
 
261
Example
262
.......
263
 
264
   For the PPC MBX board:
265
     (gdb)
266
     -data-list-register-names
267
     ^done,register-names=["r0","r1","r2","r3","r4","r5","r6","r7",
268
     "r8","r9","r10","r11","r12","r13","r14","r15","r16","r17","r18",
269
     "r19","r20","r21","r22","r23","r24","r25","r26","r27","r28","r29",
270
     "r30","r31","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9",
271
     "f10","f11","f12","f13","f14","f15","f16","f17","f18","f19","f20",
272
     "f21","f22","f23","f24","f25","f26","f27","f28","f29","f30","f31",
273
     "", "pc","ps","cr","lr","ctr","xer"]
274
     (gdb)
275
     -data-list-register-names 1 2 3
276
     ^done,register-names=["r1","r2","r3"]
277
     (gdb)
278
 
279
The `-data-list-register-values' Command
280
----------------------------------------
281
 
282
Synopsis
283
........
284
 
285
      -data-list-register-values FMT [ ( REGNO )*]
286
 
287
   Display the registers' contents.  FMT is the format according to
288
which the registers' contents are to be returned, followed by an
289
optional list of numbers specifying the registers to display.  A
290
missing list of numbers indicates that the contents of all the
291
registers must be returned.
292
 
293
   Allowed formats for FMT are:
294
 
295
`x'
296
     Hexadecimal
297
 
298
`o'
299
     Octal
300
 
301
`t'
302
     Binary
303
 
304
`d'
305
     Decimal
306
 
307
`r'
308
     Raw
309
 
310
`N'
311
     Natural
312
 
313
GDB Command
314
...........
315
 
316
   The corresponding GDB commands are `info reg', `info all-reg', and
317
(in `gdbtk') `gdb_fetch_registers'.
318
 
319
Example
320
.......
321
 
322
   For a PPC MBX board (note: line breaks are for readability only, they
323
don't appear in the actual output):
324
 
325
     (gdb)
326
     -data-list-register-values r 64 65
327
     ^done,register-values=[{number="64",value="0xfe00a300"},
328
     {number="65",value="0x00029002"}]
329
     (gdb)
330
     -data-list-register-values x
331
     ^done,register-values=[{number="0",value="0xfe0043c8"},
332
     {number="1",value="0x3fff88"},{number="2",value="0xfffffffe"},
333
     {number="3",value="0x0"},{number="4",value="0xa"},
334
     {number="5",value="0x3fff68"},{number="6",value="0x3fff58"},
335
     {number="7",value="0xfe011e98"},{number="8",value="0x2"},
336
     {number="9",value="0xfa202820"},{number="10",value="0xfa202808"},
337
     {number="11",value="0x1"},{number="12",value="0x0"},
338
     {number="13",value="0x4544"},{number="14",value="0xffdfffff"},
339
     {number="15",value="0xffffffff"},{number="16",value="0xfffffeff"},
340
     {number="17",value="0xefffffed"},{number="18",value="0xfffffffe"},
341
     {number="19",value="0xffffffff"},{number="20",value="0xffffffff"},
342
     {number="21",value="0xffffffff"},{number="22",value="0xfffffff7"},
343
     {number="23",value="0xffffffff"},{number="24",value="0xffffffff"},
344
     {number="25",value="0xffffffff"},{number="26",value="0xfffffffb"},
345
     {number="27",value="0xffffffff"},{number="28",value="0xf7bfffff"},
346
     {number="29",value="0x0"},{number="30",value="0xfe010000"},
347
     {number="31",value="0x0"},{number="32",value="0x0"},
348
     {number="33",value="0x0"},{number="34",value="0x0"},
349
     {number="35",value="0x0"},{number="36",value="0x0"},
350
     {number="37",value="0x0"},{number="38",value="0x0"},
351
     {number="39",value="0x0"},{number="40",value="0x0"},
352
     {number="41",value="0x0"},{number="42",value="0x0"},
353
     {number="43",value="0x0"},{number="44",value="0x0"},
354
     {number="45",value="0x0"},{number="46",value="0x0"},
355
     {number="47",value="0x0"},{number="48",value="0x0"},
356
     {number="49",value="0x0"},{number="50",value="0x0"},
357
     {number="51",value="0x0"},{number="52",value="0x0"},
358
     {number="53",value="0x0"},{number="54",value="0x0"},
359
     {number="55",value="0x0"},{number="56",value="0x0"},
360
     {number="57",value="0x0"},{number="58",value="0x0"},
361
     {number="59",value="0x0"},{number="60",value="0x0"},
362
     {number="61",value="0x0"},{number="62",value="0x0"},
363
     {number="63",value="0x0"},{number="64",value="0xfe00a300"},
364
     {number="65",value="0x29002"},{number="66",value="0x202f04b5"},
365
     {number="67",value="0xfe0043b0"},{number="68",value="0xfe00b3e4"},
366
     {number="69",value="0x20002b03"}]
367
     (gdb)
368
 
369
The `-data-read-memory' Command
370
-------------------------------
371
 
372
Synopsis
373
........
374
 
375
      -data-read-memory [ -o BYTE-OFFSET ]
376
        ADDRESS WORD-FORMAT WORD-SIZE
377
        NR-ROWS NR-COLS [ ASCHAR ]
378
 
379
where:
380
 
381
`ADDRESS'
382
     An expression specifying the address of the first memory word to be
383
     read.  Complex expressions containing embedded white space should
384
     be quoted using the C convention.
385
 
386
`WORD-FORMAT'
387
     The format to be used to print the memory words.  The notation is
388
     the same as for GDB's `print' command (*note Output formats:
389
     Output Formats.).
390
 
391
`WORD-SIZE'
392
     The size of each memory word in bytes.
393
 
394
`NR-ROWS'
395
     The number of rows in the output table.
396
 
397
`NR-COLS'
398
     The number of columns in the output table.
399
 
400
`ASCHAR'
401
     If present, indicates that each row should include an ASCII dump.
402
     The value of ASCHAR is used as a padding character when a byte is
403
     not a member of the printable ASCII character set (printable ASCII
404
     characters are those whose code is between 32 and 126,
405
     inclusively).
406
 
407
`BYTE-OFFSET'
408
     An offset to add to the ADDRESS before fetching memory.
409
 
410
   This command displays memory contents as a table of NR-ROWS by
411
NR-COLS words, each word being WORD-SIZE bytes.  In total, `NR-ROWS *
412
NR-COLS * WORD-SIZE' bytes are read (returned as `total-bytes').
413
Should less than the requested number of bytes be returned by the
414
target, the missing words are identified using `N/A'.  The number of
415
bytes read from the target is returned in `nr-bytes' and the starting
416
address used to read memory in `addr'.
417
 
418
   The address of the next/previous row or page is available in
419
`next-row' and `prev-row', `next-page' and `prev-page'.
420
 
421
GDB Command
422
...........
423
 
424
   The corresponding GDB command is `x'.  `gdbtk' has `gdb_get_mem'
425
memory read command.
426
 
427
Example
428
.......
429
 
430
   Read six bytes of memory starting at `bytes+6' but then offset by
431
`-6' bytes.  Format as three rows of two columns.  One byte per word.
432
Display each word in hex.
433
 
434
     (gdb)
435
     9-data-read-memory -o -6 -- bytes+6 x 1 3 2
436
     9^done,addr="0x00001390",nr-bytes="6",total-bytes="6",
437
     next-row="0x00001396",prev-row="0x0000138e",next-page="0x00001396",
438
     prev-page="0x0000138a",memory=[
439
     {addr="0x00001390",data=["0x00","0x01"]},
440
     {addr="0x00001392",data=["0x02","0x03"]},
441
     {addr="0x00001394",data=["0x04","0x05"]}]
442
     (gdb)
443
 
444
   Read two bytes of memory starting at address `shorts + 64' and
445
display as a single word formatted in decimal.
446
 
447
     (gdb)
448
     5-data-read-memory shorts+64 d 2 1 1
449
     5^done,addr="0x00001510",nr-bytes="2",total-bytes="2",
450
     next-row="0x00001512",prev-row="0x0000150e",
451
     next-page="0x00001512",prev-page="0x0000150e",memory=[
452
     {addr="0x00001510",data=["128"]}]
453
     (gdb)
454
 
455
   Read thirty two bytes of memory starting at `bytes+16' and format as
456
eight rows of four columns.  Include a string encoding with `x' used as
457
the non-printable character.
458
 
459
     (gdb)
460
     4-data-read-memory bytes+16 x 1 8 4 x
461
     4^done,addr="0x000013a0",nr-bytes="32",total-bytes="32",
462
     next-row="0x000013c0",prev-row="0x0000139c",
463
     next-page="0x000013c0",prev-page="0x00001380",memory=[
464
     {addr="0x000013a0",data=["0x10","0x11","0x12","0x13"],ascii="xxxx"},
465
     {addr="0x000013a4",data=["0x14","0x15","0x16","0x17"],ascii="xxxx"},
466
     {addr="0x000013a8",data=["0x18","0x19","0x1a","0x1b"],ascii="xxxx"},
467
     {addr="0x000013ac",data=["0x1c","0x1d","0x1e","0x1f"],ascii="xxxx"},
468
     {addr="0x000013b0",data=["0x20","0x21","0x22","0x23"],ascii=" !\"#"},
469
     {addr="0x000013b4",data=["0x24","0x25","0x26","0x27"],ascii="$%&'"},
470
     {addr="0x000013b8",data=["0x28","0x29","0x2a","0x2b"],ascii="()*+"},
471
     {addr="0x000013bc",data=["0x2c","0x2d","0x2e","0x2f"],ascii=",-./"}]
472
     (gdb)
473
 
474
The `-display-delete' Command
475
-----------------------------
476
 
477
Synopsis
478
........
479
 
480
      -display-delete NUMBER
481
 
482
   Delete the display NUMBER.
483
 
484
GDB Command
485
...........
486
 
487
   The corresponding GDB command is `delete display'.
488
 
489
Example
490
.......
491
 
492
   N.A.
493
 
494
The `-display-disable' Command
495
------------------------------
496
 
497
Synopsis
498
........
499
 
500
      -display-disable NUMBER
501
 
502
   Disable display NUMBER.
503
 
504
GDB Command
505
...........
506
 
507
   The corresponding GDB command is `disable display'.
508
 
509
Example
510
.......
511
 
512
   N.A.
513
 
514
The `-display-enable' Command
515
-----------------------------
516
 
517
Synopsis
518
........
519
 
520
      -display-enable NUMBER
521
 
522
   Enable display NUMBER.
523
 
524
GDB Command
525
...........
526
 
527
   The corresponding GDB command is `enable display'.
528
 
529
Example
530
.......
531
 
532
   N.A.
533
 
534
The `-display-insert' Command
535
-----------------------------
536
 
537
Synopsis
538
........
539
 
540
      -display-insert EXPRESSION
541
 
542
   Display EXPRESSION every time the program stops.
543
 
544
GDB Command
545
...........
546
 
547
   The corresponding GDB command is `display'.
548
 
549
Example
550
.......
551
 
552
   N.A.
553
 
554
The `-display-list' Command
555
---------------------------
556
 
557
Synopsis
558
........
559
 
560
      -display-list
561
 
562
   List the displays.  Do not show the current values.
563
 
564
GDB Command
565
...........
566
 
567
   The corresponding GDB command is `info display'.
568
 
569
Example
570
.......
571
 
572
   N.A.
573
 
574
The `-environment-cd' Command
575
-----------------------------
576
 
577
Synopsis
578
........
579
 
580
      -environment-cd PATHDIR
581
 
582
   Set GDB's working directory.
583
 
584
GDB Command
585
...........
586
 
587
   The corresponding GDB command is `cd'.
588
 
589
Example
590
.......
591
 
592
     (gdb)
593
     -environment-cd /kwikemart/marge/ezannoni/flathead-dev/devo/gdb
594
     ^done
595
     (gdb)
596
 
597
The `-environment-directory' Command
598
------------------------------------
599
 
600
Synopsis
601
........
602
 
603
      -environment-directory PATHDIR
604
 
605
   Add directory PATHDIR to beginning of search path for source files.
606
 
607
GDB Command
608
...........
609
 
610
   The corresponding GDB command is `dir'.
611
 
612
Example
613
.......
614
 
615
     (gdb)
616
     -environment-directory /kwikemart/marge/ezannoni/flathead-dev/devo/gdb
617
     ^done
618
     (gdb)
619
 
620
The `-environment-path' Command
621
-------------------------------
622
 
623
Synopsis
624
........
625
 
626
      -environment-path ( PATHDIR )+
627
 
628
   Add directories PATHDIR to beginning of search path for object files.
629
 
630
GDB Command
631
...........
632
 
633
   The corresponding GDB command is `path'.
634
 
635
Example
636
.......
637
 
638
     (gdb)
639
     -environment-path /kwikemart/marge/ezannoni/flathead-dev/ppc-eabi/gdb
640
     ^done
641
     (gdb)
642
 
643
The `-environment-pwd' Command
644
------------------------------
645
 
646
Synopsis
647
........
648
 
649
      -environment-pwd
650
 
651
   Show the current working directory.
652
 
653
GDB command
654
...........
655
 
656
   The corresponding GDB command is `pwd'.
657
 
658
Example
659
.......
660
 
661
     (gdb)
662
     -environment-pwd
663
     ~Working directory /kwikemart/marge/ezannoni/flathead-dev/devo/gdb.
664
     ^done
665
     (gdb)
666
 
667

668
File: gdb.info,  Node: GDB/MI Program Control,  Next: GDB/MI Miscellaneous Commands,  Prev: GDB/MI Data Manipulation,  Up: GDB/MI
669
 
670
GDB/MI Program control
671
======================
672
 
673
Program termination
674
...................
675
 
676
   As a result of execution, the inferior program can run to
677
completion, if it doesn't encounter any breakpoints.  In this case the
678
output will include an exit code, if the program has exited
679
exceptionally.
680
 
681
Examples
682
........
683
 
684
Program exited normally:
685
 
686
     (gdb)
687
     -exec-run
688
     ^running
689
     (gdb)
690
     x = 55
691
     *stopped,reason="exited-normally"
692
     (gdb)
693
 
694
Program exited exceptionally:
695
 
696
     (gdb)
697
     -exec-run
698
     ^running
699
     (gdb)
700
     x = 55
701
     *stopped,reason="exited",exit-code="01"
702
     (gdb)
703
 
704
   Another way the program can terminate is if it receives a signal
705
such as `SIGINT'.  In this case, GDB/MI displays this:
706
 
707
     (gdb)
708
     *stopped,reason="exited-signalled",signal-name="SIGINT",
709
     signal-meaning="Interrupt"
710
 
711
The `-exec-abort' Command
712
-------------------------
713
 
714
Synopsis
715
........
716
 
717
      -exec-abort
718
 
719
   Kill the inferior running program.
720
 
721
GDB Command
722
...........
723
 
724
   The corresponding GDB command is `kill'.
725
 
726
Example
727
.......
728
 
729
   N.A.
730
 
731
The `-exec-arguments' Command
732
-----------------------------
733
 
734
Synopsis
735
........
736
 
737
      -exec-arguments ARGS
738
 
739
   Set the inferior program arguments, to be used in the next
740
`-exec-run'.
741
 
742
GDB Command
743
...........
744
 
745
   The corresponding GDB command is `set args'.
746
 
747
Example
748
.......
749
 
750
   Don't have one around.
751
 
752
The `-exec-continue' Command
753
----------------------------
754
 
755
Synopsis
756
........
757
 
758
      -exec-continue
759
 
760
   Asynchronous command.  Resumes the execution of the inferior program
761
until a breakpoint is encountered, or until the inferior exits.
762
 
763
GDB Command
764
...........
765
 
766
   The corresponding GDB corresponding is `continue'.
767
 
768
Example
769
.......
770
 
771
     -exec-continue
772
     ^running
773
     (gdb)
774
     @Hello world
775
     *stopped,reason="breakpoint-hit",bkptno="2",frame={func="foo",args=[],
776
     file="hello.c",line="13"}
777
     (gdb)
778
 
779
The `-exec-finish' Command
780
--------------------------
781
 
782
Synopsis
783
........
784
 
785
      -exec-finish
786
 
787
   Asynchronous command.  Resumes the execution of the inferior program
788
until the current function is exited.  Displays the results returned by
789
the function.
790
 
791
GDB Command
792
...........
793
 
794
   The corresponding GDB command is `finish'.
795
 
796
Example
797
.......
798
 
799
   Function returning `void'.
800
 
801
     -exec-finish
802
     ^running
803
     (gdb)
804
     @hello from foo
805
     *stopped,reason="function-finished",frame={func="main",args=[],
806
     file="hello.c",line="7"}
807
     (gdb)
808
 
809
   Function returning other than `void'.  The name of the internal GDB
810
variable storing the result is printed, together with the value itself.
811
 
812
     -exec-finish
813
     ^running
814
     (gdb)
815
     *stopped,reason="function-finished",frame={addr="0x000107b0",func="foo",
816
     args=[{name="a",value="1"],{name="b",value="9"}},
817
     file="recursive2.c",line="14"},
818
     gdb-result-var="$1",return-value="0"
819
     (gdb)
820
 
821
The `-exec-interrupt' Command
822
-----------------------------
823
 
824
Synopsis
825
........
826
 
827
      -exec-interrupt
828
 
829
   Asynchronous command.  Interrupts the background execution of the
830
target.  Note how the token associated with the stop message is the one
831
for the execution command that has been interrupted.  The token for the
832
interrupt itself only appears in the `^done' output.  If the user is
833
trying to interrupt a non-running program, an error message will be
834
printed.
835
 
836
GDB Command
837
...........
838
 
839
   The corresponding GDB command is `interrupt'.
840
 
841
Example
842
.......
843
 
844
     (gdb)
845
     111-exec-continue
846
     111^running
847
 
848
     (gdb)
849
     222-exec-interrupt
850
     222^done
851
     (gdb)
852
     111*stopped,signal-name="SIGINT",signal-meaning="Interrupt",
853
     frame={addr="0x00010140",func="foo",args=[],file="try.c",line="13"}
854
     (gdb)
855
 
856
     (gdb)
857
     -exec-interrupt
858
     ^error,msg="mi_cmd_exec_interrupt: Inferior not executing."
859
     (gdb)
860
 
861
The `-exec-next' Command
862
------------------------
863
 
864
Synopsis
865
........
866
 
867
      -exec-next
868
 
869
   Asynchronous command.  Resumes execution of the inferior program,
870
stopping when the beginning of the next source line is reached.
871
 
872
GDB Command
873
...........
874
 
875
   The corresponding GDB command is `next'.
876
 
877
Example
878
.......
879
 
880
     -exec-next
881
     ^running
882
     (gdb)
883
     *stopped,reason="end-stepping-range",line="8",file="hello.c"
884
     (gdb)
885
 
886
The `-exec-next-instruction' Command
887
------------------------------------
888
 
889
Synopsis
890
........
891
 
892
      -exec-next-instruction
893
 
894
   Asynchronous command.  Executes one machine instruction.  If the
895
instruction is a function call continues until the function returns.  If
896
the program stops at an instruction in the middle of a source line, the
897
address will be printed as well.
898
 
899
GDB Command
900
...........
901
 
902
   The corresponding GDB command is `nexti'.
903
 
904
Example
905
.......
906
 
907
     (gdb)
908
     -exec-next-instruction
909
     ^running
910
 
911
     (gdb)
912
     *stopped,reason="end-stepping-range",
913
     addr="0x000100d4",line="5",file="hello.c"
914
     (gdb)
915
 
916
The `-exec-return' Command
917
--------------------------
918
 
919
Synopsis
920
........
921
 
922
      -exec-return
923
 
924
   Makes current function return immediately.  Doesn't execute the
925
inferior.  Displays the new current frame.
926
 
927
GDB Command
928
...........
929
 
930
   The corresponding GDB command is `return'.
931
 
932
Example
933
.......
934
 
935
     (gdb)
936
     200-break-insert callee4
937
     200^done,bkpt={number="1",addr="0x00010734",
938
     file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="8"}
939
     (gdb)
940
     000-exec-run
941
     000^running
942
     (gdb)
943
     000*stopped,reason="breakpoint-hit",bkptno="1",
944
     frame={func="callee4",args=[],
945
     file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="8"}
946
     (gdb)
947
     205-break-delete
948
     205^done
949
     (gdb)
950
     111-exec-return
951
     111^done,frame={level="0 ",func="callee3",
952
     args=[{name="strarg",
953
     value="0x11940 \"A string argument.\""}],
954
     file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="18"}
955
     (gdb)
956
 
957
The `-exec-run' Command
958
-----------------------
959
 
960
Synopsis
961
........
962
 
963
      -exec-run
964
 
965
   Asynchronous command.  Starts execution of the inferior from the
966
beginning.  The inferior executes until either a breakpoint is
967
encountered or the program exits.
968
 
969
GDB Command
970
...........
971
 
972
   The corresponding GDB command is `run'.
973
 
974
Example
975
.......
976
 
977
     (gdb)
978
     -break-insert main
979
     ^done,bkpt={number="1",addr="0x0001072c",file="recursive2.c",line="4"}
980
     (gdb)
981
     -exec-run
982
     ^running
983
     (gdb)
984
     *stopped,reason="breakpoint-hit",bkptno="1",
985
     frame={func="main",args=[],file="recursive2.c",line="4"}
986
     (gdb)
987
 
988
The `-exec-show-arguments' Command
989
----------------------------------
990
 
991
Synopsis
992
........
993
 
994
      -exec-show-arguments
995
 
996
   Print the arguments of the program.
997
 
998
GDB Command
999
...........
1000
 
1001
   The corresponding GDB command is `show args'.
1002
 
1003
Example
1004
.......
1005
 
1006
   N.A.
1007
 
1008
The `-exec-step' Command
1009
------------------------
1010
 
1011
Synopsis
1012
........
1013
 
1014
      -exec-step
1015
 
1016
   Asynchronous command.  Resumes execution of the inferior program,
1017
stopping when the beginning of the next source line is reached, if the
1018
next source line is not a function call.  If it is, stop at the first
1019
instruction of the called function.
1020
 
1021
GDB Command
1022
...........
1023
 
1024
   The corresponding GDB command is `step'.
1025
 
1026
Example
1027
.......
1028
 
1029
   Stepping into a function:
1030
 
1031
     -exec-step
1032
     ^running
1033
     (gdb)
1034
     *stopped,reason="end-stepping-range",
1035
     frame={func="foo",args=[{name="a",value="10"},
1036
     {name="b",value="0"}],file="recursive2.c",line="11"}
1037
     (gdb)
1038
 
1039
   Regular stepping:
1040
 
1041
     -exec-step
1042
     ^running
1043
     (gdb)
1044
     *stopped,reason="end-stepping-range",line="14",file="recursive2.c"
1045
     (gdb)
1046
 
1047
The `-exec-step-instruction' Command
1048
------------------------------------
1049
 
1050
Synopsis
1051
........
1052
 
1053
      -exec-step-instruction
1054
 
1055
   Asynchronous command.  Resumes the inferior which executes one
1056
machine instruction.  The output, once GDB has stopped, will vary
1057
depending on whether we have stopped in the middle of a source line or
1058
not.  In the former case, the address at which the program stopped will
1059
be printed as well.
1060
 
1061
GDB Command
1062
...........
1063
 
1064
   The corresponding GDB command is `stepi'.
1065
 
1066
Example
1067
.......
1068
 
1069
     (gdb)
1070
     -exec-step-instruction
1071
     ^running
1072
 
1073
     (gdb)
1074
     *stopped,reason="end-stepping-range",
1075
     frame={func="foo",args=[],file="try.c",line="10"}
1076
     (gdb)
1077
     -exec-step-instruction
1078
     ^running
1079
 
1080
     (gdb)
1081
     *stopped,reason="end-stepping-range",
1082
     frame={addr="0x000100f4",func="foo",args=[],file="try.c",line="10"}
1083
     (gdb)
1084
 
1085
The `-exec-until' Command
1086
-------------------------
1087
 
1088
Synopsis
1089
........
1090
 
1091
      -exec-until [ LOCATION ]
1092
 
1093
   Asynchronous command.  Executes the inferior until the LOCATION
1094
specified in the argument is reached.  If there is no argument, the
1095
inferior executes until a source line greater than the current one is
1096
reached.  The reason for stopping in this case will be
1097
`location-reached'.
1098
 
1099
GDB Command
1100
...........
1101
 
1102
   The corresponding GDB command is `until'.
1103
 
1104
Example
1105
.......
1106
 
1107
     (gdb)
1108
     -exec-until recursive2.c:6
1109
     ^running
1110
     (gdb)
1111
     x = 55
1112
     *stopped,reason="location-reached",frame={func="main",args=[],
1113
     file="recursive2.c",line="6"}
1114
     (gdb)
1115
 
1116
The `-file-exec-and-symbols' Command
1117
------------------------------------
1118
 
1119
Synopsis
1120
........
1121
 
1122
      -file-exec-and-symbols FILE
1123
 
1124
   Specify the executable file to be debugged.  This file is the one
1125
from which the symbol table is also read.  If no file is specified, the
1126
command clears the executable and symbol information.  If breakpoints
1127
are set when using this command with no arguments, GDB will produce
1128
error messages.  Otherwise, no output is produced, except a completion
1129
notification.
1130
 
1131
GDB Command
1132
...........
1133
 
1134
   The corresponding GDB command is `file'.
1135
 
1136
Example
1137
.......
1138
 
1139
     (gdb)
1140
     -file-exec-and-symbols /kwikemart/marge/ezannoni/TRUNK/mbx/hello.mbx
1141
     ^done
1142
     (gdb)
1143
 
1144
The `-file-exec-file' Command
1145
-----------------------------
1146
 
1147
Synopsis
1148
........
1149
 
1150
      -file-exec-file FILE
1151
 
1152
   Specify the executable file to be debugged.  Unlike
1153
`-file-exec-and-symbols', the symbol table is _not_ read from this
1154
file.  If used without argument, GDB clears the information about the
1155
executable file.  No output is produced, except a completion
1156
notification.
1157
 
1158
GDB Command
1159
...........
1160
 
1161
   The corresponding GDB command is `exec-file'.
1162
 
1163
Example
1164
.......
1165
 
1166
     (gdb)
1167
     -file-exec-file /kwikemart/marge/ezannoni/TRUNK/mbx/hello.mbx
1168
     ^done
1169
     (gdb)
1170
 
1171
The `-file-list-exec-sections' Command
1172
--------------------------------------
1173
 
1174
Synopsis
1175
........
1176
 
1177
      -file-list-exec-sections
1178
 
1179
   List the sections of the current executable file.
1180
 
1181
GDB Command
1182
...........
1183
 
1184
   The GDB command `info file' shows, among the rest, the same
1185
information as this command.  `gdbtk' has a corresponding command
1186
`gdb_load_info'.
1187
 
1188
Example
1189
.......
1190
 
1191
   N.A.
1192
 
1193
The `-file-list-exec-source-files' Command
1194
------------------------------------------
1195
 
1196
Synopsis
1197
........
1198
 
1199
      -file-list-exec-source-files
1200
 
1201
   List the source files for the current executable.
1202
 
1203
GDB Command
1204
...........
1205
 
1206
   There's no GDB command which directly corresponds to this one.
1207
`gdbtk' has an analogous command `gdb_listfiles'.
1208
 
1209
Example
1210
.......
1211
 
1212
   N.A.
1213
 
1214
The `-file-list-shared-libraries' Command
1215
-----------------------------------------
1216
 
1217
Synopsis
1218
........
1219
 
1220
      -file-list-shared-libraries
1221
 
1222
   List the shared libraries in the program.
1223
 
1224
GDB Command
1225
...........
1226
 
1227
   The corresponding GDB command is `info shared'.
1228
 
1229
Example
1230
.......
1231
 
1232
   N.A.
1233
 
1234
The `-file-list-symbol-files' Command
1235
-------------------------------------
1236
 
1237
Synopsis
1238
........
1239
 
1240
      -file-list-symbol-files
1241
 
1242
   List symbol files.
1243
 
1244
GDB Command
1245
...........
1246
 
1247
   The corresponding GDB command is `info file' (part of it).
1248
 
1249
Example
1250
.......
1251
 
1252
   N.A.
1253
 
1254
The `-file-symbol-file' Command
1255
-------------------------------
1256
 
1257
Synopsis
1258
........
1259
 
1260
      -file-symbol-file FILE
1261
 
1262
   Read symbol table info from the specified FILE argument.  When used
1263
without arguments, clears GDB's symbol table info.  No output is
1264
produced, except for a completion notification.
1265
 
1266
GDB Command
1267
...........
1268
 
1269
   The corresponding GDB command is `symbol-file'.
1270
 
1271
Example
1272
.......
1273
 
1274
     (gdb)
1275
     -file-symbol-file /kwikemart/marge/ezannoni/TRUNK/mbx/hello.mbx
1276
     ^done
1277
     (gdb)
1278
 
1279

1280
File: gdb.info,  Node: GDB/MI Miscellaneous Commands,  Next: GDB/MI Stack Manipulation,  Prev: GDB/MI Program Control,  Up: GDB/MI
1281
 
1282
Miscellaneous GDB commands in GDB/MI
1283
====================================
1284
 
1285
The `-gdb-exit' Command
1286
-----------------------
1287
 
1288
Synopsis
1289
........
1290
 
1291
      -gdb-exit
1292
 
1293
   Exit GDB immediately.
1294
 
1295
GDB Command
1296
...........
1297
 
1298
   Approximately corresponds to `quit'.
1299
 
1300
Example
1301
.......
1302
 
1303
     (gdb)
1304
     -gdb-exit
1305
 
1306
The `-gdb-set' Command
1307
----------------------
1308
 
1309
Synopsis
1310
........
1311
 
1312
      -gdb-set
1313
 
1314
   Set an internal GDB variable.
1315
 
1316
GDB Command
1317
...........
1318
 
1319
   The corresponding GDB command is `set'.
1320
 
1321
Example
1322
.......
1323
 
1324
     (gdb)
1325
     -gdb-set $foo=3
1326
     ^done
1327
     (gdb)
1328
 
1329
The `-gdb-show' Command
1330
-----------------------
1331
 
1332
Synopsis
1333
........
1334
 
1335
      -gdb-show
1336
 
1337
   Show the current value of a GDB variable.
1338
 
1339
GDB command
1340
...........
1341
 
1342
   The corresponding GDB command is `show'.
1343
 
1344
Example
1345
.......
1346
 
1347
     (gdb)
1348
     -gdb-show annotate
1349
     ^done,value="0"
1350
     (gdb)
1351
 
1352
The `-gdb-version' Command
1353
--------------------------
1354
 
1355
Synopsis
1356
........
1357
 
1358
      -gdb-version
1359
 
1360
   Show version information for GDB.  Used mostly in testing.
1361
 
1362
GDB Command
1363
...........
1364
 
1365
   There's no equivalent GDB command.  GDB by default shows this
1366
information when you start an interactive session.
1367
 
1368
Example
1369
.......
1370
 
1371
     (gdb)
1372
     -gdb-version
1373
     ~GNU gdb 5.2.1
1374
     ~Copyright 2000 Free Software Foundation, Inc.
1375
     ~GDB is free software, covered by the GNU General Public License, and
1376
     ~you are welcome to change it and/or distribute copies of it under
1377
     ~ certain conditions.
1378
     ~Type "show copying" to see the conditions.
1379
     ~There is absolutely no warranty for GDB.  Type "show warranty" for
1380
     ~ details.
1381
     ~This GDB was configured as
1382
      "--host=sparc-sun-solaris2.5.1 --target=ppc-eabi".
1383
     ^done
1384
     (gdb)
1385
 
1386

1387
File: gdb.info,  Node: GDB/MI Stack Manipulation,  Next: GDB/MI Symbol Query,  Prev: GDB/MI Miscellaneous Commands,  Up: GDB/MI
1388
 
1389
GDB/MI Stack Manipulation Commands
1390
==================================
1391
 
1392
The `-stack-info-frame' Command
1393
-------------------------------
1394
 
1395
Synopsis
1396
........
1397
 
1398
      -stack-info-frame
1399
 
1400
   Get info on the current frame.
1401
 
1402
GDB Command
1403
...........
1404
 
1405
   The corresponding GDB command is `info frame' or `frame' (without
1406
arguments).
1407
 
1408
Example
1409
.......
1410
 
1411
   N.A.
1412
 
1413
The `-stack-info-depth' Command
1414
-------------------------------
1415
 
1416
Synopsis
1417
........
1418
 
1419
      -stack-info-depth [ MAX-DEPTH ]
1420
 
1421
   Return the depth of the stack.  If the integer argument MAX-DEPTH is
1422
specified, do not count beyond MAX-DEPTH frames.
1423
 
1424
GDB Command
1425
...........
1426
 
1427
   There's no equivalent GDB command.
1428
 
1429
Example
1430
.......
1431
 
1432
   For a stack with frame levels 0 through 11:
1433
 
1434
     (gdb)
1435
     -stack-info-depth
1436
     ^done,depth="12"
1437
     (gdb)
1438
     -stack-info-depth 4
1439
     ^done,depth="4"
1440
     (gdb)
1441
     -stack-info-depth 12
1442
     ^done,depth="12"
1443
     (gdb)
1444
     -stack-info-depth 11
1445
     ^done,depth="11"
1446
     (gdb)
1447
     -stack-info-depth 13
1448
     ^done,depth="12"
1449
     (gdb)
1450
 
1451
The `-stack-list-arguments' Command
1452
-----------------------------------
1453
 
1454
Synopsis
1455
........
1456
 
1457
      -stack-list-arguments SHOW-VALUES
1458
         [ LOW-FRAME HIGH-FRAME ]
1459
 
1460
   Display a list of the arguments for the frames between LOW-FRAME and
1461
HIGH-FRAME (inclusive).  If LOW-FRAME and HIGH-FRAME are not provided,
1462
list the arguments for the whole call stack.
1463
 
1464
   The SHOW-VALUES argument must have a value of 0 or 1.  A value of 0
1465
means that only the names of the arguments are listed, a value of 1
1466
means that both names and values of the arguments are printed.
1467
 
1468
GDB Command
1469
...........
1470
 
1471
   GDB does not have an equivalent command.  `gdbtk' has a
1472
`gdb_get_args' command which partially overlaps with the functionality
1473
of `-stack-list-arguments'.
1474
 
1475
Example
1476
.......
1477
 
1478
     (gdb)
1479
     -stack-list-frames
1480
     ^done,
1481
     stack=[
1482
     frame={level="0 ",addr="0x00010734",func="callee4",
1483
     file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="8"},
1484
     frame={level="1 ",addr="0x0001076c",func="callee3",
1485
     file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="17"},
1486
     frame={level="2 ",addr="0x0001078c",func="callee2",
1487
     file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="22"},
1488
     frame={level="3 ",addr="0x000107b4",func="callee1",
1489
     file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="27"},
1490
     frame={level="4 ",addr="0x000107e0",func="main",
1491
     file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="32"}]
1492
     (gdb)
1493
     -stack-list-arguments 0
1494
     ^done,
1495
     stack-args=[
1496
     frame={level="0",args=[]},
1497
     frame={level="1",args=[name="strarg"]},
1498
     frame={level="2",args=[name="intarg",name="strarg"]},
1499
     frame={level="3",args=[name="intarg",name="strarg",name="fltarg"]},
1500
     frame={level="4",args=[]}]
1501
     (gdb)
1502
     -stack-list-arguments 1
1503
     ^done,
1504
     stack-args=[
1505
     frame={level="0",args=[]},
1506
     frame={level="1",
1507
      args=[{name="strarg",value="0x11940 \"A string argument.\""}]},
1508
     frame={level="2",args=[
1509
     {name="intarg",value="2"},
1510
     {name="strarg",value="0x11940 \"A string argument.\""}]},
1511
     {frame={level="3",args=[
1512
     {name="intarg",value="2"},
1513
     {name="strarg",value="0x11940 \"A string argument.\""},
1514
     {name="fltarg",value="3.5"}]},
1515
     frame={level="4",args=[]}]
1516
     (gdb)
1517
     -stack-list-arguments 0 2 2
1518
     ^done,stack-args=[frame={level="2",args=[name="intarg",name="strarg"]}]
1519
     (gdb)
1520
     -stack-list-arguments 1 2 2
1521
     ^done,stack-args=[frame={level="2",
1522
     args=[{name="intarg",value="2"},
1523
     {name="strarg",value="0x11940 \"A string argument.\""}]}]
1524
     (gdb)
1525
 
1526
The `-stack-list-frames' Command
1527
--------------------------------
1528
 
1529
Synopsis
1530
........
1531
 
1532
      -stack-list-frames [ LOW-FRAME HIGH-FRAME ]
1533
 
1534
   List the frames currently on the stack.  For each frame it displays
1535
the following info:
1536
 
1537
`LEVEL'
1538
     The frame number, 0 being the topmost frame, i.e. the innermost
1539
     function.
1540
 
1541
`ADDR'
1542
     The `$pc' value for that frame.
1543
 
1544
`FUNC'
1545
     Function name.
1546
 
1547
`FILE'
1548
     File name of the source file where the function lives.
1549
 
1550
`LINE'
1551
     Line number corresponding to the `$pc'.
1552
 
1553
   If invoked without arguments, this command prints a backtrace for the
1554
whole stack.  If given two integer arguments, it shows the frames whose
1555
levels are between the two arguments (inclusive).  If the two arguments
1556
are equal, it shows the single frame at the corresponding level.
1557
 
1558
GDB Command
1559
...........
1560
 
1561
   The corresponding GDB commands are `backtrace' and `where'.
1562
 
1563
Example
1564
.......
1565
 
1566
   Full stack backtrace:
1567
 
1568
     (gdb)
1569
     -stack-list-frames
1570
     ^done,stack=
1571
     [frame={level="0 ",addr="0x0001076c",func="foo",
1572
       file="recursive2.c",line="11"},
1573
     frame={level="1 ",addr="0x000107a4",func="foo",
1574
       file="recursive2.c",line="14"},
1575
     frame={level="2 ",addr="0x000107a4",func="foo",
1576
       file="recursive2.c",line="14"},
1577
     frame={level="3 ",addr="0x000107a4",func="foo",
1578
       file="recursive2.c",line="14"},
1579
     frame={level="4 ",addr="0x000107a4",func="foo",
1580
       file="recursive2.c",line="14"},
1581
     frame={level="5 ",addr="0x000107a4",func="foo",
1582
       file="recursive2.c",line="14"},
1583
     frame={level="6 ",addr="0x000107a4",func="foo",
1584
       file="recursive2.c",line="14"},
1585
     frame={level="7 ",addr="0x000107a4",func="foo",
1586
       file="recursive2.c",line="14"},
1587
     frame={level="8 ",addr="0x000107a4",func="foo",
1588
       file="recursive2.c",line="14"},
1589
     frame={level="9 ",addr="0x000107a4",func="foo",
1590
       file="recursive2.c",line="14"},
1591
     frame={level="10",addr="0x000107a4",func="foo",
1592
       file="recursive2.c",line="14"},
1593
     frame={level="11",addr="0x00010738",func="main",
1594
       file="recursive2.c",line="4"}]
1595
     (gdb)
1596
 
1597
   Show frames between LOW_FRAME and HIGH_FRAME:
1598
 
1599
     (gdb)
1600
     -stack-list-frames 3 5
1601
     ^done,stack=
1602
     [frame={level="3 ",addr="0x000107a4",func="foo",
1603
       file="recursive2.c",line="14"},
1604
     frame={level="4 ",addr="0x000107a4",func="foo",
1605
       file="recursive2.c",line="14"},
1606
     frame={level="5 ",addr="0x000107a4",func="foo",
1607
       file="recursive2.c",line="14"}]
1608
     (gdb)
1609
 
1610
   Show a single frame:
1611
 
1612
     (gdb)
1613
     -stack-list-frames 3 3
1614
     ^done,stack=
1615
     [frame={level="3 ",addr="0x000107a4",func="foo",
1616
       file="recursive2.c",line="14"}]
1617
     (gdb)
1618
 
1619
The `-stack-list-locals' Command
1620
--------------------------------
1621
 
1622
Synopsis
1623
........
1624
 
1625
      -stack-list-locals PRINT-VALUES
1626
 
1627
   Display the local variable names for the current frame.  With an
1628
argument of 0 prints only the names of the variables, with argument of 1
1629
prints also their values.
1630
 
1631
GDB Command
1632
...........
1633
 
1634
   `info locals' in GDB, `gdb_get_locals' in `gdbtk'.
1635
 
1636
Example
1637
.......
1638
 
1639
     (gdb)
1640
     -stack-list-locals 0
1641
     ^done,locals=[name="A",name="B",name="C"]
1642
     (gdb)
1643
     -stack-list-locals 1
1644
     ^done,locals=[{name="A",value="1"},{name="B",value="2"},
1645
       {name="C",value="3"}]
1646
     (gdb)
1647
 
1648
The `-stack-select-frame' Command
1649
---------------------------------
1650
 
1651
Synopsis
1652
........
1653
 
1654
      -stack-select-frame FRAMENUM
1655
 
1656
   Change the current frame.  Select a different frame FRAMENUM on the
1657
stack.
1658
 
1659
GDB Command
1660
...........
1661
 
1662
   The corresponding GDB commands are `frame', `up', `down',
1663
`select-frame', `up-silent', and `down-silent'.
1664
 
1665
Example
1666
.......
1667
 
1668
     (gdb)
1669
     -stack-select-frame 2
1670
     ^done
1671
     (gdb)
1672
 
1673

1674
File: gdb.info,  Node: GDB/MI Symbol Query,  Next: GDB/MI Target Manipulation,  Prev: GDB/MI Stack Manipulation,  Up: GDB/MI
1675
 
1676
GDB/MI Symbol Query Commands
1677
============================
1678
 
1679
The `-symbol-info-address' Command
1680
----------------------------------
1681
 
1682
Synopsis
1683
........
1684
 
1685
      -symbol-info-address SYMBOL
1686
 
1687
   Describe where SYMBOL is stored.
1688
 
1689
GDB Command
1690
...........
1691
 
1692
   The corresponding GDB command is `info address'.
1693
 
1694
Example
1695
.......
1696
 
1697
   N.A.
1698
 
1699
The `-symbol-info-file' Command
1700
-------------------------------
1701
 
1702
Synopsis
1703
........
1704
 
1705
      -symbol-info-file
1706
 
1707
   Show the file for the symbol.
1708
 
1709
GDB Command
1710
...........
1711
 
1712
   There's no equivalent GDB command.  `gdbtk' has `gdb_find_file'.
1713
 
1714
Example
1715
.......
1716
 
1717
   N.A.
1718
 
1719
The `-symbol-info-function' Command
1720
-----------------------------------
1721
 
1722
Synopsis
1723
........
1724
 
1725
      -symbol-info-function
1726
 
1727
   Show which function the symbol lives in.
1728
 
1729
GDB Command
1730
...........
1731
 
1732
   `gdb_get_function' in `gdbtk'.
1733
 
1734
Example
1735
.......
1736
 
1737
   N.A.
1738
 
1739
The `-symbol-info-line' Command
1740
-------------------------------
1741
 
1742
Synopsis
1743
........
1744
 
1745
      -symbol-info-line
1746
 
1747
   Show the core addresses of the code for a source line.
1748
 
1749
GDB Command
1750
...........
1751
 
1752
   The corresponding GDB comamnd is `info line'.  `gdbtk' has the
1753
`gdb_get_line' and `gdb_get_file' commands.
1754
 
1755
Example
1756
.......
1757
 
1758
   N.A.
1759
 
1760
The `-symbol-info-symbol' Command
1761
---------------------------------
1762
 
1763
Synopsis
1764
........
1765
 
1766
      -symbol-info-symbol ADDR
1767
 
1768
   Describe what symbol is at location ADDR.
1769
 
1770
GDB Command
1771
...........
1772
 
1773
   The corresponding GDB command is `info symbol'.
1774
 
1775
Example
1776
.......
1777
 
1778
   N.A.
1779
 
1780
The `-symbol-list-functions' Command
1781
------------------------------------
1782
 
1783
Synopsis
1784
........
1785
 
1786
      -symbol-list-functions
1787
 
1788
   List the functions in the executable.
1789
 
1790
GDB Command
1791
...........
1792
 
1793
   `info functions' in GDB, `gdb_listfunc' and `gdb_search' in `gdbtk'.
1794
 
1795
Example
1796
.......
1797
 
1798
   N.A.
1799
 
1800
The `-symbol-list-types' Command
1801
--------------------------------
1802
 
1803
Synopsis
1804
........
1805
 
1806
      -symbol-list-types
1807
 
1808
   List all the type names.
1809
 
1810
GDB Command
1811
...........
1812
 
1813
   The corresponding commands are `info types' in GDB, `gdb_search' in
1814
`gdbtk'.
1815
 
1816
Example
1817
.......
1818
 
1819
   N.A.
1820
 
1821
The `-symbol-list-variables' Command
1822
------------------------------------
1823
 
1824
Synopsis
1825
........
1826
 
1827
      -symbol-list-variables
1828
 
1829
   List all the global and static variable names.
1830
 
1831
GDB Command
1832
...........
1833
 
1834
   `info variables' in GDB, `gdb_search' in `gdbtk'.
1835
 
1836
Example
1837
.......
1838
 
1839
   N.A.
1840
 
1841
The `-symbol-locate' Command
1842
----------------------------
1843
 
1844
Synopsis
1845
........
1846
 
1847
      -symbol-locate
1848
 
1849
GDB Command
1850
...........
1851
 
1852
   `gdb_loc' in `gdbtk'.
1853
 
1854
Example
1855
.......
1856
 
1857
   N.A.
1858
 
1859
The `-symbol-type' Command
1860
--------------------------
1861
 
1862
Synopsis
1863
........
1864
 
1865
      -symbol-type VARIABLE
1866
 
1867
   Show type of VARIABLE.
1868
 
1869
GDB Command
1870
...........
1871
 
1872
   The corresponding GDB command is `ptype', `gdbtk' has
1873
`gdb_obj_variable'.
1874
 
1875
Example
1876
.......
1877
 
1878
   N.A.
1879
 
1880

1881
File: gdb.info,  Node: GDB/MI Target Manipulation,  Next: GDB/MI Thread Commands,  Prev: GDB/MI Symbol Query,  Up: GDB/MI
1882
 
1883
GDB/MI Target Manipulation Commands
1884
===================================
1885
 
1886
The `-target-attach' Command
1887
----------------------------
1888
 
1889
Synopsis
1890
........
1891
 
1892
      -target-attach PID | FILE
1893
 
1894
   Attach to a process PID or a file FILE outside of GDB.
1895
 
1896
GDB command
1897
...........
1898
 
1899
   The corresponding GDB command is `attach'.
1900
 
1901
Example
1902
.......
1903
 
1904
   N.A.
1905
 
1906
The `-target-compare-sections' Command
1907
--------------------------------------
1908
 
1909
Synopsis
1910
........
1911
 
1912
      -target-compare-sections [ SECTION ]
1913
 
1914
   Compare data of section SECTION on target to the exec file.  Without
1915
the argument, all sections are compared.
1916
 
1917
GDB Command
1918
...........
1919
 
1920
   The GDB equivalent is `compare-sections'.
1921
 
1922
Example
1923
.......
1924
 
1925
   N.A.
1926
 
1927
The `-target-detach' Command
1928
----------------------------
1929
 
1930
Synopsis
1931
........
1932
 
1933
      -target-detach
1934
 
1935
   Disconnect from the remote target.  There's no output.
1936
 
1937
GDB command
1938
...........
1939
 
1940
   The corresponding GDB command is `detach'.
1941
 
1942
Example
1943
.......
1944
 
1945
     (gdb)
1946
     -target-detach
1947
     ^done
1948
     (gdb)
1949
 
1950
The `-target-download' Command
1951
------------------------------
1952
 
1953
Synopsis
1954
........
1955
 
1956
      -target-download
1957
 
1958
   Loads the executable onto the remote target.  It prints out an
1959
update message every half second, which includes the fields:
1960
 
1961
`section'
1962
     The name of the section.
1963
 
1964
`section-sent'
1965
     The size of what has been sent so far for that section.
1966
 
1967
`section-size'
1968
     The size of the section.
1969
 
1970
`total-sent'
1971
     The total size of what was sent so far (the current and the
1972
     previous sections).
1973
 
1974
`total-size'
1975
     The size of the overall executable to download.
1976
 
1977
Each message is sent as status record (*note GDB/MI Output Syntax:
1978
GDB/MI Output Syntax.).
1979
 
1980
   In addition, it prints the name and size of the sections, as they are
1981
downloaded.  These messages include the following fields:
1982
 
1983
`section'
1984
     The name of the section.
1985
 
1986
`section-size'
1987
     The size of the section.
1988
 
1989
`total-size'
1990
     The size of the overall executable to download.
1991
 
1992
At the end, a summary is printed.
1993
 
1994
GDB Command
1995
...........
1996
 
1997
   The corresponding GDB command is `load'.
1998
 
1999
Example
2000
.......
2001
 
2002
   Note: each status message appears on a single line.  Here the
2003
messages have been broken down so that they can fit onto a page.
2004
 
2005
     (gdb)
2006
     -target-download
2007
     +download,{section=".text",section-size="6668",total-size="9880"}
2008
     +download,{section=".text",section-sent="512",section-size="6668",
2009
     total-sent="512",total-size="9880"}
2010
     +download,{section=".text",section-sent="1024",section-size="6668",
2011
     total-sent="1024",total-size="9880"}
2012
     +download,{section=".text",section-sent="1536",section-size="6668",
2013
     total-sent="1536",total-size="9880"}
2014
     +download,{section=".text",section-sent="2048",section-size="6668",
2015
     total-sent="2048",total-size="9880"}
2016
     +download,{section=".text",section-sent="2560",section-size="6668",
2017
     total-sent="2560",total-size="9880"}
2018
     +download,{section=".text",section-sent="3072",section-size="6668",
2019
     total-sent="3072",total-size="9880"}
2020
     +download,{section=".text",section-sent="3584",section-size="6668",
2021
     total-sent="3584",total-size="9880"}
2022
     +download,{section=".text",section-sent="4096",section-size="6668",
2023
     total-sent="4096",total-size="9880"}
2024
     +download,{section=".text",section-sent="4608",section-size="6668",
2025
     total-sent="4608",total-size="9880"}
2026
     +download,{section=".text",section-sent="5120",section-size="6668",
2027
     total-sent="5120",total-size="9880"}
2028
     +download,{section=".text",section-sent="5632",section-size="6668",
2029
     total-sent="5632",total-size="9880"}
2030
     +download,{section=".text",section-sent="6144",section-size="6668",
2031
     total-sent="6144",total-size="9880"}
2032
     +download,{section=".text",section-sent="6656",section-size="6668",
2033
     total-sent="6656",total-size="9880"}
2034
     +download,{section=".init",section-size="28",total-size="9880"}
2035
     +download,{section=".fini",section-size="28",total-size="9880"}
2036
     +download,{section=".data",section-size="3156",total-size="9880"}
2037
     +download,{section=".data",section-sent="512",section-size="3156",
2038
     total-sent="7236",total-size="9880"}
2039
     +download,{section=".data",section-sent="1024",section-size="3156",
2040
     total-sent="7748",total-size="9880"}
2041
     +download,{section=".data",section-sent="1536",section-size="3156",
2042
     total-sent="8260",total-size="9880"}
2043
     +download,{section=".data",section-sent="2048",section-size="3156",
2044
     total-sent="8772",total-size="9880"}
2045
     +download,{section=".data",section-sent="2560",section-size="3156",
2046
     total-sent="9284",total-size="9880"}
2047
     +download,{section=".data",section-sent="3072",section-size="3156",
2048
     total-sent="9796",total-size="9880"}
2049
     ^done,address="0x10004",load-size="9880",transfer-rate="6586",
2050
     write-rate="429"
2051
     (gdb)
2052
 
2053
The `-target-exec-status' Command
2054
---------------------------------
2055
 
2056
Synopsis
2057
........
2058
 
2059
      -target-exec-status
2060
 
2061
   Provide information on the state of the target (whether it is
2062
running or not, for instance).
2063
 
2064
GDB Command
2065
...........
2066
 
2067
   There's no equivalent GDB command.
2068
 
2069
Example
2070
.......
2071
 
2072
   N.A.
2073
 
2074
The `-target-list-available-targets' Command
2075
--------------------------------------------
2076
 
2077
Synopsis
2078
........
2079
 
2080
      -target-list-available-targets
2081
 
2082
   List the possible targets to connect to.
2083
 
2084
GDB Command
2085
...........
2086
 
2087
   The corresponding GDB command is `help target'.
2088
 
2089
Example
2090
.......
2091
 
2092
   N.A.
2093
 
2094
The `-target-list-current-targets' Command
2095
------------------------------------------
2096
 
2097
Synopsis
2098
........
2099
 
2100
      -target-list-current-targets
2101
 
2102
   Describe the current target.
2103
 
2104
GDB Command
2105
...........
2106
 
2107
   The corresponding information is printed by `info file' (among other
2108
things).
2109
 
2110
Example
2111
.......
2112
 
2113
   N.A.
2114
 
2115
The `-target-list-parameters' Command
2116
-------------------------------------
2117
 
2118
Synopsis
2119
........
2120
 
2121
      -target-list-parameters
2122
 
2123
GDB Command
2124
...........
2125
 
2126
   No equivalent.
2127
 
2128
Example
2129
.......
2130
 
2131
   N.A.
2132
 
2133
The `-target-select' Command
2134
----------------------------
2135
 
2136
Synopsis
2137
........
2138
 
2139
      -target-select TYPE PARAMETERS ...
2140
 
2141
   Connect GDB to the remote target.  This command takes two args:
2142
 
2143
`TYPE'
2144
     The type of target, for instance `async', `remote', etc.
2145
 
2146
`PARAMETERS'
2147
     Device names, host names and the like.  *Note Commands for
2148
     managing targets: Target Commands, for more details.
2149
 
2150
   The output is a connection notification, followed by the address at
2151
which the target program is, in the following form:
2152
 
2153
     ^connected,addr="ADDRESS",func="FUNCTION NAME",
2154
       args=[ARG LIST]
2155
 
2156
GDB Command
2157
...........
2158
 
2159
   The corresponding GDB command is `target'.
2160
 
2161
Example
2162
.......
2163
 
2164
     (gdb)
2165
     -target-select async /dev/ttya
2166
     ^connected,addr="0xfe00a300",func="??",args=[]
2167
     (gdb)
2168
 

powered by: WebSVN 2.1.0

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