Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-debug-dev] MI questions

On Wed, 2 Oct 2002, Alain Magloire wrote:

> > Sigh. It looks like spaces need to be escaped ("hello\ world").
> > 
> 
> Ok, I can live with this, is there a list of characters that needs to be
> quoted, I can see: space, double quotes, semicolon ..

It will probably depend on the command and its implementation. I do not 
believe that -data-evaluate-expression has any reserved characters beyond 
the mi input parser's reservations: unquoted spaces and double quotes. 
So:

(gdb)
-data-evaluate-expression argc
^done,value="1"
(gdb)
-data-evaluate-expression (char *) argc
^error,msg="mi_cmd_data_evaluate_expression: Usage: -data-evaluate-expression expression"
(gdb)
-data-evaluate-expression "(char *) argc"
^done,value="0x1 <Address 0x1 out of bounds>"
(gdb)

> Which brought forward this issue, the "--" separator, some commands
> will not accept and generate errors, althought the MI semantics say it
> is allowed
> `MI-COMMAND ==>'
>      `[ TOKEN ] "-" OPERATION ( " " OPTION )* `[' " --" `]' ( " " PARAMETER )* NL'
> 
> Filed a PR, not sure if it is a bug.

It's either a bug in the MI commands (or maybe the parser), a mistake in 
the documentation, or a misread of the docs. It certainly seems like #1 to 
me... I think this is because most of the commands don't actually use the 
mi command parsing routines. They do their own argv parsing.

I presume someone will respond (officially) soon enough, but I would 
recommend just sticking with the most-specific command syntax for the 
commands listed in the manual.

And by all means! File those bugs! If you have questions or bugs or 
whatever, file a bug! If you've got the question, no doubt someone else 
will, too. This way there's a public record of everything.

Keith




Back to the top