public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* A patch I'd like to propose.
@ 2010-04-14 11:59 Chris Moller
  2010-04-14 14:19 ` Phil Muldoon
  2010-04-14 17:05 ` Joel Brobecker
  0 siblings, 2 replies; 6+ messages in thread
From: Chris Moller @ 2010-04-14 11:59 UTC (permalink / raw)
  To: gdb-patches

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

Adds the command "quickquit," aliased to "qq," to cli/cli-cmds.c.   It 
eliminates that annoying quit_confirm() when quitting gdb.

[-- Attachment #2: quickquit.patch --]
[-- Type: text/x-patch, Size: 1689 bytes --]

Index: cli-cmds.c
===================================================================
RCS file: /cvs/src/src/gdb/cli/cli-cmds.c,v
retrieving revision 1.100
diff -u -r1.100 cli-cmds.c
--- cli-cmds.c	9 Apr 2010 03:00:58 -0000	1.100
+++ cli-cmds.c	14 Apr 2010 11:49:19 -0000
@@ -329,7 +329,7 @@
   immediate_quit--;
 }
 
-/* Handle the quit command.  */
+/* Handle the quit commands.  */
 
 void
 quit_command (char *args, int from_tty)
@@ -342,6 +342,14 @@
   quit_force (args, from_tty);
 }
 
+void
+quick_quit_command (char *args, int from_tty)
+{
+  disconnect_tracing (from_tty);
+
+  quit_force (args, from_tty);
+}
+
 static void
 pwd_command (char *args, int from_tty)
 {
@@ -1400,10 +1408,13 @@
 			show_script_ext_mode,
 			&setlist, &showlist);
 
+  add_com ("quickquit", class_support, quick_quit_command,
+	   _("Exit gdb without confirmation."));
   add_com ("quit", class_support, quit_command, _("Exit gdb."));
   c = add_com ("help", class_support, help_command,
 	       _("Print list of commands."));
   set_cmd_completer (c, command_completer);
+  add_com_alias ("qq", "quickquit", class_support, 1);
   add_com_alias ("q", "quit", class_support, 1);
   add_com_alias ("h", "help", class_support, 1);
 
Index: cli-cmds.h
===================================================================
RCS file: /cvs/src/src/gdb/cli/cli-cmds.h,v
retrieving revision 1.14
diff -u -r1.14 cli-cmds.h
--- cli-cmds.h	1 Jan 2010 07:31:46 -0000	1.14
+++ cli-cmds.h	14 Apr 2010 11:49:19 -0000
@@ -119,6 +119,7 @@
 
 /* Exported to gdb/top.c and gdb/main.c */
 
+extern void quick_quit_command (char *, int);
 extern void quit_command (char *, int);
 
 extern void source_script (char *, int);

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

* Re: A patch I'd like to propose.
  2010-04-14 11:59 A patch I'd like to propose Chris Moller
@ 2010-04-14 14:19 ` Phil Muldoon
  2010-04-14 14:29   ` Chris Moller
  2010-04-14 17:05 ` Joel Brobecker
  1 sibling, 1 reply; 6+ messages in thread
From: Phil Muldoon @ 2010-04-14 14:19 UTC (permalink / raw)
  To: Chris Moller; +Cc: gdb-patches

On 04/14/2010 12:59 PM, Chris Moller wrote:
> Adds the command "quickquit," aliased to "qq," to cli/cli-cmds.c.   It
> eliminates that annoying quit_confirm() when quitting gdb.

'set confirm off' works for me?  Though this is not the default it
seems.  Is this orthogonal to your request, or did you want an
explicit command to act regardless of confirm off/on?

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

* Re: A patch I'd like to propose.
  2010-04-14 14:19 ` Phil Muldoon
@ 2010-04-14 14:29   ` Chris Moller
  2010-04-14 17:20     ` Pedro Alves
  0 siblings, 1 reply; 6+ messages in thread
From: Chris Moller @ 2010-04-14 14:29 UTC (permalink / raw)
  To: Phil Muldoon; +Cc: gdb-patches

On 04/14/10 10:19, Phil Muldoon wrote:
> On 04/14/2010 12:59 PM, Chris Moller wrote:
>    
>> Adds the command "quickquit," aliased to "qq," to cli/cli-cmds.c.   It
>> eliminates that annoying quit_confirm() when quitting gdb.
>>      
>
> 'set confirm off' works for me?  Though this is not the default it
> seems.  Is this orthogonal to your request, or did you want an
> explicit command to act regardless of confirm off/on?
>    

I'm looking for something that always works without me having to make 
any special arrangement for it.  I use a lot of bizarre environments in 
debugging and a lot of the time I've forgotten things like copying over 
my usual~/.gdbinit


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

* Re: A patch I'd like to propose.
  2010-04-14 11:59 A patch I'd like to propose Chris Moller
  2010-04-14 14:19 ` Phil Muldoon
@ 2010-04-14 17:05 ` Joel Brobecker
  2010-04-14 17:20   ` Michael Snyder
  1 sibling, 1 reply; 6+ messages in thread
From: Joel Brobecker @ 2010-04-14 17:05 UTC (permalink / raw)
  To: Chris Moller; +Cc: gdb-patches

> Adds the command "quickquit," aliased to "qq," to cli/cli-cmds.c.
> It eliminates that annoying quit_confirm() when quitting gdb.

I like the idea of being able to quit without having to confirm.
Either a new command, or using a switch? We seem to be using command
switches more and more, lately.  I assume we want to make this
sufficiently more convienient than typing y-ENTER, so maybe "qq"
is the way to go...

-- 
Joel

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

* Re: A patch I'd like to propose.
  2010-04-14 17:05 ` Joel Brobecker
@ 2010-04-14 17:20   ` Michael Snyder
  0 siblings, 0 replies; 6+ messages in thread
From: Michael Snyder @ 2010-04-14 17:20 UTC (permalink / raw)
  To: Joel Brobecker; +Cc: Chris Moller, gdb-patches

Joel Brobecker wrote:
>> Adds the command "quickquit," aliased to "qq," to cli/cli-cmds.c.
>> It eliminates that annoying quit_confirm() when quitting gdb.
> 
> I like the idea of being able to quit without having to confirm.
> Either a new command, or using a switch? We seem to be using command
> switches more and more, lately.  I assume we want to make this
> sufficiently more convienient than typing y-ENTER, so maybe "qq"
> is the way to go...
> 

I don't suppose "q!"....   just kidding!  ;-)

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

* Re: A patch I'd like to propose.
  2010-04-14 14:29   ` Chris Moller
@ 2010-04-14 17:20     ` Pedro Alves
  0 siblings, 0 replies; 6+ messages in thread
From: Pedro Alves @ 2010-04-14 17:20 UTC (permalink / raw)
  To: gdb-patches; +Cc: Chris Moller, Phil Muldoon

On Wednesday 14 April 2010 15:29:24, Chris Moller wrote:
> On 04/14/10 10:19, Phil Muldoon wrote:
> > On 04/14/2010 12:59 PM, Chris Moller wrote:
> >    
> >> Adds the command "quickquit," aliased to "qq," to cli/cli-cmds.c.   It
> >> eliminates that annoying quit_confirm() when quitting gdb.
> >>      
> >
> > 'set confirm off' works for me?  Though this is not the default it
> > seems.  Is this orthogonal to your request, or did you want an
> > explicit command to act regardless of confirm off/on?
> >    
> 
> I'm looking for something that always works without me having to make 
> any special arrangement for it.  I use a lot of bizarre environments in 
> debugging and a lot of the time I've forgotten things like copying over 
> my usual~/.gdbinit

That's what you should be fixing then, isn't it?  ;-)

 define qq
   set confirm off
   quit
 end

Kinda misses the scripting point we add commands for everything
that's _already_ easily possible, even with CLI scripting.

In any case, I'd be okay with this with the following constrains:

* It was rather called "quit-force", or something similarly, so that:

 - q<tab> does't stop completing to "quit", but instead even
   proposes "quit"/"quit-force" to the user.  As bonus, users notice
   the new command is available.

 - the fact that `qq' is typo-prone is avoided.  E.g., "quit-force" -> qf.

* q, qu, qui, remain unambiguous aliases to "quit".  "quickquit" shares
3 initials with "quit", so q will stop working if aliases are not added.

* You explain whether you mean for this to disable _all_ queries
when quitting or not.  I think that's what you meant.  As is, it
doesn't do that, because e.g.,

 +void
 +quick_quit_command (char *args, int from_tty)
 +{
 +  disconnect_tracing (from_tty);
    ^^^^^^^^^^^^^^^^^^

This can query.

 +
 +  quit_force (args, from_tty);
 +}

* Of course, that this is documented in the manual.

-- 
Pedro Alves

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

end of thread, other threads:[~2010-04-14 17:20 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-04-14 11:59 A patch I'd like to propose Chris Moller
2010-04-14 14:19 ` Phil Muldoon
2010-04-14 14:29   ` Chris Moller
2010-04-14 17:20     ` Pedro Alves
2010-04-14 17:05 ` Joel Brobecker
2010-04-14 17:20   ` Michael Snyder

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).