Debugging with GDB (September 2007)
Chapter 21: The gd b/mi Interface 269
21.2 gdb/mi compatibility with CLI
To help users get familiar with GDB CLI, GBB/MI accepts existing CLI commands. As
specified by the syntax, such commands can be directly entered into the gdb/mi interface
and GDB will respond.
This mechanism is provided as an aid to developers of gdb/mi clients and not as a
reliable interface into the CLI. Since the command is being interpreteted in an environment
that assumes gdb/mi behaviour, the exact output of such commands is likely to end up
being an un-supported hybrid of gdb/mi and CLI output.
21.3 gdb/mi output records
21.3.1 gdb/mi result records
In addition to a number of out-of-band notifications, the response to a gd b/mi command
includes one of the following result indications:
"^done" [ "," results ]
The synchronous operation was successful, results are the return values.
"^running"
The asynchronous operation was successfully started. The target is running.
"^error" "," c-string
The operation failed. The c-string contains the c orresponding error message.
21.3.2 gdb/mi stream records
GDB internally maintains a number of output streams: the console, the target, and the
log. The output intended for each of these streams is funneled through the gdb/mi interface
using stream records.
Each stream record begins with a unique prefix character which identifies its stream (see
Section 21.1.2 [gdb/mi Output Syntax], page 266). In addition to the prefix, each stream
record contains a string-output . This is either raw text (with an implicit new line) or a
quoted C string (which do e s not contain an implicit newline).
"~" string-output
The console output stream contains text that should be displaye d in the CLI
console window. It contains the textual responses to CLI commands.
"@" string-output
The target output stream contains any textual output from the running target.
"&" string-output
The log stream contains internal debugging messages being produced by GDB.