GDB/MI

Nick Roberts nick@nick.uklinux.net
Fri Feb 21 20:30:00 GMT 2003


> The prompt:
> 
> 	"(gdb)\n"
> 
> indicates that GDB is ready for input.  That prompt terminates every 
> transaction.  It is independant of the console GDB prompt:

It looks very like the console GDB prompt and could cause confusion so perhaps
it could be replaced with something like "(mi)\n".

If "(gdb)\n" is an invariant (the user can't change it) then that would be
fine except that, debugging a program with output I get:

...
(gdb) 
-exec-run
^running
(gdb) 
Enter no. of iterations:

and "(gdb)\n" is output but GDB *not* ready for input, the inferior is. This
is the extra "(gdb)\n" that I talked about earlier with Elena as in:

-exec-run
^running
(gdb) 
*stopped,reason="breakpoint-hit",bkptno="1",thread-id="0",frame={addr="0x0804856c",func="main",args=[{name="argc",value="1"},{name="argv",value="0xbffff7f4"}],file="mytest.c",line="36"}
(gdb) 

According to the current documentation for the GDB/MI Output Syntax
--------------------, the first
"(gdb)\n" should not be output.

> (gdb)
> -interpreter-exec console set prompt foo
> &"Argument required (expression to compute).\n"
> ^error,msg="Argument required (expression to compute)."
> (gdb)
> -interpreter-exec console "set prompt foo"
> ^done
> (gdb)
> -interpreter-exec console "show prompt"
> ~"Gdb's prompt is \"foo\".\n"
> ^done
> (gdb)
> 
> There is a `bug' here - GDB should generate a `=prompt-changed' event.

I can't find any reference to such an event but if MI has its own prompt
then maybe its not needed.

Nick



More information about the Gdb mailing list