1 \input texinfo @c -*-texinfo-*-
3 @setfilename gdbmi.info
4 @settitle GDB/MI Machine Interface
9 This file documents GDB/MI, a Machine Interface to GDB.
11 Copyright (C) 2000, Free Software Foundation, Inc.
12 Contributed by Cygnus Solutions.
14 Permission is granted to make and distribute verbatim copies of this
15 manual provided the copyright notice and this permission notice are
16 preserved on all copies.
19 Permission is granted to process this file through TeX and print the
20 results, provided the printed document carries copying permission notice
21 identical to this one except for the removal of this paragraph (this
22 paragraph not being relevant to the printed manual).
25 Permission is granted to copy and distribute modified versions of this
26 manual under the conditions for verbatim copying, provided also that the
27 entire resulting derived work is distributed under the terms of a
28 permission notice identical to this one.
30 Permission is granted to copy and distribute translations of this manual
31 into another language, under the above conditions for modified versions.
34 @c This title page illustrates only one of the
35 @c two methods of forming a title page.
41 @author Andrew Cagney, Fernando Nasser and Elena Zannoni
43 @c The following two commands
44 @c start the copyright page.
46 @vskip 0pt plus 1filll
47 Permission is granted to make and distribute verbatim copies of this
48 manual provided the copyright notice and this permission notice are
49 preserved on all copies.
51 Copyright @copyright{} 2000, Free Software Foundation, Inc.
54 @c %%%%%%%%%%%%%%%%%%%%%%%%%%%% CHAPTER %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
57 @heading Function and Purpose
59 GDB/MI is a line based machine oriented text interface to GDB. It is
60 specifically intended to support the development of systems which use
61 the debugger as just one small component of a larger system.
63 @heading This Document
65 This document is a specification of the GDB/MI interface. It is written
66 in the form of a reference manual.
72 @heading Acknowledgments
74 In alphabetic order: Fernando Nasser, Stan Shebs and Elena Zannoni.
76 @c %%%%%%%%%%%%%%%%%%%%%%%%%%%% CHAPTER %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
77 @chapter Command Syntax
83 @item <command> @expansion{}
84 <cli-command> | <mi-command>
86 @item <cli-command> @expansion{}
87 [ <token> ] "any existing GDB CLI command" <nl>
89 @item <mi-command> @expansion{}
90 [ <token> ] ``-'' <operation> ( `` '' <option> )* [ `` --'' ] ( `` '' <parameter> )* <nl>
92 @item <token> @expansion{}
93 ``any sequence of digits''
95 @item <option> @expansion{}
96 ``-'' <parameter> [ `` '' <parameter> ]
98 @item <parameter> @expansion{}
99 <non-blank-sequence> | <c-string>
101 @item <operation> @expansion{}
102 any of the operations described in this document.
104 @item <non-blank-sequence> @expansion{}
105 anything provided it doesn't contain special characters such as ``-''
106 <nl>, ``"'' and of course `` ''.
108 @item <c-string> @expansion{}
109 ``"'' <seven-bit-iso-c-string-content> ``"''
111 @item <nl> @expansion{}
121 The CLI commands are still handled by the MI interpreter; their output
125 The @code{<token>}, when present, is passed back when the command
129 Some mi commands accept optional arguments as part of the parameter
130 list. Each option is identified by a leading @code{-} (dash) and may be
131 followed by an option argument parameter. Options occure first in the
132 parameter list and can be delimiated from normal parameters using
142 We want easy access to the existing CLI syntax (for debugging).
145 We want it easy to spot a MI operation
149 @section Output Syntax
151 The output from GDB/MI consists of zero or more out-of-band records
152 followed, optionally, by a single result record. The result record
153 being for the most recent command. The sequence of output records is
154 terminated by ``(gdb)''.
156 If an input command was prefixed with a @code{<token>} then the
157 corresponding output for that command will also be prefixed by that same
161 @item <output> @expansion{}
162 ( <out-of-band-record> )* [ <result-record> ] ``(gdb)'' <nl>
164 @item <result-record> @expansion{}
165 [ <token> ] ``^'' <result-class> ( ``,'' <result> )* <nl>
167 @item <out-of-band-record> @expansion{}
168 <async-record> | <stream-record>
170 @item <async-record> @expansion{}
171 <exec-async-output> | <status-async-output> | <notify-async-output>
173 @item <exec-async-output> @expansion{}
174 [ <token> ] ``*'' <async-output>
176 @item <status-async-output> @expansion{}
177 [ <token> ] ``+'' <async-output>
179 @item <notify-async-output> @expansion{}
180 [ <token> ] ``='' <async-output>
182 @item <async-output> @expansion{}
183 <async-class> ( ``,'' <result> )* <nl>
185 @item <result-class> @expansion{}
186 ``done'' | ``running'' | ``connected'' | ``error'' | ``exit''
188 @item <async-class> @expansion{}
189 ``stopped'' | others (depending on needs, still in development)
191 @item <result> @expansion{}
192 [ <string> ``='' ] <value>
194 @item <value> @expansion{}
195 <const> | ``@{'' <result> ( ``,'' <result> )* ``@}''
197 @item <const> @expansion{}
200 @item <stream-record> @expansion{}
201 <console-stream-output> | <target-stream-output> | <log-stream-output>
203 @item <console-stream-output> @expansion{}
206 @item <target-stream-output> @expansion{}
209 @item <log-stream-output> @expansion{}
212 @item <nl> @expansion{}
215 @item <token> @expansion{}
216 ``any sequence of digits''
220 In addition, the following are still being developed.
225 This action is currently undefined.
234 All output sequences end in a single line containing a period.
237 The @code{<token>} is from the corresponding request. If an execution
238 command is interrupted by the -exec-interrupt command, the token
239 associated with the `*stopped' message is the one of the original
240 execution command, not the one of the interrupt-command.
243 <status-async-output> contains on-going status information about the progress
244 of a slow operation. It can be discarded. All status output is prefixed by
248 <exec-async-output> contains asynchronous state change on the target
249 (stopped, started, disappeared). All async output is prefixed by
253 <notify-async-output> contains supplementary information that the client should
254 handle (new breakpoint information). All notify output is prefixed by
258 <console-stream-output> is output that should be displayed as is in the
259 console. It is the textual response to a CLI command. All the console
260 output is prefixed by the prefix ``~''.
263 <target-stream-output> is the output produced by the target program.
264 All the target output is prefixed by the prefix ``@@''.
267 <log-stream-output> is output text coming from GDB's internals, for
268 instance messages that should be displayed as part of an error log. All
269 the log output is prefixed by the prefix ``&''.
273 @section Simple Examples
275 @subheading Target stop:
285 <- *stop,reason="stop",address="0x123",source="a.c:123"
290 @subheading Simple CLI command being passed through the MI and on to the CLI.
299 @subheading Command with side effects:
302 -> -symbol-file xyz.exe
303 <- *breakpoint,nr="3",address="0x123",source="a.c:123"
308 @subheading A bad command:
312 <- error,"Rubbish not found"
316 @c %%%%%%%%%%%%%%%%%%%%%%%%%%%% CHAPTER %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
317 @chapter CLI compatibility
319 To help users familiar with the GDB's existing CLI interface, the GDB/MI
320 will accept existing CLI commands. As specified by the syntax, such
321 commands can be directly entered into the MI interface and GDB will
324 The mechanism is provided as an aid to developers of MI clients and not
325 as a reliable interface into the CLI. Since the command is being
326 interpreteted in an environment that assumes MI behaviour the exact
327 output of such commands is likely to end up being an un-supported hybrid
328 of MI and CLI output.
331 @c %%%%%%%%%%%%%%%%%%%%%%%%%%%% CHAPTER %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
332 @chapter Output Records
334 @section Result Records
336 In addition to a number of out-of-band notifications the response to an
337 MI command includes one of the following result indications.
341 @item ``^done'' [ ``,'' <results> ]
342 The synchronous operation was successful, @code{<results>} is the return
346 The asynchronous operation was successfully started. The target is
347 running. @emph{Is this one correct should it be an out-of-band
350 @item ``^error'' ``,'' <c-string>
351 The operation failed. The @code{<c-string>} contains the corresponding
356 @section Stream Records
358 GDB internally maintains a number of output streams: the console, the
359 target, and the log. The output intended for each of these streams is
360 tunneled through the MI interface using stream records.
362 In addition to the prefix each stream record contains a
363 @code{<string-output>}. This is either raw text (with an implicit new
364 line) or a quoted C string (which does not contain an implicit newline).
368 @item ``~'' <string-output>
369 The console output stream contains text that should be displayed in the
370 CLI console window. It contains the textual responses to CLI commands.
372 @item ``@@'' <string-output>
373 The target output stream contains any textual output from the running
376 @item ``&'' <string-output>
377 The LOG stream contains debugging messages being produced by GDB's
382 @section Out-of-band Records.
384 Out-of-band records are used to notify the MI client of additional
385 changes that have occurred. Those changes can either be a consequence of
386 an MI (breakpoint modified) or as a result of target activity (target
389 The following is a preliminary list of possible out-of-band records.
398 @c %%%%%%%%%%%%%%%%%%%%%%%%%%%% CHAPTER %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
399 @chapter Command Description Format
401 The remaining chapters describe blocks of commands. Each block of
402 commands is laid out in a fashion similar to this chapter.
404 Note the the line breaks shown in the examples are here only for
405 readability. They don't appear in the real output.
406 Note that the commands with a non available example (N.A.) are not yet
411 What motivates the collection of commands
413 @section Introduction
415 Brief introduction to the commands as a whole.
419 @subsection -command <args>...
421 @subsubsection Result
423 @subsubsection Out-of-band
427 @subsubsection Example
430 @c %%%%%%%%%%%%%%%%%%%%%%%%%%%% CHAPTER %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
431 @chapter Breakpoint table commands
433 @section -break-after <number> <count>
434 The breakpoint number <number> is not in effect until it has been hit <count> times.
435 Note how this is reflected in the output of the -break-list command.
437 @subsection GDB command
444 ^done,bkpt=@{number="1",addr="0x000100d0",file="hello.c",line="5"@}
451 ^done,BreakpointTable=@{hdr=@{"Num","Type","Disp","Enb","Address","What"@},
452 bkpt=@{number="1",type="breakpoint",disp="keep",enabled="y",
453 addr="0x000100d0",func="main",file="hello.c",line="5",times="0",ignore="3"@}@}
457 @c @section -break-catch
459 @c @section -break-commands
461 @section -break-condition <number> <expr>
462 Breakpoint <number> will stop the program only if the condition in <expr> is true.
463 The condition becomes part of the -break-list output.
464 @subsection GDB command
473 ^done,BreakpointTable=@{hdr=@{"Num","Type","Disp","Enb","Address","What"@},
474 bkpt=@{number="1",type="breakpoint",disp="keep",enabled="y",
475 addr="0x000100d0",func="main",file="hello.c",line="5",cond="1",times="0",ignore="3"@}@}
479 @section -break-delete @{ <breakpoint> @}+
480 Delete the breakpoint(s) specified in the argument list. This is
481 obviously reflected in the breakpoint list.
482 @subsection GDB command
491 ^done,BreakpointTable=@{@}
495 @section -break-disable @{ <breakpoint> @}+
496 Disable the breakpoint(s). Note how the field 'enabled' in the break
497 list is now set to 'n'.
498 @subsection GDB command
507 ^done,BreakpointTable=@{hdr=@{"Num","Type","Disp","Enb","Address","What"@},
508 bkpt=@{number="2",type="breakpoint",disp="keep",enabled="n",
509 addr="0x000100d0",func="main",file="hello.c",line="5",times="0"@}@}
513 @section -break-enable @{ <breakpoint> @}+
514 Enable a previously disabled breakpoint(s).
515 @subsection GDB command
524 ^done,BreakpointTable=@{hdr=@{"Num","Type","Disp","Enb","Address","What"@},
525 bkpt=@{number="2",type="breakpoint",disp="keep",enabled="y",
526 addr="0x000100d0",func="main",file="hello.c",line="5",times="0"@}@}
530 @section -break-info <breakpoint>
531 REDUNDANT??? Get information about a single breakpoint.
532 @subsection GDB command
536 @section -break-insert [ "-t" ] [ "-h" ] [ "-r" ] [ "-c" <condition> ] [ "-i" <ignore-count> ] [ "-p" <thread> ] [ <line> | <addr> ]
538 <line>, if specified, accordingly to the gdb manual can be one of:
544 @item filename:linenum
545 @item filename:function
549 The possible forms of this command are:
553 Insert a tempoary breakpoint.
555 Insert a hardware breakpoint.
557 Make the breakpoint conditional on <condition>
558 @item -i <ignore-count>
559 Initialize the <ignore-count>
561 Insert a regular breakpoint in all the functions whose names match the
562 given regular expression. Other flags are not applicable to regular
567 The result is in the form:
569 ^done,bkptno="<gdb number for this breakpoint>",func="<name of the
570 function where the breakpoint was inserted>",file="<source file which
571 contains this function>",line="<source line number within the file>"
573 Note: this is open to change. An out-of-band breakpoint instead of part
575 @subsection GDB command
576 break, tbreak, hbreak, thbreak, rbreak.
581 ^done,bkpt=@{number="1",addr="0x0001072c",file="recursive2.c",line="4"@}
584 ^done,bkpt=@{number="2",addr="0x00010774",file="recursive2.c",line="11"@}
587 ^done,BreakpointTable=@{hdr=@{"Num","Type","Disp","Enb","Address","What"@},
588 bkpt=@{number="1",type="breakpoint",disp="keep",enabled="y",addr="0x0001072c",
589 func="main",file="recursive2.c",line="4",times="0"@},
590 bkpt=@{number="2",type="breakpoint",disp="del",enabled="y",addr="0x00010774",
591 func="foo",file="recursive2.c",line="11",times="0"@}@}
593 -break-insert -r foo.*
595 ^done,bkpt=@{number="3",addr="0x00010774",file="recursive2.c",line="11"@}
600 Displays the list of inserted breakpoints, showing the following fields:
603 Number of the breakpoint
605 Type of the breakpoint: breakpoint or watchpoint
607 Should the breakpoint be deleted or disabled when it is hit: keep or nokeep
609 Is the breakpoint enabled or no: y or n
611 Memory location at which the breakpoint is set.
613 Logical location of the breakpoint, expressed by function name, file name, line number.
615 Number of times the breakpoint has been hit.
618 If there are no breakpoints or watchpoints, the BreakpointTable field is
620 @subsection GDB command
623 @subsection Example 1
627 ^done,BreakpointTable=@{hdr=@{"Num","Type","Disp","Enb","Address","What"@},
628 bkpt=@{number="1",type="breakpoint",disp="keep",enabled="y",
629 addr="0x000100d0",func="main",file="hello.c",line="5",times="0"@},
630 bkpt=@{number="2",type="breakpoint",disp="keep",enabled="y",
631 addr="0x00010114",func="foo",file="hello.c",line="13",times="0"@}@}
634 @subsection Example 2
638 ^done,BreakpointTable=@{@}
642 @section -break-watch [ "-a" | "-r" ]
643 Create a watchpoint. With the ``-a'' option it will create an access
644 watchpoint, i.e. a watchpoints that triggers either on a read or on a
645 write on the memory location. With the ``-r'' option, the watchoint
646 created is a read watchpoint, i.e. it will trigger only when the memory
647 location os accessed for reading. Without either of the options, the
648 watchpoint created is a regular watchpoint, i.e. it will trigger whe the
649 memory location is accessed for writing.
651 Note that ``-break-list'' will report a single list of watchpoints and
652 breakpoints inserted.
654 @subsection GDB command
655 watch, awatch, rwatch
657 @subsection Example 1
658 Watchpoint on a variable in main().
662 ^done,wpt=@{number="2",exp="x"@}
666 ^done,reason="watchpoint-trigger",wpt=@{number="2",exp="x"@},
667 value=@{old="-268439212",new="55"@},
668 frame=@{func="main",args=@{@},file="recursive2.c",line="5"@}
671 @subsection Example 2
672 Watchpoint on a variable local to a function. Gdb will stop the program execution
673 twice: first for the variable changing value, then for the watchpoint going out of scope.
677 ^done,wpt=@{number="5",exp="C"@}
681 ^done,reason="watchpoint-trigger",
682 wpt=@{number="5",exp="C"@},value=@{old="-276895068",new="3"@},
683 frame=@{func="callee4",args=@{@},file="../../../devo/gdb/testsuite/gdb.mi/basics.c",
688 ^done,reason="watchpoint-scope",wpnum="5",
689 frame=@{func="callee3",args=@{@{name="strarg",value="0x11940 \"A string argument.\""@}@},
690 file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="18"@}
694 @subsection Example 3
695 Listing breakpoints and watchpoints, at different points in the program execution.
696 Note that once the watchpoint goes out of scope, it is deleted.
700 ^done,wpt=@{number="2",exp="C"@}
703 ^done,BreakpointTable=@{hdr=@{"Num","Type","Disp","Enb","Address","What"@},
704 bkpt=@{number="1",type="breakpoint",disp="keep",enabled="y",addr="0x00010734",
706 file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="8",times="1"@},
707 bkpt=@{number="2",type="watchpoint",disp="keep",
708 enabled="y",addr="",what="C",times="0"@}@}
712 ^done,reason="watchpoint-trigger",wpt=@{number="2",exp="C"@},
713 value=@{old="-276895068",new="3"@},
714 frame=@{func="callee4",args=@{@},
715 file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="13"@}
718 ^done,BreakpointTable=@{hdr=@{"Num","Type","Disp","Enb","Address","What"@},
719 bkpt=@{number="1",type="breakpoint",disp="keep",enabled="y",addr="0x00010734",
721 file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="8",times="1"@},
722 bkpt=@{number="2",type="watchpoint",disp="keep",
723 enabled="y",addr="",what="C",times="-5"@}@}
727 ^done,reason="watchpoint-scope",wpnum="2",
728 frame=@{func="callee3",args=@{@{name="strarg",value="0x11940 \"A string argument.\""@}@},
729 file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="18"@}
732 ^done,BreakpointTable=@{hdr=@{"Num","Type","Disp","Enb","Address","What"@},
733 bkpt=@{number="1",type="breakpoint",disp="keep",enabled="y",addr="0x00010734",
735 file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="8",times="1"@}@}
738 @c %%%%%%%%%%%%%%%%%%%%%%%%%%%% CHAPTER %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
739 @chapter Data manipulation
741 @c REMOVED FROM THE ITNERFACE.
742 @c @section -data-assign
743 @c Change the value of a program variable. Plenty of side effects.
744 @c @subsection GDB command
746 @c @subsection Example
749 @section -data-disassemble ( -s <start-addr> -e <end-addr> ) | (-f <filename> -l <linenum> [-n <lines> ]] -- <mode>
753 Is the beginning address (or $pc).
757 Name of the file to disassemble.
759 Line number to disassemble around.
760 @item <number-of-lines>
761 specifies the number of disassembly lines to be produced. If it is -1
762 the whole function will be disassembled, in case no <end> address is
763 specified. If <end> is specified as a non-zero value, and
764 <number-of-lines> is lower that the number of disassembly lines between
765 <begin> and <end>, we'll display only <number-of-lines> lines, vice
766 versa if <number-of-lines> is higher than the number of lines between
767 <begin> and <end>, we'll display only the lines up to <end>.
769 can be 0 (only disassembly) or 1 (mixed source and disassembly).
772 The output for each instruction is composed of two fields:
779 Note that whatever included in the instruction field, is not manipulated
780 directely by Flathead, i.e. it is not possible to adjust its format.
781 @subsection GDB command
782 N.A. No direct mapping.
784 @subsection Example 1
785 Disassemble from the current PC value to PC + 20.
789 -data-disassemble -s $pc -e "$pc + 20" -- 0
792 {address="0x000107c0",func-name="main",offset="4",
794 {address="0x000107c4",func-name="main",offset="8",
795 inst="sethi %hi(0x11800), %o2"},
796 {address="0x000107c8",func-name="main",offset="12",
797 inst="or %o2, 0x140, %o1\t! 0x11940 <_lib_version+8>"},
798 {address="0x000107cc",func-name="main",offset="16",
799 inst="sethi %hi(0x11800), %o2"},
800 {address="0x000107d0",func-name="main",offset="20",
801 inst="or %o2, 0x168, %o4\t! 0x11968 <_lib_version+48>"}}
805 @subsection Example 2
806 Disassemble the whole function main. Line 32 is part of main.
808 -data-disassemble -f basics.c -l 32 -- 0
810 {address="0x000107bc",func-name="main",offset="0",inst="save %sp, -112, %sp"},
811 {address="0x000107c0",func-name="main",offset="4",inst="mov 2, %o0"},
812 {address="0x000107c4",func-name="main",offset="8",inst="sethi %hi(0x11800), %o2"},
814 {address="0x0001081c",func-name="main",offset="96",inst="ret "},
815 {address="0x00010820",func-name="main",offset="100",inst="restore "}}
819 @subsection Example 3
820 Disassemble 3 instruction from the start of main.
823 -data-disassemble -f basics.c -l 32 -n 3 -- 0
825 {address="0x000107bc",func-name="main",offset="0",inst="save %sp, -112, %sp"},
826 {address="0x000107c0",func-name="main",offset="4",inst="mov 2, %o0"},
827 {address="0x000107c4",func-name="main",offset="8",inst="sethi %hi(0x11800), %o2"}}
831 @subsection Example 4
832 Disassemble 3 instruction from the start of main in mixed mode.
835 -data-disassemble -f basics.c -l 32 -n 3 -- 1
837 src_and_asm_line={line="31",
838 file="/kwikemart/marge/ezannoni/flathead-dev/devo/gdb/testsuite/gdb.mi/basics.c",
840 {address="0x000107bc",func-name="main",offset="0",inst="save %sp, -112, %sp"}}},
842 src_and_asm_line={line="32",
843 file="/kwikemart/marge/ezannoni/flathead-dev/devo/gdb/testsuite/gdb.mi/basics.c",
845 {address="0x000107c0",func-name="main",offset="4",inst="mov 2, %o0"},
846 {address="0x000107c4",func-name="main",offset="8",inst="sethi %hi(0x11800), %o2"}}}}
850 @section -data-evaluate-expression
851 Evaluate an expression. The expression could contain an inferior
852 function call. The function call will execute synchronously.
853 If the expression contains spaces, it must be enclosed in double quotes.
854 @subsection GDB command
855 print, output, gdb_eval
858 211-data-evaluate-expression A
861 311-data-evaluate-expression &A
862 311^done,value="0xefffeb7c"
864 411-data-evaluate-expression A+3
867 511-data-evaluate-expression "A + 3"
872 @section -data-list-changed-registers
873 Display a list of the registers that have changed.
874 @subsection GDB command
875 gdb_changed_register_list. This is in gdbtk only.
884 *stopped,reason="breakpoint-hit",bkptno="1",frame=@{func="main",
885 args=@{@},file="try.c",line="5"@}
887 -data-list-changed-registers
888 ^done,changed-registers=@{"0","1","2","4","5","6","7","8","9",
889 "10","11","13","14","15","16","17","18","19","20","21","22","23",
890 "24","25","26","27","28","30","31","64","65","66","67","69"@}
894 @section -data-list-register-names
895 Show a list of register names for the current target. If no arguments
896 are given, it shows a list of the names of all the registers. If
897 integer numbers are given as arguments, it will print a list of the
898 names corresponding to the arguments.
899 @subsection GDB command
902 For the PPC MBX board:
905 -data-list-register-names
906 ^done,register-names=@{"r0","r1","r2","r3","r4","r5","r6","r7",
907 "r8","r9","r10","r11","r12","r13","r14","r15","r16","r17","r18",
908 "r19","r20","r21","r22","r23","r24","r25","r26","r27","r28","r29",
909 "r30","r31","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9",
910 "f10","f11","f12","f13","f14","f15","f16","f17","f18","f19","f20",
911 "f21","f22","f23","f24","f25","f26","f27","f28","f29","f30","f31",
912 "pc","ps","cr","lr","ctr","xer"@}
914 -data-list-register-names 1 2 3
915 ^done,register-names=@{"r1","r2","r3"@}
919 @section -data-list-register-values
920 Display the registers contents. Arguments are the format according to
921 which the registers contents are to be returned, and a list of numbers
922 specifying the registers to display. A missing list of number indicates
923 that the contents of all the registers must be returned.
926 @item 'x': Hexadecimal
934 @subsection GDB command
935 info reg, info all-reg AND/OR gdb_fetch_registers
937 For a PPC MBX board. Note, line breaks are for readability only, they
938 don't appear in the actual output.
941 -data-list-register-values r 64 65
942 ^done,register-values=@{@{number="64",value="0xfe00a300"@},
943 @{number="65",value="0x00029002"@}@}
945 -data-list-register-values x
946 ^done,register-values=@{@{number="0",value="0xfe0043c8"@},
947 @{number="1",value="0x3fff88"@},@{number="2",value="0xfffffffe"@},
948 @{number="3",value="0x0"@},@{number="4",value="0xa"@},
949 @{number="5",value="0x3fff68"@},@{number="6",value="0x3fff58"@},
950 @{number="7",value="0xfe011e98"@},@{number="8",value="0x2"@},
951 @{number="9",value="0xfa202820"@},@{number="10",value="0xfa202808"@},
952 @{number="11",value="0x1"@},@{number="12",value="0x0"@},
953 @{number="13",value="0x4544"@},@{number="14",value="0xffdfffff"@},
954 @{number="15",value="0xffffffff"@},@{number="16",value="0xfffffeff"@},
955 @{number="17",value="0xefffffed"@},@{number="18",value="0xfffffffe"@},
956 @{number="19",value="0xffffffff"@},@{number="20",value="0xffffffff"@},
957 @{number="21",value="0xffffffff"@},@{number="22",value="0xfffffff7"@},
958 @{number="23",value="0xffffffff"@},@{number="24",value="0xffffffff"@},
959 @{number="25",value="0xffffffff"@},@{number="26",value="0xfffffffb"@},
960 @{number="27",value="0xffffffff"@},@{number="28",value="0xf7bfffff"@},
961 @{number="29",value="0x0"@},@{number="30",value="0xfe010000"@},
962 @{number="31",value="0x0"@},@{number="32",value="0x0"@},
963 @{number="33",value="0x0"@},@{number="34",value="0x0"@},
964 @{number="35",value="0x0"@},@{number="36",value="0x0"@},
965 @{number="37",value="0x0"@},@{number="38",value="0x0"@},
966 @{number="39",value="0x0"@},@{number="40",value="0x0"@},
967 @{number="41",value="0x0"@},@{number="42",value="0x0"@},
968 @{number="43",value="0x0"@},@{number="44",value="0x0"@},
969 @{number="45",value="0x0"@},@{number="46",value="0x0"@},
970 @{number="47",value="0x0"@},@{number="48",value="0x0"@},
971 @{number="49",value="0x0"@},@{number="50",value="0x0"@},
972 @{number="51",value="0x0"@},@{number="52",value="0x0"@},
973 @{number="53",value="0x0"@},@{number="54",value="0x0"@},
974 @{number="55",value="0x0"@},@{number="56",value="0x0"@},
975 @{number="57",value="0x0"@},@{number="58",value="0x0"@},
976 @{number="59",value="0x0"@},@{number="60",value="0x0"@},
977 @{number="61",value="0x0"@},@{number="62",value="0x0"@},
978 @{number="63",value="0x0"@},@{number="64",value="0xfe00a300"@},
979 @{number="65",value="0x29002"@},@{number="66",value="0x202f04b5"@},
980 @{number="67",value="0xfe0043b0"@},@{number="68",value="0xfe00b3e4"@},
981 @{number="69",value="0x20002b03"@}@}
985 @section -data-read-memory [ -o <byte-offset> ] [ -- ] <address> <word-format> <word-size> <nr-rows> <nr-cols> [ <aschar> ]
989 An expression specifying the address of the first memory word to be
990 read. Complex expressions containing embedded white space should be
991 quoted using the C convention.
993 The format to be used to print the memory words. The notation is the
994 same as for GDB's @code{print} command.
996 The size of each memory word in bytes.
998 The number of rows in the output table.
1000 The number of columns in the output table.
1002 If present, indicates that each row should include an ascii dump. The
1003 value of <aschar> is used as a padding character when a byte is not a
1004 member of the printable ascii character set (@code{<32} or @code{>126}).
1006 An offset to add to the <address> before fetching memory.
1008 Display memory contents as a table of <nr-rows> by <nr-cols> words.
1009 Each word being <word-size> bytes. In total @code{<nr-rows> * <nr-cols>
1010 * <word-size>} bytes are read (returned as @code{total-bytes}. Should
1011 less then the requested number of bytes be returned by the target, the
1012 missing words are identified using @code{N/A}. The number of bytes read
1013 from the target is returned in @code{nr-bytes} and the starting address
1014 used to read memory by @code{addr}.
1016 The address of the next/previous page or row is available in
1017 @code{next-row} and @code{prev-row}, @code{next-page} and
1019 @subsection GDB command
1020 x AND/OR gdb_get_mem AND/OR GDBtk's memory read.
1021 @subsection Example 1
1022 Read six bytes of memory starting at @code{bytes+6} but then offset by
1023 @code{-6} bytes. Format as three rows of two columns. One byte per
1024 word. Display each word in hex.
1027 9-data-read-memory -o -6 -- bytes+6 x 1 3 2
1028 9^done,addr="0x00001390",nr-bytes="6",total-bytes="6",
1029 next-row="0x00001396",prev-row="0x0000138e",next-page="0x00001396",
1030 prev-page="0x0000138a",memory=@{
1031 @{addr="0x00001390",data=@{"0x00","0x01"@}@},
1032 @{addr="0x00001392",data=@{"0x02","0x03"@}@},
1033 @{addr="0x00001394",data=@{"0x04","0x05"@}@}@}
1036 @subsection Example 2
1037 Read two bytes of memory starting at address @code{shorts + 64} and
1038 display as a single word formatted in decimal.
1041 5-data-read-memory shorts+64 d 2 1 1
1042 5^done,addr="0x00001510",nr-bytes="2",total-bytes="2",
1043 next-row="0x00001512",prev-row="0x0000150e",
1044 next-page="0x00001512",prev-page="0x0000150e",memory=@{
1045 @{addr="0x00001510",data=@{"128"@}@}@}
1048 @subsection Example 3
1049 Read thirty two bytes of memory starting at @code{bytes+16} and format
1050 as eight rows of four columns. Include a string encoding with @code{x}
1051 used as the non-printable character.
1054 4-data-read-memory bytes+16 x 1 8 4 x
1055 4^done,addr="0x000013a0",nr-bytes="32",total-bytes="32",
1056 next-row="0x000013c0",prev-row="0x0000139c",
1057 next-page="0x000013c0",prev-page="0x00001380",memory=@{
1058 @{addr="0x000013a0",data=@{"0x10","0x11","0x12","0x13"@},ascii="xxxx"@},
1059 @{addr="0x000013a4",data=@{"0x14","0x15","0x16","0x17"@},ascii="xxxx"@},
1060 @{addr="0x000013a8",data=@{"0x18","0x19","0x1a","0x1b"@},ascii="xxxx"@},
1061 @{addr="0x000013ac",data=@{"0x1c","0x1d","0x1e","0x1f"@},ascii="xxxx"@},
1062 @{addr="0x000013b0",data=@{"0x20","0x21","0x22","0x23"@},ascii=" !\"#"@},
1063 @{addr="0x000013b4",data=@{"0x24","0x25","0x26","0x27"@},ascii="$%&'"@},
1064 @{addr="0x000013b8",data=@{"0x28","0x29","0x2a","0x2b"@},ascii="()*+"@},
1065 @{addr="0x000013bc",data=@{"0x2c","0x2d","0x2e","0x2f"@},ascii=",-./"@}@}
1069 @section -display-delete <number>
1070 Delete the display <number>.
1071 @subsection GDB command
1076 @section -display-disable <number>
1077 Disable display <number>
1078 @subsection GDB command
1083 @section -display-enable <number>
1084 Enable display <number>
1085 @subsection GDB command
1090 @section -display-insert <expression>
1091 Display <expression> every time the program stops.
1092 @subsection GDB command
1097 @section -display-list
1098 List the displays. Do not show the current values.
1099 @subsection GDB command
1104 @section -environment-cd <pathdir>
1105 Set GDB's working directory.
1106 @subsection GDB command
1111 -environment-cd /kwikemart/marge/ezannoni/flathead-dev/devo/gdb
1116 @section -environment-directory <pathdir>
1117 Add directory <pathdir> to beginning of search path for source files.
1118 @subsection GDB command
1123 -environment-directory /kwikemart/marge/ezannoni/flathead-dev/devo/gdb
1128 @section -environment-path @{ <pathdir> @}+
1129 Add directories to beginning of search path for object files.
1130 @subsection GDB command
1135 -environment-path /kwikemart/marge/ezannoni/flathead-dev/ppc-eabi/gdb
1140 @section -environment-pwd
1141 Show the current working directory
1142 @subsection GDB command
1148 ~Working directory /kwikemart/marge/ezannoni/flathead-dev/devo/gdb.
1153 @c %%%%%%%%%%%%%%%%%%%%%%%%%%%% CHAPTER %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1154 @chapter Program control
1156 @section Program termination
1157 As a result of execution, the inferior program can run to completion, if
1158 it doesn't encouter any breakpoints. In this case the ouput will
1159 include an exit code, if the program has exited exceptionally.
1160 @subsection Example 1
1161 Program exited normally:
1168 *stopped,reason="exited-normally"
1172 @subsection Example 2
1173 Program exited exceptionally:
1180 *stopped,reason="exited",exit-code="01"
1184 Another way the program can terminate is if it receives a signal like SIGINT.
1186 Program exited with signal (for a more complete example, see the exec-interrupt command).
1189 *stopped,reason="exited-signalled",signal-name="SIGINT",signal-meaning="Interrupt"
1193 @section -exec-abort
1194 Kill the inferior running program.
1196 @subsection GDB command
1202 @section -exec-arguments
1203 Set the inferior program arguments, to be used in the next -exec-run.
1205 @subsection GDB command
1209 Don't have it around.
1211 @section -exec-continue
1212 Asynchronous command. Resumes the execution of the inferior program until
1213 a breakpoint is encountered, or the inferior exits.
1215 @subsection GDB command
1224 *stopped,reason="breakpoint-hit",bkptno="2",frame=@{func="foo",args=@{@},
1225 file="hello.c",line="13"@}
1229 @section -exec-finish
1230 Asynchronous command. Resumes the execution of the inferior program until the
1231 current function is exited. Displays the results returned by the function (???).
1233 @subsection GDB command
1236 @subsection Example 1
1237 Function returning 'void'.
1243 *stopped,reason="function-finished",frame=@{func="main",args=@{@},
1244 file="hello.c",line="7"@}
1247 @subsection Example 2
1248 Function returning other than 'void'. The name of the internal gdb variable storing the
1249 result is printed, and the value itself.
1254 *stopped,reason="function-finished",frame=@{addr="0x000107b0",func="foo",
1255 args=@{@{name="a",value="1"@},@{name="b",value="9"@}@},file="recursive2.c",line="14"@},
1256 gdb-result-var="$1",return-value="0"
1260 @section -exec-interrupt
1261 Asynchronous command. Interrupts the background execution of the target.
1262 Note how the token associated with the stop message is the one for the
1263 execution command that has been interrupted. The token for the interrupt
1264 itself only appears in the '^done' output. If the user is trying to
1265 interrupt a non running program, an error message will be printed.
1266 @subsection GDB command
1279 111*stopped,signal-name="SIGINT",signal-meaning="Interrupt",
1280 frame=@{addr="0x00010140",func="foo",args=@{@},file="try.c",line="13"@}
1285 ^error,msg="mi_cmd_exec_interrupt: Inferior not executing."
1291 Asynchronous command. Resumes execution of the inferior program, stopping
1292 when the beginning of the next source line is reached.
1294 @subsection GDB command
1302 *stopped,reason="end-stepping-range",line="8",file="hello.c"
1306 @section -exec-next-instruction
1307 Asynchronous command. Executes one machine instruction. If the
1308 instruction is a function call continues until the function returns. If
1309 the program stops at an instruction in the middle of a source line, the
1310 address will be printed as well.
1311 @subsection GDB command
1317 -exec-next-instruction
1321 *stopped,reason="end-stepping-range",
1322 addr="0x000100d4",line="5",file="hello.c"
1326 @section -exec-return
1327 Makes current function return immediately. Doesn't execute the inferior.
1328 It displays the new current frame.
1330 @subsection GDB command
1336 200-break-insert callee4
1337 200^done,bkpt=@{number="1",addr="0x00010734",
1338 file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="8"@}
1343 000*stopped,reason="breakpoint-hit",bkptno="1",
1344 frame=@{func="callee4",args=@{@},
1345 file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="8"@}
1351 111^done,frame=@{level="0 ",func="callee3",
1352 args=@{@{name="strarg",value="0x11940 \"A string argument.\""@}@},
1353 file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="18"@}
1358 Asynchronous command. Starts execution of the inferior from the
1359 beginning. The inferior executes until either a breakpoint is
1360 encountered or the program exits.
1362 @subsection GDB command
1369 ^done,bkpt=@{number="1",addr="0x0001072c",file="recursive2.c",line="4"@}
1374 *stopped,reason="breakpoint-hit",bkptno="1",
1375 frame=@{func="main",args=@{@},file="recursive2.c",line="4"@}
1380 @section -exec-show-arguments
1381 Print the arguments of the program.
1382 @subsection GDB command
1387 @c @section -exec-signal
1390 Asynchronous command. Resumes execution of the inferior program, stopping
1391 when the beginning of the next source line is reached, if the next
1392 source line is not a function call. If it is, stop at the first
1393 instruction of the called function.
1395 @subsection GDB command
1398 @subsection Example 1
1399 Stepping into a function:
1404 *stopped,reason="end-stepping-range",frame=@{func="foo",args=@{@{name="a",value="10"@},
1405 @{name="b",value="0"@}@},file="recursive2.c",line="11"@}
1408 @subsection Example 2
1414 *stopped,reason="end-stepping-range",line="14",file="recursive2.c"
1418 @section -exec-step-instruction
1419 Asynchronous command. Resumes the inferior which executes one machine
1420 instruction. The output, once stop, will vary depend on whether we have
1421 stopped in the middle of a source line or not. In the former case, the
1422 address at which the program stopped will be printed as well.
1424 @subsection GDB command
1430 -exec-step-instruction
1434 *stopped,reason="end-stepping-range",
1435 frame=@{func="foo",args=@{@},file="try.c",line="10"@}
1437 -exec-step-instruction
1441 *stopped,reason="end-stepping-range",
1442 frame=@{addr="0x000100f4",func="foo",args=@{@},file="try.c",line="10"@}
1446 @section -exec-until
1447 Asynchronous command. Executes the inferior until the location specified
1448 in the argument is reached. If there is no argument, the inferior
1449 executes until a source line greater than the current one is reached.
1450 The reason for stopping in this case will be ``location-reached''.
1451 @subsection GDB command
1457 -exec-until recursive2.c:6
1461 *stopped,reason="location-reached",frame=@{func="main",args=@{@},
1462 file="recursive2.c",line="6"@}
1466 @section -file-clear
1467 Is this going away????
1469 @section -file-exec-and-symbols <file>
1470 Specify the executable file to be debugged. This file is the one from
1471 which the symbol table is also read. If no file is specified, it clears
1472 the executable and symbol information. If breakpoints are set when
1473 using this command with no arguments, gdb will produce errors. No output
1474 is produced, except a completion notification.
1475 @subsection GDB command
1481 -file-exec-and-symbols /kwikemart/marge/ezannoni/TRUNK/mbx/hello.mbx
1486 @section -file-exec-file <file>
1487 Specify the executable file to be debugged. The symbol table is not read
1488 from this file. If used without argument gdb clears the information
1489 about the executable file. No output is produced, except a completion
1491 @subsection GDB command
1497 -file-exec-file /kwikemart/marge/ezannoni/TRUNK/mbx/hello.mbx
1502 @section -file-list-exec-sections
1503 List the sections of the current executable file.
1504 @subsection GDB command
1505 info file (only part of it), gdb_load_info
1509 @section -file-list-exec-source-files
1510 List the source files for the current executable.
1511 @subsection GDB command
1512 gdb_listfiles (gdbtk).
1516 @section -file-list-shared-libraries
1517 List the shared libraries in the program.
1518 @subsection GDB command
1523 @section -file-list-symbol-files
1525 @subsection GDB command
1526 info file (part of it).
1530 @section -file-symbol-file <file>
1531 Read symbol table info from the file specified as argument. Used
1532 without arguments clears gdb's symbol table info. No output is
1533 produced, except a completion notification.
1534 @subsection GDB command
1540 -file-symbol-file /kwikemart/marge/ezannoni/TRUNK/mbx/hello.mbx
1545 @c %%%%%%%%%%%%%%%%%%%%%%%%%%%% CHAPTER %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1546 @chapter Misc GDB commands
1548 @c @section -gdb-complete
1552 Exit GDB immediately.
1553 @subsection GDB command
1554 Approximately corresponds to 'quit'.
1563 Set an internal GDB variable.
1564 IS THIS A DOLLAR VARIABLE? OR SOMETHING LIKE ANNOTATE ?????
1566 @subsection GDB command
1578 Show the current value of a GDB variable.
1580 @subsection GDB command
1591 @c @section -gdb-source
1593 @section -gdb-version
1594 Show version information for gdb. Used in testing mostly.
1596 @subsection GDB command
1603 ~GNU gdb 4.18.1 HEADLESS
1604 ~Copyright 1998 Free Software Foundation, Inc.
1605 ~GDB is free software, covered by the GNU General Public License, and you are
1606 ~welcome to change it and/or distribute copies of it under certain conditions.
1607 ~Type "show copying" to see the conditions.
1608 ~There is absolutely no warranty for GDB. Type "show warranty" for details.
1609 ~This GDB was configured as "--host=sparc-sun-solaris2.5.1 --target=ppc-eabi".
1614 @c %%%%%%%%%%%%%%%%%%%%%%%%%%%% CHAPTER %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1615 @chapter Kod Commands
1617 The Kod commands are not implemented.
1619 @c @section -kod-info
1621 @c @section -kod-list
1623 @c @section -kod-list-object-types
1625 @c @section -kod-show
1627 @c %%%%%%%%%%%%%%%%%%%%%%%%%%%% CHAPTER %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1628 @chapter Memory Overlay Commands
1630 the memory overlay commands not implemented.
1632 @c @section -overlay-auto
1634 @c @section -overlay-list-mapping-state
1636 @c @section -overlay-list-overlays
1638 @c @section -overlay-map
1640 @c @section -overlay-off
1642 @c @section -overlay-on
1644 @c @section -overlay-unmap
1646 @c %%%%%%%%%%%%%%%%%%%%%%%%%%%% CHAPTER %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1647 @chapter Signal Handling Commands
1649 Signal handling commands are not implemented.
1651 @c @section -signal-handle
1653 @c @section -signal-list-handle-actions
1655 @c @section -signal-list-signal-types
1657 @c %%%%%%%%%%%%%%%%%%%%%%%%%%%% CHAPTER %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1658 @chapter Stack manipulation commands
1660 @section -stack-info-frame
1661 Get info on the current frame.
1662 @subsection GDB command
1663 info frame or frame (w/o args).
1667 @section -stack-info-depth [max-depth]
1668 Return the depth of the stack. If the integer argument <max-depth> is specified, do not
1669 count beyond max-depth frames.
1670 @subsection GDB command
1673 For a stack with frame levels 0 through 11:
1682 -stack-info-depth 12
1685 -stack-info-depth 11
1688 -stack-info-depth 13
1693 @section -stack-list-arguments <show-values> [ <low-frame> <high-frame> ]
1694 Display a list of the arguments for the frames between low-frame and
1695 high-frame (inclusive). If low-frame and high-frame are not provided, it
1696 will list the arguments for the whole stack. The show-values argument
1697 must have a value of 0 or 1. A value of 0 means that only the names of
1698 the arguments are listed, a value of 1 means that both names and values
1699 of the argumetns are printed.
1700 @subsection GDB command
1701 gdb_get_args (partially).
1708 frame=@{level="0 ",addr="0x00010734",func="callee4",
1709 file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="8"@},
1710 frame=@{level="1 ",addr="0x0001076c",func="callee3",
1711 file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="17"@},
1712 frame=@{level="2 ",addr="0x0001078c",func="callee2",
1713 file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="22"@},
1714 frame=@{level="3 ",addr="0x000107b4",func="callee1",
1715 file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="27"@},
1716 frame=@{level="4 ",addr="0x000107e0",func="main",
1717 file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="32"@}@}
1719 -stack-list-arguments 0
1722 frame=@{level="0",args=@{@}@},
1723 frame=@{level="1",args=@{name="strarg"@}@},
1724 frame=@{level="2",args=@{name="intarg",name="strarg"@}@},
1725 frame=@{level="3",args=@{name="intarg",name="strarg",name="fltarg"@}@},
1726 frame=@{level="4",args=@{@}@}@}
1728 -stack-list-arguments 1
1731 frame=@{level="0",args=@{@}@},
1732 frame=@{level="1",args=@{@{name="strarg",value="0x11940 \"A string argument.\""@}@}@},
1733 frame=@{level="2",args=@{
1734 @{name="intarg",value="2"@},
1735 @{name="strarg",value="0x11940 \"A string argument.\""@}@}@},
1736 @{frame=@{level="3",args=@{
1737 @{name="intarg",value="2"@},
1738 @{name="strarg",value="0x11940 \"A string argument.\""@},
1739 @{name="fltarg",value="3.5"@}@}@},
1740 frame=@{level="4",args=@{@}@}@}
1742 -stack-list-arguments 0 2 2
1743 ^done,stack-args=@{frame=@{level="2",args=@{name="intarg",name="strarg"@}@}@}
1745 -stack-list-arguments 1 2 2
1746 ^done,stack-args=@{frame=@{level="2",
1747 args=@{@{name="intarg",value="2"@},
1748 @{name="strarg",value="0x11940 \"A string argument.\""@}@}@}@}
1752 @c @section -stack-list-exception-handlers
1754 @section -stack-list-frames [ <low-frame> <high-frame> ]
1755 List the frames currently on the stack. For each frame it displays the following info:
1758 The frame number, 0 being the topmost frame, i.e. the innermost function.
1760 Pc value for that frame.
1764 File name of the source fle where the function lives.
1766 Line number corresponding to the pc.
1769 If invoked without arguments, it prints a backtrace for the whole stack.
1770 If given two integer arguments it shows the frames whose levels are
1771 between the two arguments (inclusive). If the two arguments are equal,
1772 it shows the single frame at the corresponding level.
1774 @subsection GDB command
1777 @subsection Example 1
1778 Whole stack backtrace.
1784 @{frame=@{level="0 ",addr="0x0001076c",func="foo",file="recursive2.c",line="11"@},
1785 frame=@{level="1 ",addr="0x000107a4",func="foo",file="recursive2.c",line="14"@},
1786 frame=@{level="2 ",addr="0x000107a4",func="foo",file="recursive2.c",line="14"@},
1787 frame=@{level="3 ",addr="0x000107a4",func="foo",file="recursive2.c",line="14"@},
1788 frame=@{level="4 ",addr="0x000107a4",func="foo",file="recursive2.c",line="14"@},
1789 frame=@{level="5 ",addr="0x000107a4",func="foo",file="recursive2.c",line="14"@},
1790 frame=@{level="6 ",addr="0x000107a4",func="foo",file="recursive2.c",line="14"@},
1791 frame=@{level="7 ",addr="0x000107a4",func="foo",file="recursive2.c",line="14"@},
1792 frame=@{level="8 ",addr="0x000107a4",func="foo",file="recursive2.c",line="14"@},
1793 frame=@{level="9 ",addr="0x000107a4",func="foo",file="recursive2.c",line="14"@},
1794 frame=@{level="10",addr="0x000107a4",func="foo",file="recursive2.c",line="14"@},
1795 frame=@{level="11",addr="0x00010738",func="main",file="recursive2.c",line="4"@}@}
1800 @subsection Example 2
1801 Show frames between low_frame and high_frame.
1804 -stack-list-frames 3 5
1806 @{frame=@{level="3 ",addr="0x000107a4",func="foo",file="recursive2.c",line="14"@},
1807 frame=@{level="4 ",addr="0x000107a4",func="foo",file="recursive2.c",line="14"@},
1808 frame=@{level="5 ",addr="0x000107a4",func="foo",file="recursive2.c",line="14"@}@}
1811 @subsection Example 3
1812 Show one single frame.
1815 -stack-list-frames 3 3
1817 @{frame=@{level="3 ",addr="0x000107a4",func="foo",file="recursive2.c",line="14"@}@}
1821 @section -stack-list-locals <print-values>
1822 Display the local variables names for the current frame. With an
1823 argument of 0 prints only the names of the variables, with argument of 1
1824 prints also the values.
1825 @subsection GDB command
1831 -stack-list-locals 0
1832 ^done,locals=@{name="A",name="B",name="C"@}
1834 -stack-list-locals 1
1835 ^done,locals=@{@{name="A",value="1"@},@{name="B",value="2"@},@{name="C",value="3"@}@}
1839 @section -stack-select-frame <framenum>
1840 Change the current frame. Select a different frame on the stack.
1841 @subsection GDB command
1842 frame (part), up, down
1843 AND/OR select-frame,
1844 up-silent, down-silent
1848 -stack-select-frame 2
1853 @c %%%%%%%%%%%%%%%%%%%%%%%%%%%% CHAPTER %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1854 @chapter Symbol query commands
1856 @section -symbol-info-address <symbol>
1857 Describe where <symbol> is stored.
1858 @subsection GDB command
1863 @section -symbol-info-file
1864 Show the file for the symbol [NOT SURE]
1865 @subsection GDB command
1866 gdb_filnd_file (gdbtk).
1870 @section -symbol-info-function
1871 Show which function the symbol lives in. [NOT SURE]
1872 @subsection GDB command
1873 gdb_get_function (gdbtk)
1877 @section -symbol-info-line
1878 Core addresses of the code for a source line.
1879 @subsection GDB command
1880 info line , gdb_get_line, gdb_get_file
1884 @section -symbol-info-symbol
1885 Describe what symbol is at location ADDR [NOT SURE]
1886 @subsection GDB command
1891 @section -symbol-list-functions
1892 List the functions in the executable.
1893 @subsection GDB command
1894 info functions, gdb_listfunc, gdb_search
1898 @section -symbol-list-types
1899 List all the type names.
1900 @subsection GDB command
1901 info types, gdb_search
1905 @section -symbol-list-variables
1906 List all global and static variable names.
1907 @subsection GDB command
1908 Info variables, gdb_search
1912 @section -symbol-locate
1913 @subsection GDB command
1918 @section -symbol-type
1919 Show type of a variable.
1920 @subsection GDB command
1921 ptype, gdb_obj_variable
1925 @c %%%%%%%%%%%%%%%%%%%%%%%%%%%% CHAPTER %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1926 @chapter Target manipulation commands
1928 @section -target-attach
1929 Attach to a process or file outside of GDB.
1930 @subsection GDB command
1935 @section -target-compare-sections
1936 Compare section data on target to the exec file.
1937 @subsection GDB command
1942 @section -target-detach
1943 Disconnect from the remote target.
1946 @subsection GDB command
1957 @section -target-download
1958 Loads the executable onto the remote target.
1959 It prints out an update message every half second, which includes the fields:
1961 @item section: The name of the section.
1962 @item section-sent: The size of what has been sent so far for that section.
1963 @item section-size: The size of the section.
1964 @item total-sent: The total size of what was sent so far (the current and the previous sections).
1965 @item total-size: The size of the overall executable to download.
1967 Each message is sent as status record.
1969 In addition it prints the name and size of the sections, as they are
1970 downloaded. These messages include the fields:
1972 @item section: The name of the section.
1973 @item section-size: The size of the section.
1974 @item total-size: The size of the overall executable to download.
1976 At the end a summary is printed.
1977 @subsection GDB command
1981 Note: Each status message appears on a single line. Here the messages
1982 have been broken down, so they can fit into a page.
1986 +download,@{section=".text",section-size="6668",total-size="9880"@}
1987 +download,@{section=".text",section-sent="512",section-size="6668",
1988 total-sent="512",total-size="9880"@}
1989 +download,@{section=".text",section-sent="1024",section-size="6668",
1990 total-sent="1024",total-size="9880"@}
1991 +download,@{section=".text",section-sent="1536",section-size="6668",
1992 total-sent="1536",total-size="9880"@}
1993 +download,@{section=".text",section-sent="2048",section-size="6668",
1994 total-sent="2048",total-size="9880"@}
1995 +download,@{section=".text",section-sent="2560",section-size="6668",
1996 total-sent="2560",total-size="9880"@}
1997 +download,@{section=".text",section-sent="3072",section-size="6668",
1998 total-sent="3072",total-size="9880"@}
1999 +download,@{section=".text",section-sent="3584",section-size="6668",
2000 total-sent="3584",total-size="9880"@}
2001 +download,@{section=".text",section-sent="4096",section-size="6668",
2002 total-sent="4096",total-size="9880"@}
2003 +download,@{section=".text",section-sent="4608",section-size="6668",
2004 total-sent="4608",total-size="9880"@}
2005 +download,@{section=".text",section-sent="5120",section-size="6668",
2006 total-sent="5120",total-size="9880"@}
2007 +download,@{section=".text",section-sent="5632",section-size="6668",
2008 total-sent="5632",total-size="9880"@}
2009 +download,@{section=".text",section-sent="6144",section-size="6668",
2010 total-sent="6144",total-size="9880"@}
2011 +download,@{section=".text",section-sent="6656",section-size="6668",
2012 total-sent="6656",total-size="9880"@}
2013 +download,@{section=".init",section-size="28",total-size="9880"@}
2014 +download,@{section=".fini",section-size="28",total-size="9880"@}
2015 +download,@{section=".data",section-size="3156",total-size="9880"@}
2016 +download,@{section=".data",section-sent="512",section-size="3156",
2017 total-sent="7236",total-size="9880"@}
2018 +download,@{section=".data",section-sent="1024",section-size="3156",
2019 total-sent="7748",total-size="9880"@}
2020 +download,@{section=".data",section-sent="1536",section-size="3156",
2021 total-sent="8260",total-size="9880"@}
2022 +download,@{section=".data",section-sent="2048",section-size="3156",
2023 total-sent="8772",total-size="9880"@}
2024 +download,@{section=".data",section-sent="2560",section-size="3156",
2025 total-sent="9284",total-size="9880"@}
2026 +download,@{section=".data",section-sent="3072",section-size="3156",
2027 total-sent="9796",total-size="9880"@}
2028 ^done,address="0x10004",load-size="9880",transfer-rate="6586",write-rate="429"
2032 @section -target-exec-status
2033 Provide information on the state of the target. Whether it is running or not, for instance.
2034 @subsection GDB command
2039 @section -target-list-available-targets
2040 List the possible targets to connect to.
2041 @subsection GDB command
2046 @section -target-list-current-targets
2047 What the current target is.
2048 @subsection GDB command
2049 info file (part of it).
2053 @section -target-list-parameters
2055 @subsection GDB command
2060 @section -target-select
2061 Connect GDB to the remote target.
2064 -target-select <type> <parameters>.
2070 The type of target, for instance async, remote, etc.
2072 Device names, host names and the like.
2074 The output is a connection notification, followed by the address at
2075 which the target program is, in the following form:
2076 ^connected,addr="<address>",func="<function name>",args=@{<arg list>@}
2078 @subsection GDB command
2084 -target-select async /dev/ttya
2085 ^connected,addr="0xfe00a300",func="??",args=@{@}
2089 @c %%%%%%%%%%%%%%%%%%%%%%%%%%%% CHAPTER %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2090 @chapter Thread commands
2092 @section -thread-info
2093 @subsection GDB command
2096 @section -thread-list-all-threads
2097 @subsection GDB command
2100 @section -thread-list-ids
2101 Produces a list of the currently known gdb thread ids. At the end of the
2102 list it also prints the toal number of such threads.
2103 @subsection GDB command
2104 None equivalent. (Maybe part of info threads).
2105 @subsection Example 1
2106 No threads present, besides the main process.
2110 ^done,thread-ids=@{@},number-of-threads="0"
2113 @subsection Example 2
2118 ^done,thread-ids=@{thread-id="3",thread-id="2",thread-id="1"@},
2119 number-of-threads="3"
2123 @section -thread-select <threadnum>
2124 Make <threadnum> the current thread. It prints the number of the new
2125 current thread, and the topmost frame for that thread.
2126 @subsection GDB command
2134 *stopped,reason="end-stepping-range",thread-id="2",line="187",
2135 file="../../../devo/gdb/testsuite/gdb.threads/linux-dp.c"
2139 thread-ids={thread-id="3",thread-id="2",thread-id="1"},
2140 number-of-threads="3"
2143 ^done,new-thread-id="3",
2144 frame=@{level="0 ",func="vprintf",
2145 args=@{@{name="format",value="0x8048e9c \"%*s%c %d %c\\n\""@},
2146 @{name="arg",value="0x2"@}@},file="vprintf.c",line="31"@}
2150 @c %%%%%%%%%%%%%%%%%%%%%%%%%%%% CHAPTER %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2151 @chapter Tracepoint Commands
2153 The tracepoint commands are not implemented.
2155 @c @section -trace-actions
2157 @c @section -trace-delete
2159 @c @section -trace-disable
2161 @c @section -trace-dump
2163 @c @section -trace-enable
2165 @c @section -trace-exists
2167 @c @section -trace-find
2169 @c @section -trace-frame-number
2171 @c @section -trace-info
2173 @c @section -trace-insert
2175 @c @section -trace-list
2177 @c @section -trace-pass-count
2179 @c @section -trace-save
2181 @c @section -trace-start
2183 @c @section -trace-stop
2186 @c %%%%%%%%%%%%%%%%%%%%%%%%%%%% CHAPTER %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2187 @chapter Variable Objects
2191 For the implementation of a variable debugger window (locals, watched
2192 expressions, etc.), we are proposing the adaptation of the existent code
2195 The two main reason for that are:
2199 It has been proven in practice (it is already on it's second generation)
2201 It will shorten development time (needless to say how important it is
2205 The original interface was designed to be used by Tcl code, so it was
2206 slightly changed so it can be used through flathead. This document
2207 describes the flathead operations that will be available and gives some
2208 hints about its use.
2210 @emph{Note}: In addition to the set of operations described here, we
2211 expect the GUI implementation of a variable window to require, at least,
2212 the following operations:
2214 @item -gdb-show output-radix
2215 @item -stack-list-arguments
2216 @item -stack-list-locals
2217 @item -stack-select-frame
2220 @section Introduction
2222 The basic idea behind variable objects is the creation of a named object
2223 to represent a variable, an expression, a memory location or even a CPU
2224 register. For each object created, a set of operations is available for
2225 examining or changing its properties.
2227 Furthermore, complex data types, such as C structures, are represented
2228 in a tree format. For instance, the struct type variable is the root
2229 and the children will represent the struct members. If a children is
2230 itself of a complex type, it will also have children of its own.
2231 Appropriate language differences are handled for C, C++ and Java.
2233 When returning the actual values of the objects, this facility allows
2234 for the individual selection of the display format used in the result
2235 creation. It can be chosen among: binary, decimal, hexadecimal, octal
2236 and natural. Natural refers to the a default format automatically chosen
2237 based on the variable type (like decimal for int, hex for pointers,
2240 The following is the complete set of flathead operations defined to
2241 access this functionality:
2243 @multitable @columnfractions .3 .6
2244 @item @strong{Operation}
2245 @tab @strong{Description}
2248 @tab create a variable object
2250 @tab delete the variable object and its children
2251 @item -var-set-format
2252 @tab set the display format of this variable
2253 @item -var-show-format
2254 @tab show the display format of this variable
2255 @item -var-info-num-children
2256 @tab tells how many children this object has
2257 @item -var-list-children
2258 @tab return a list of the object's children
2259 @item -var-info-type
2260 @tab show the type of this variable object
2261 @item -var-info-expression
2262 @tab print what this variable object represents
2263 @item -var-show-attributes
2264 @tab is this variable editable? does it exist here?
2265 @item -var-evaluate-expression
2266 @tab get the value of this variable
2268 @tab set the value of this variable
2270 @tab update the variable and its children
2273 In the next section we describe each operation in detail and suggest how
2277 @section Operations Description And Use
2279 @subsection -var-create @{<name> | '-'@} @{<frame-addr> | '*'@} <expression>
2281 This operation creates a variable object, which allows the monitoring of
2282 a variable, the result of an expression, a memory cell or a CPU
2285 The <name> parameter is the string by which the object can be
2286 referenced. It must be unique. If '-' is specified, the varobj system
2287 will generate a string "varNNNNNN" automatically. It will be unique
2288 provided that one does not specify <name> on that format. The command
2289 fails if a duplicate name is found.
2291 The frame under which the expression should be evaluated can be
2292 specified. A '*' indicates that the current frame should be used.
2294 Expression is any expression valid on the current language set (must not
2295 begin with '*') or: *<addr> - The address of a memory cell
2296 *<addr>-<addr> - An memory address range (TBD) $<regname> - A CPU
2299 This operation returns the name, number of children and the type of the
2300 object created. Type is returned as a string as the ones generated by
2303 name="<name>",numchild="N",type="<type>"
2305 @subsection -var-delete <name>
2307 Deletes a previously created variable object and all of it's children.
2309 Returns an error if the object <name> is not found.
2311 @subsection -var-set-format <name> <format-spec>
2313 Sets the output format for the value of the object.
2315 <format-spec> = @{binary | decimal | hexadecimal | octal | natural@}
2317 @subsection -var-show-format <name>
2319 Returns the format used to display the value of the object.
2321 format="<format-spec>"
2323 @subsection -var-info-num-children <name>
2325 Returns the number of children of a variable object.
2329 @subsection -var-list-children <name>
2331 Returns a list of the children of the specified variable object.
2333 numchild="N",children=@{@{name="<name>",numchild="N",type="<type>"@},(repeats N times)@}
2335 @subsection -var-info-type <name>
2337 Returns the type of the specified variable. The type is returned as a
2338 string in the same format as it is output by gdb's CLI.
2342 @subsection -var-info-expression <name>
2344 Returns what is represented by the specified variable object.
2346 lang="<lang-spec>",exp="<expression>"
2348 where <lang-spec> = @{"C" | "C++" | "Java"@}
2350 @subsection -var-show-attributes <name>
2352 List attributes of the specified variable object.
2354 status="<attr>[,<attr>]*"
2356 where <attr> = @{ @{ editable | noneditable @} | TBD @}
2358 @subsection -var-evaluate-expression <name>
2360 Evaluates the expression that is represented by the specified variable
2361 object and returns its value as a string in the current format specified
2366 @subsection -var-assign <name> <expression>
2368 Assigns a new value for the variable object specified. The object must
2371 @subsection -var-update @{<name> | '*'@}
2373 Update the value of the variable object by evaluating its expression
2374 after fetching all the new values from memory or registers. A '*'
2375 causes all existing variable objects to be updated.
2378 @c%%%%%%%%%%%%%%%%%%%%%%%%%%%% APPENDIX %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2379 @appendix Proposed v2.0 Output Syntax
2381 This appendix is not part of the MI specification. It is provided as a
2384 The output from GDB/MI consists of zero or more out-of-band records
2385 optionally followed by a single result record. The result record being
2386 for the most recent command input. The sequence being terminated by
2389 Asynchronous GDB/MI output is similar.
2391 Each output record directly associated with an input command is prefixed
2392 by the input commands @code{<token>}.
2395 @item <output> @expansion{}
2396 @{ <out-of-band-record> @} [ <result-record> ] ``(gdb)'' <nl>
2398 @item <result-record> @expansion{}
2399 [ <token> ] ``^'' <result-class> @{ ``,'' <result> @} <nl>
2401 @item <out-of-band-record> @expansion{}
2402 <async-record> | <stream-record>
2404 @item <async-record> @expansion{}
2405 <exec-async-output> | <status-async-output> | <notify-async-output>
2407 @item <exec-async-output> @expansion{}
2408 [ <token> ] ``*'' <async-output>
2410 @item <status-async-output> @expansion{}
2411 [ <token> ] ``+'' <async-output>
2413 @item <notify-async-output> @expansion{}
2414 [ <token> ] ``='' <async-output>
2416 @item <async-output> @expansion{}
2417 <async-class> @{ ``,'' <result> @} <nl>
2419 @item <result-class> @expansion{}
2420 ``done'' | ``running'' | ``connected'' | ``error'' | ``exit''
2422 @item <async-class> @expansion{}
2423 ``stopped'' | @emph{others depending on need as still in development}
2425 @item <result> @expansion{}
2426 <string> ``='' <value>
2428 @item <value> @expansion{}
2429 <c-string> | <tupple> | <list>
2431 @item <tupple> @expansion{}
2432 ``@{@}'' | ``@{'' <result> @{ ``,'' <result> @} ``@}''
2434 @item <list> @expansion{}
2435 ``[]'' | ``['' <value> @{ ``,'' <value> @} ``]''
2437 @item <string> @expansion{}
2438 @emph{[-A-Za-z\.0-9_]*}
2440 @item <c-string> @expansion{}
2441 @emph{See the input specification}
2443 @item <stream-record> @expansion{}
2444 <console-stream-output> | <target-stream-output> | <log-stream-output>
2446 @item <console-stream-output> @expansion{}
2449 @item <target-stream-output> @expansion{}
2452 @item <log-stream-output> @expansion{}
2455 @item <nl> @expansion{}
2458 @item <token> @expansion{}
2459 ``any sequence of digits''
2463 In addition, the following are still being developed.
2468 This action is currently undefined.
2477 All output sequences end in a single line containing a period.
2480 The @code{<token>} is from the corresponding request. If an execution
2481 command is interrupted by the -exec-interrupt command, the token
2482 associated with the `*stopped' message is the one of the original
2483 execution command, not the one of the interrupt-command.
2486 <status-async-output> contains on-going status information about the progress
2487 of a slow operation. It can be discarded. All status output is prefixed by
2491 <exec-async-output> contains asynchronous state change on the target
2492 (stopped, started, disappeared). All async output is prefixed by
2496 <notify-async-output> contains supplementary information that the client should
2497 handle (new breakpoint information). All notify output is prefixed by
2501 <console-stream-output> is output that should be displayed as is in the
2502 console. It is the textual response to a CLI command. All the console
2503 output is prefixed by the prefix ``~''.
2506 <target-stream-output> is the output produced by the target program.
2507 All the target output is prefixed by the prefix ``@@''.
2510 <log-stream-output> is output text coming from GDB's internals, for
2511 instance messages that should be displayed as part of an error log. All
2512 the log output is prefixed by the prefix ``&''.
2518 @c change-log-default-name: "ChangeLog-mi"