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

Subversion Repositories or1k

[/] [or1k/] [trunk/] [insight/] [gdb/] [doc/] [gdb.info-11] - Blame information for rev 1767

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

Line No. Rev Author Line
1 578 markom
This is ./gdb.info, produced by makeinfo version 4.0 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, April 2001, of `Debugging with GDB: the
11
GNU Source-Level Debugger' for GDB Version 20010707.
12
 
13
   Copyright (C)
14
1988,1989,1990,1991,1992,1993,1994,1995,1996,1998,1999,2000,2001
15
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 "A Sample GDB Session" and "Free Software",
21
with the Front-Cover texts being "A GNU Manual," and with the
22
Back-Cover Texts as in (a) below.
23
 
24
   (a) The FSF's Back-Cover Text is: "You have freedom to copy and
25
modify this GNU Manual, like GNU software.  Copies published by the Free
26
Software Foundation raise funds for GNU development."
27
 
28

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

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

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

1778
File: gdb.info,  Node: GDB/MI Miscellaneous Commands,  Next: GDB/MI Stack Manipulation,  Prev: GDB/MI Program Control,  Up: GDB/MI
1779
 
1780
Miscellaneous GDB commands in GDB/MI
1781
====================================
1782
 
1783
The `-gdb-exit' Command
1784
-----------------------
1785
 
1786
Synopsis
1787
........
1788
 
1789
      -gdb-exit
1790
 
1791
   Exit GDB immediately.
1792
 
1793
GDB Command
1794
...........
1795
 
1796
   Approximately corresponds to `quit'.
1797
 
1798
Example
1799
.......
1800
 
1801
     (gdb)
1802
     -gdb-exit
1803
 
1804
The `-gdb-set' Command
1805
----------------------
1806
 
1807
Synopsis
1808
........
1809
 
1810
      -gdb-set
1811
 
1812
   Set an internal GDB variable.
1813
 
1814
GDB Command
1815
...........
1816
 
1817
   The corresponding GDB command is `set'.
1818
 
1819
Example
1820
.......
1821
 
1822
     (gdb)
1823
     -gdb-set $foo=3
1824
     ^done
1825
     (gdb)
1826
 
1827
The `-gdb-show' Command
1828
-----------------------
1829
 
1830
Synopsis
1831
........
1832
 
1833
      -gdb-show
1834
 
1835
   Show the current value of a GDB variable.
1836
 
1837
GDB command
1838
...........
1839
 
1840
   The corresponding GDB command is `show'.
1841
 
1842
Example
1843
.......
1844
 
1845
     (gdb)
1846
     -gdb-show annotate
1847
     ^done,value="0"
1848
     (gdb)
1849
 
1850
The `-gdb-version' Command
1851
--------------------------
1852
 
1853
Synopsis
1854
........
1855
 
1856
      -gdb-version
1857
 
1858
   Show version information for GDB.  Used mostly in testing.
1859
 
1860
GDB Command
1861
...........
1862
 
1863
   There's no equivalent GDB command.  GDB by default shows this
1864
information when you start an interactive session.
1865
 
1866
Example
1867
.......
1868
 
1869
     (gdb)
1870
     -gdb-version
1871
     ~GNU gdb 5.2.1
1872
     ~Copyright 2000 Free Software Foundation, Inc.
1873
     ~GDB is free software, covered by the GNU General Public License, and
1874
     ~you are welcome to change it and/or distribute copies of it under
1875
     ~ certain conditions.
1876
     ~Type "show copying" to see the conditions.
1877
     ~There is absolutely no warranty for GDB.  Type "show warranty" for
1878
     ~ details.
1879
     ~This GDB was configured as
1880
      "--host=sparc-sun-solaris2.5.1 --target=ppc-eabi".
1881
     ^done
1882
     (gdb)
1883
 

powered by: WebSVN 2.1.0

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