List Info

Thread: CLI commands in MI




CLI commands in MI
user name
2006-05-11 02:26:50
I'm thinking it would be a good idea to remove the ability
to enter CLI
commands into the MI interpreter. Does anyone disagree?

I think the only thing it can cause is confusion. Especially
since
entering the '-exec-run' command gives different results
than the
'-interpreter-exec console "r"' command which
gives different results
than the 'r' command.

Now that -interpreter-exec is available, is there any reason
beyond
trying to confuse us all that console commands are allowed?

Thanks,
Bob Rossi
CLI commands in MI
user name
2006-05-11 03:41:14
On Wed, May 10, 2006 at 10:26:50PM -0400, Bob Rossi wrote:
> I'm thinking it would be a good idea to remove the
ability to enter CLI
> commands into the MI interpreter. Does anyone disagree?

No way.  The fact is, the MI command set is not complete,
and
-interpreter-exec is still recent.  I would expect most
front ends
to still require this support, for the indefinite future.

Now, if we look at the command set someday (around mi4
maybe), and find
that it's become complete, then perhaps we can disable the
CLI hack.

-- 
Daniel Jacobowitz
CodeSourcery
CLI commands in MI
user name
2006-05-11 06:01:55
Bob Rossi writes:
 > I'm thinking it would be a good idea to remove the
ability to enter CLI
 > commands into the MI interpreter. Does anyone
disagree?

Yes.  I find it very convenient to see whats going on.  To
get to a given
execution state its easier type the CLI command directly,
rather than the MI
one which is generally longer and doesn't allow
abbreviations, or prefix
everything with -interpreter-exec.

 > I think the only thing it can cause is confusion.
Especially since
 > entering the '-exec-run' command gives different
results than the
 > '-interpreter-exec console "r"' command
which gives different results
 > than the 'r' command.

I don't how you can say that as directly entered CLI
commands now (implicitly)
use -interpreter-exec console.  AFAICS the only difference
is the extra &"r\n".


 > Now that -interpreter-exec is available, is there any
reason beyond
 > trying to confuse us all that console commands are
allowed?

No one is forcing you to use it.  Why would you want to
force others not
to use it?

-- 
Nick                                           http://www.inet.net.n
z/~nickrob
CLI commands in MI
user name
2006-05-11 06:39:29
> Now, if we look at the command set someday (around mi4
maybe), and find
> that it's become complete, then perhaps we can disable
the CLI hack.

How about if the front-end wants to provide a debugger
console, so
that the user can also enter commands manually? I would have
hoped
that we could still allow the user to use CLI commands in
that console,
because MI commands output are somewhat difficult to read
for a normal
human.

Basically, the front-end would take the user command in CLI
format,
send it to the MI interpreter via this feature, and then get
the
output back, extract it from the MI output, and then display
it
on the console.

Is there another way of doing this?

-- 
Joel
CLI commands in MI
user name
2006-05-11 10:24:55
On Wed, May 10, 2006 at 11:41:14PM -0400, Daniel Jacobowitz
wrote:
> On Wed, May 10, 2006 at 10:26:50PM -0400, Bob Rossi
wrote:
> > I'm thinking it would be a good idea to remove
the ability to enter CLI
> > commands into the MI interpreter. Does anyone
disagree?
> 
> No way.  The fact is, the MI command set is not
complete, and
> -interpreter-exec is still recent.  I would expect most
front ends
> to still require this support, for the indefinite
future.

Whoa, I don't think it matters if FE's are using this
feature. Read the
manual,

  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.

Bob Rossi
CLI commands in MI
user name
2006-05-11 10:31:32
On Thu, May 11, 2006 at 06:01:55PM +1200, Nick Roberts
wrote:
> Bob Rossi writes:
>  > I'm thinking it would be a good idea to remove
the ability to enter CLI
>  > commands into the MI interpreter. Does anyone
disagree?
> 
> Yes.  I find it very convenient to see whats going on. 
To get to a given
> execution state its easier type the CLI command
directly, rather than the MI
> one which is generally longer and doesn't allow
abbreviations, or prefix
> everything with -interpreter-exec.

OK, well maybe if someone types a CLI command, internally we
make it do
the same thing -interpreter-exec console ... does? That
would still make
me happy. Although I read below you said that's the case.
Either it's
not the case, or it is and my GDB is old. I'll have to
investigate.

>  > I think the only thing it can cause is confusion.
Especially since
>  > entering the '-exec-run' command gives
different results than the
>  > '-interpreter-exec console "r"'
command which gives different results
>  > than the 'r' command.
> 
> I don't how you can say that as directly entered CLI
commands now (implicitly)
> use -interpreter-exec console.  AFAICS the only
difference is the extra &"r\n".

Hmmm, that's not the case for me. Is this becase I'm using
an older
version of GDB?

$ gdb --version
GNU gdb 6.3-debian

(gdb)
b main
&"b main\n"
^done
(gdb)
r
&"r\n"
^done,reason="breakpoint-hit",bkptno="1&q
uot;,thread-id="0",frame={addr="0x08048364
",func="main",args=[{name="argc&quo
t;,value="1"},{name="argv",value=&q
uot;0xbf9d1464"}],file="main.c",line=&quo
t;4"}
(gdb)

(gdb)
-interpreter-exec console "b main"
~"Breakpoint 1 at 0x8048364: file main.c, line
4.\n"
^done
(gdb)
-interpreter-exec console "r"
~"Starting program:
/home/bob/cvs/gdbmi/builddir/src/main \n"
~"\n"
~"Breakpoint 1, main (argc=1, argv=0xbfbcd7a4) at
main.c:4\n"
~"4\t  argc = 1;\n"
^done
(gdb)

>  > Now that -interpreter-exec is available, is there
any reason beyond
>  > trying to confuse us all that console commands
are allowed?
> 
> No one is forcing you to use it.  Why would you want to
force others not
> to use it?

Because it's a totally useless feature that gives incorrect
results.
Also, FE's might actually use it!

Bob Rossi
CLI commands in MI
user name
2006-05-11 10:45:34
 > > I don't how you can say that as directly entered
CLI commands now
 > > (implicitly) use -interpreter-exec console. 
AFAICS the only difference is
 > > the extra &"r\n".
 > 
 > Hmmm, that's not the case for me. Is this becase I'm
using an older
 > version of GDB?
 > 
 > $ gdb --version
 > GNU gdb 6.3-debian


Yes, this is the change:

    2005-02-20  Andrew Cagney  <cagneygnu.org>

            * mi/mi-main.c (captured_mi_execute_command):
Use
            mi_cmd_interpreter_exec.

Let's keep the discussion relative to GDB in CVS.


-- 
Nick                                           http://www.inet.net.n
z/~nickrob
CLI commands in MI
user name
2006-05-11 10:49:27
On Thu, May 11, 2006 at 10:45:34PM +1200, Nick Roberts
wrote:
>  > > I don't how you can say that as directly
entered CLI commands now
>  > > (implicitly) use -interpreter-exec console. 
AFAICS the only difference is
>  > > the extra &"r\n".
>  > 
>  > Hmmm, that's not the case for me. Is this becase
I'm using an older
>  > version of GDB?
>  > 
>  > $ gdb --version
>  > GNU gdb 6.3-debian
> 
> 
> Yes, this is the change:
> 
>     2005-02-20  Andrew Cagney  <cagneygnu.org>
> 
>             * mi/mi-main.c
(captured_mi_execute_command): Use
>             mi_cmd_interpreter_exec.
> 
> Let's keep the discussion relative to GDB in CVS.

I see! Thanks Nick for the info.

Bob Rossi
CLI commands in MI
user name
2006-05-11 10:52:10
 > > > I'm thinking it would be a good idea to
remove the ability to enter CLI
 > > > commands into the MI interpreter. Does
anyone disagree?
 > > 
 > > No way.  The fact is, the MI command set is not
complete, and
 > > -interpreter-exec is still recent.  I would
expect most front ends
 > > to still require this support, for the indefinite
future.
 > 
 > Whoa, I don't think it matters if FE's are using
this feature. Read the
 > manual,
 > 
 >   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.

There was thread about this paragraph on this mailing list a
month ago.  It was
written before Jim Ingham, Andrew Cagney et al wrote
-interpreter-exec to
switch interpreters, so the lack of reliability is not true
anymore.


-- 
Nick                                           http://www.inet.net.n
z/~nickrob
CLI commands in MI
user name
2006-05-11 10:58:00
On Thu, May 11, 2006 at 10:52:10PM +1200, Nick Roberts
wrote:
>  > > > I'm thinking it would be a good idea
to remove the ability to enter CLI
>  > > > commands into the MI interpreter. Does
anyone disagree?
>  > > 
>  > > No way.  The fact is, the MI command set is
not complete, and
>  > > -interpreter-exec is still recent.  I would
expect most front ends
>  > > to still require this support, for the
indefinite future.
>  > 
>  > Whoa, I don't think it matters if FE's are
using this feature. Read the
>  > manual,
>  > 
>  >   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.
> 
> There was thread about this paragraph on this mailing
list a month ago.  It was
> written before Jim Ingham, Andrew Cagney et al wrote
-interpreter-exec to
> switch interpreters, so the lack of reliability is not
true anymore.

OK, we should update the manual. Also, unless we update to
mi3, it's
bad that the FE has no way of knowing if there GDB is broken
or not.

Bob Rossi
[1-10] [11-13]

about | contact  Other archives ( Real Estate discussion Medical topics )