Debugging with GDB (September 2007)
Chapter 21: The gd b/mi Interface 265
21 The gdb/mi Interface
Function and purpose
gdb/mi is a line based machine oriented text interface to GDB. It is specifically intended
to support the development of systems which use the debugger as just one small component
of a larger system.
This chapter is a specification of the gdb/mi interface. It is written in the form of a
reference manual.
Notation and terminology
This chapter uses the following notation:
• | separates two alternatives.
• [ something ] indicates that something is optional: it may or may not be given.
• ( group )* means that group inside the parentheses m ay repeat zero or more times.
• ( group )+ means that group inside the parentheses m ay repeat one or more times.
• "string " means a literal string.
Acknowledgments
In alphabetic order: Andrew Cagney, Fernando Nasser, Stan Shebs and Elena Zannoni.
21.1 gdb/mi Command Syntax
21.1.1 gdb/mi Input syntax
command
7→
cli-command | mi-command
cli-command
7→
[ token ] cli-command nl, where cli-c ommand is any existing GDB CLI com-
mand.
mi-command
7→
[ token ] "-" operation ( " " option )* [ " --" ] ( " " parameter )* nl
token
7→
"any sequence of digits"
option
7→
"-" parameter [ " " parameter ]
parameter
7→
non-blank-sequence | c-string