Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* GDB/MI & CLI commands
@ 2003-02-07 14:55 Bob Rossi
  2003-02-07 15:10 ` Bob Rossi
  0 siblings, 1 reply; 5+ messages in thread
From: Bob Rossi @ 2003-02-07 14:55 UTC (permalink / raw)
  To: gdb

Is GDB/MI supposed to accept all CLI commands?

If so, does gdb-5.3 or cvs do it? I know the documentation says that it
accepts CLI commands for Debug purposes only, however, reading through
the mailing lists, it looks like GDB/MI is supposed to accept CLI
commands.

If I debug a small main program and then type
b main
r
then the debugger will stop at the main.

If I debug a larger program and type the same commands, gdb never stops
at the main subprogram.

Does anyone know why? Is this a bug?

Thanks,
Bob Rossi


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: GDB/MI & CLI commands
  2003-02-07 14:55 GDB/MI & CLI commands Bob Rossi
@ 2003-02-07 15:10 ` Bob Rossi
  2003-02-07 20:29   ` Keith Seitz
  0 siblings, 1 reply; 5+ messages in thread
From: Bob Rossi @ 2003-02-07 15:10 UTC (permalink / raw)
  To: gdb

Please forgive my ignorance. It works when -O2 isn't used during the
compile. However, I would like to confirm that GDB/MI is supposed to
accept CLI commands.

On Fri, Feb 07, 2003 at 09:55:57AM -0500, Bob Rossi wrote:
> Is GDB/MI supposed to accept all CLI commands?
> 
> If so, does gdb-5.3 or cvs do it? I know the documentation says that it
> accepts CLI commands for Debug purposes only, however, reading through
> the mailing lists, it looks like GDB/MI is supposed to accept CLI
> commands.
> 
> If I debug a small main program and then type
> b main
> r
> then the debugger will stop at the main.
> 
> If I debug a larger program and type the same commands, gdb never stops
> at the main subprogram.
> 
> Does anyone know why? Is this a bug?
> 
> Thanks,
> Bob Rossi


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: GDB/MI & CLI commands
  2003-02-07 15:10 ` Bob Rossi
@ 2003-02-07 20:29   ` Keith Seitz
  2003-02-08  2:58     ` Bob Rossi
  0 siblings, 1 reply; 5+ messages in thread
From: Keith Seitz @ 2003-02-07 20:29 UTC (permalink / raw)
  To: Bob Rossi; +Cc: gdb

On Fri, 2003-02-07 at 07:10, Bob Rossi wrote:
> However, I would like to confirm that GDB/MI is supposed to
> accept CLI commands.

It does for now, but this behavior is only temporary. It was used as a
stop-gap for commands that are not yet implemented (from mi-main.c):

    case CLI_COMMAND:
      /* A CLI command was read from the input stream */
      /* This will be removed as soon as we have a complete set of
         mi commands */

Note that CLI commands read in via MI (not via -interpreter-exec) will
have MI output semantics.

Keith



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: GDB/MI & CLI commands
  2003-02-07 20:29   ` Keith Seitz
@ 2003-02-08  2:58     ` Bob Rossi
  2003-02-08 15:55       ` Keith Seitz
  0 siblings, 1 reply; 5+ messages in thread
From: Bob Rossi @ 2003-02-08  2:58 UTC (permalink / raw)
  To: gdb

On Fri, Feb 07, 2003 at 12:33:56PM -0800, Keith Seitz wrote:
> On Fri, 2003-02-07 at 07:10, Bob Rossi wrote:
> > However, I would like to confirm that GDB/MI is supposed to
> > accept CLI commands.
> 
> It does for now, but this behavior is only temporary. It was used as a
> stop-gap for commands that are not yet implemented (from mi-main.c):
> 
>     case CLI_COMMAND:
>       /* A CLI command was read from the input stream */
>       /* This will be removed as soon as we have a complete set of
>          mi commands */
> 
> Note that CLI commands read in via MI (not via -interpreter-exec) will
> have MI output semantics.
> 
> Keith
> 

Keith, 
Please excuse my ignorance.

When GDB is started like this './gdb --interpreter=mi <program>',
the mi interface is given. 

I understand that the client can then communicate with gdb by 
issuing mi commands and getting back mi responses.

I would like to know if in the official release of mi ( when its basically
complete ) will accept CLI commands from the client and give back mi
responses?

This is important to me since I plan on implementing a console for the
user to issue CLI commands.

What is the difference between MI and -interpreter-exec?

Thanks for your patience,
Bobby


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: GDB/MI & CLI commands
  2003-02-08  2:58     ` Bob Rossi
@ 2003-02-08 15:55       ` Keith Seitz
  0 siblings, 0 replies; 5+ messages in thread
From: Keith Seitz @ 2003-02-08 15:55 UTC (permalink / raw)
  To: Bob Rossi; +Cc: gdb

On Fri, 2003-02-07 at 18:58, Bob Rossi wrote:

> I would like to know if in the official release of mi ( when its basically
> complete ) will accept CLI commands from the client and give back mi
> responses?

No: this behavior exists today ONLY because maintainers know that the MI
command set is incomplete. Once the command set is considered "complete"
(or 9x% complete?), I presume that this "feature" will disappear. (I say
"presume" because I am not a gdb maintainer; nonetheless, I am 99% sure
that it will disappear once the command set is considered [nearly?]
complete.)

> This is important to me since I plan on implementing a console for the
> user to issue CLI commands.

This is what "interpreter-exec" is for (as you suspected).

> What is the difference between MI and -interpreter-exec?

The MI command "-interpreter-exec" is used to execute a command in a
different interpreter. This is how you would implement a console in a
GUI. For example, if I have a console window somewhere, and the user
enters "help<ENTER>", my UI code would call (eventually):
 
-interpreter-exec console "help"

And it would get back the output of the "help" command, encapsulated in
MI syntax, something like:

~"List of classes of commands:\n"
~"\n"
~"aliases -- Aliases of other commands\n"
[etc]

The readline-like capabilities of the UI's command line are considered a
UI-specific feature. For example, in Insight, we do not use readline. We
emulate the most commonly used readline commands, but we do not call any
readline functions at all. IMO, this is no big deal. I've never missed
anything, and I've only ever gotten one patch to add "missing" features.
YMMV.

Hope this helps some,
Keith



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2003-02-08 15:55 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-02-07 14:55 GDB/MI & CLI commands Bob Rossi
2003-02-07 15:10 ` Bob Rossi
2003-02-07 20:29   ` Keith Seitz
2003-02-08  2:58     ` Bob Rossi
2003-02-08 15:55       ` Keith Seitz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox