Whole document tree
    

Whole document tree

Debugging with GDB: GDB/MI Draft Changes to Output Syntax
[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

19.15 GDB/MI Draft Changes to Output Syntax

One problem identified in the existing GDB/MI output syntax was the difficulty in differentiating between a tuple such as:

 
{number="1",type="breakpoint",disp="keep",enabled="y"}

where each value has a unique label, and a list such as:

 
{"1","2","4"}
{bp="1",bp="2",bp="4"}

where values are un-labeled or the label is duplicated.

What follows is a draft revision to the output specification that addresses this problem.

The output from GDB/MI consists of zero or more out-of-band records optionally followed by a single result record, the result record being for the most recent command input. The sequence is terminated by "(gdb)".

Asynchronous GDB/MI output is similar.

Each output record directly associated with an input command is prefixed by the input commands token.

output ==>
{ out-of-band-record } [ result-record ] "(gdb)" nl

result-record ==>
[ token ] "^" result-class { "," result } nl

out-of-band-record ==>
async-record | stream-record

async-record ==>
exec-async-output | status-async-output | notify-async-output

exec-async-output ==>
[ token ] "*" async-output

status-async-output ==>
[ token ] "+" async-output

notify-async-output ==>
[ token ] "=" async-output

async-output ==>
async-class { "," result } nl

result-class ==>
"done" | "running" | "connected" | "error" | "exit"

async-class ==>
"stopped" | others depending on need as still in development

result ==>
string "=" value

value ==>
c-string | tupple | list

tupple ==>
"{}" | "{" result { "," result } "}"

list ==>
"[]" | "[" value { "," value } "]"

string ==>
[-A-Za-z\.0-9_]*

c-string ==>
See the input specification

stream-record ==>
console-stream-output | target-stream-output | log-stream-output

console-stream-output ==>
"~" c-string

target-stream-output ==>
"@" c-string

log-stream-output ==>
"&" c-string

nl ==>
CR | CR-LF

token ==>
"any sequence of digits"

In addition, the following are still being developed.

query
This action is currently undefined.

Notes:

  • All output sequences end in a single line containing a period.

  • The token is from the corresponding request. If an execution command is interrupted by the -exec-interrupt command, the token associated with the `*stopped' message is the one of the original execution command, not the one of the interrupt-command.

  • status-async-output contains on-going status information about the progress of a slow operation. It can be discarded. All status output is prefixed by the prefix `+'.

  • exec-async-output contains asynchronous state change on the target (stopped, started, disappeared). All async output is prefixed by the prefix `*'.

  • notify-async-output contains supplementary information that the client should handle (new breakpoint information). All notify output is prefixed by the prefix `='.

  • console-stream-output is output that should be displayed as is, in the console. It is the textual response to a CLI command. All the console output is prefixed by the prefix "~".

  • target-stream-output is the output produced by the target program. All the target output is prefixed by the prefix "@".

  • log-stream-output is output text coming from GDB's internals, for instance messages that should be displayed as part of an error log. All the log output is prefixed by the prefix "&".


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

This document was generated by root on January, 30 2002 using texi2html