Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* enable a couple of useful cli commands in async mode.
@ 2008-03-14  8:00 Pedro Alves
  2008-03-14 14:36 ` Daniel Jacobowitz
  0 siblings, 1 reply; 4+ messages in thread
From: Pedro Alves @ 2008-03-14  8:00 UTC (permalink / raw)
  To: gdb-patches

[-- Attachment #1: Type: text/plain, Size: 565 bytes --]

This is needed to test/develop async with CLI.  The info info command is
very useful to debug gdb itself, and the interrupt command is needed to be
able to SIGINT the target.  Without it, the user is trapped in the hole
of wanting to quit, but gdb complaining "I can't do that Dave" while  the 
target is running.  "stop" is there already, so I added break too,
although it doesn't work yet.

CLI command filtering this way is a gross hack that needs cleaning
up anyway.  Since noone is using this currently, I went ahead and installed
as obvious.

-- 
Pedro Alves

[-- Attachment #2: enable_more_async_commands.diff --]
[-- Type: text/x-diff, Size: 925 bytes --]

2008-03-14  Pedro Alves  <pedro@codesourcery.com>

	* top.c (execute_command): Enable break, info and interrupt
	commands in async mode.

---
 gdb/top.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Index: src/gdb/top.c
===================================================================
--- src.orig/gdb/top.c	2008-03-14 07:01:54.000000000 +0000
+++ src/gdb/top.c	2008-03-14 07:01:57.000000000 +0000
@@ -405,7 +405,10 @@ execute_command (char *p, int from_tty)
 	if (strcmp (c->name, "help") != 0
 	    && strcmp (c->name, "pwd") != 0
 	    && strcmp (c->name, "show") != 0
-	    && strcmp (c->name, "stop") != 0)
+	    && strcmp (c->name, "stop") != 0
+	    && strcmp (c->name, "break") != 0
+	    && strcmp (c->name, "info") != 0
+	    && strcmp (c->name, "interrupt") != 0)
 	  error (_("Cannot execute this command while the target is running."));
 
       /* Pass null arg rather than an empty one.  */

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

* Re: enable a couple of useful cli commands in async mode.
  2008-03-14  8:00 enable a couple of useful cli commands in async mode Pedro Alves
@ 2008-03-14 14:36 ` Daniel Jacobowitz
  2008-03-14 15:33   ` Pedro Alves
  0 siblings, 1 reply; 4+ messages in thread
From: Daniel Jacobowitz @ 2008-03-14 14:36 UTC (permalink / raw)
  To: Pedro Alves; +Cc: gdb-patches

On Fri, Mar 14, 2008 at 07:59:55AM +0000, Pedro Alves wrote:
> This is needed to test/develop async with CLI.  The info info command is
> very useful to debug gdb itself, and the interrupt command is needed to be
> able to SIGINT the target.  Without it, the user is trapped in the hole
> of wanting to quit, but gdb complaining "I can't do that Dave" while  the 
> target is running.  "stop" is there already, so I added break too,
> although it doesn't work yet.
> 
> CLI command filtering this way is a gross hack that needs cleaning
> up anyway.  Since noone is using this currently, I went ahead and installed
> as obvious.

I'm confused by your choices.  "stop" is not the command you think it
is.  There's a "stop_command" in breakpoint.c but that's the
DBX-compatibility version of "break".  The command "stop" doesn't
do anything; it's only there for hook-stop.

Also, how can we enable "info"?  That will let you type "info regs"
while the target is running; does something produce a useful error
further down?

"interrupt" makes sense.  In fact I think this is what whoever added
"stop" actually meant to add.

-- 
Daniel Jacobowitz
CodeSourcery


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

* Re: enable a couple of useful cli commands in async mode.
  2008-03-14 14:36 ` Daniel Jacobowitz
@ 2008-03-14 15:33   ` Pedro Alves
  2008-03-14 15:43     ` Daniel Jacobowitz
  0 siblings, 1 reply; 4+ messages in thread
From: Pedro Alves @ 2008-03-14 15:33 UTC (permalink / raw)
  To: gdb-patches

[-- Attachment #1: Type: text/plain, Size: 1711 bytes --]

A Friday 14 March 2008 14:35:40, Daniel Jacobowitz wrote:
> On Fri, Mar 14, 2008 at 07:59:55AM +0000, Pedro Alves wrote:
> > This is needed to test/develop async with CLI.  The info info command is
> > very useful to debug gdb itself, and the interrupt command is needed to
> > be able to SIGINT the target.  Without it, the user is trapped in the
> > hole of wanting to quit, but gdb complaining "I can't do that Dave" while
> >  the target is running.  "stop" is there already, so I added break too,
> > although it doesn't work yet.
> >
> > CLI command filtering this way is a gross hack that needs cleaning
> > up anyway.  Since noone is using this currently, I went ahead and
> > installed as obvious.
>
> I'm confused by your choices.  "stop" is not the command you think it
> is.  There's a "stop_command" in breakpoint.c but that's the
> DBX-compatibility version of "break".  The command "stop" doesn't
> do anything; it's only there for hook-stop.
>

I see.  At first I thought it should do what interrupt does, but
then I saw the dbx compatibility version, and just assumed it was it.
(it was calling nothing, and I assumed it was because I didn't have dbx
 mode on ...)

> Also, how can we enable "info"?  That will let you type "info regs"
> while the target is running; does something produce a useful error
> further down?
>

It doesn't let you type info registers, because c->name is "registers"
in that case.  It just let's you type "info".  That is useful for the
hook that switches to the top gdb when debugging gdb in gdb.

> "interrupt" makes sense.  In fact I think this is what whoever added
> "stop" actually meant to add.

Yeah.  Want me to remove stop and breakpoint?

-- 
Pedro Alves

[-- Attachment #2: remove_break_stop.diff --]
[-- Type: text/x-diff, Size: 799 bytes --]

2008-03-14  Pedro Alves  <pedro@codesourcery.com>

	* top.c (execute_command): Disable break and stop
	commands in async mode.

---
 gdb/top.c |    2 --
 1 file changed, 2 deletions(-)

Index: src/gdb/top.c
===================================================================
--- src.orig/gdb/top.c	2008-03-14 15:30:28.000000000 +0000
+++ src/gdb/top.c	2008-03-14 15:30:38.000000000 +0000
@@ -405,8 +405,6 @@ execute_command (char *p, int from_tty)
 	if (strcmp (c->name, "help") != 0
 	    && strcmp (c->name, "pwd") != 0
 	    && strcmp (c->name, "show") != 0
-	    && strcmp (c->name, "stop") != 0
-	    && strcmp (c->name, "break") != 0
 	    && strcmp (c->name, "info") != 0
 	    && strcmp (c->name, "interrupt") != 0)
 	  error (_("Cannot execute this command while the target is running."));

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

* Re: enable a couple of useful cli commands in async mode.
  2008-03-14 15:33   ` Pedro Alves
@ 2008-03-14 15:43     ` Daniel Jacobowitz
  0 siblings, 0 replies; 4+ messages in thread
From: Daniel Jacobowitz @ 2008-03-14 15:43 UTC (permalink / raw)
  To: Pedro Alves; +Cc: gdb-patches

On Fri, Mar 14, 2008 at 03:32:58PM +0000, Pedro Alves wrote:
> > Also, how can we enable "info"?  That will let you type "info regs"
> > while the target is running; does something produce a useful error
> > further down?
> >
> 
> It doesn't let you type info registers, because c->name is "registers"
> in that case.  It just let's you type "info".  That is useful for the
> hook that switches to the top gdb when debugging gdb in gdb.

Hah!  You're right.  We really do have to get rid of this command
filter.

> > "interrupt" makes sense.  In fact I think this is what whoever added
> > "stop" actually meant to add.
> 
> Yeah.  Want me to remove stop and breakpoint?

Yes please, patch is OK.  We'll be back to break...

-- 
Daniel Jacobowitz
CodeSourcery


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

end of thread, other threads:[~2008-03-14 15:43 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-03-14  8:00 enable a couple of useful cli commands in async mode Pedro Alves
2008-03-14 14:36 ` Daniel Jacobowitz
2008-03-14 15:33   ` Pedro Alves
2008-03-14 15:43     ` Daniel Jacobowitz

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