Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* usability: exiting from GDB
@ 2006-11-27  5:38 John Pye
  2006-11-27  6:50 ` Eli Zaretskii
                   ` (2 more replies)
  0 siblings, 3 replies; 20+ messages in thread
From: John Pye @ 2006-11-27  5:38 UTC (permalink / raw)
  To: gdb

Hi all

GDB is a great tool that efficiently does what it needs to do, and I use
it almost every day. But there's something about it that annoys be every
single time I use it. I wonder if this is something that other people
find, and if so, perhaps there's solution?

What I would like is that (a) the 'ctrl-C' behaviour from the gdb prompt
was changed so that instead of (I think uselessly) outputting 'Quit' and
bringing up another prompt line, it actually *did* quit GDB. Or,
alternatively, (b) that the following prompted could somehow be
persistently disabled: "The program is running. Exit anyway? (y or n)".

I often find that in exiting GDB, which requires ctrl-D to be pressed
twice, I press ctrl-D three times and end up also logging out of my
terminal program, which is annoying.

Another issue is that after exiting GDB via ctrl-D-ctrl-D, GDB doesn't
output a newline, which causes the following bash input line to be
messed up.

I realise that this is a long-winded email about a very minor issue.
Humour me?

Cheers
JP


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

* Re: usability: exiting from GDB
  2006-11-27  5:38 usability: exiting from GDB John Pye
@ 2006-11-27  6:50 ` Eli Zaretskii
  2006-11-27  7:43   ` John Pye
  2006-11-27 13:51 ` Daniel Jacobowitz
  2006-11-27 14:46 ` Andrew STUBBS
  2 siblings, 1 reply; 20+ messages in thread
From: Eli Zaretskii @ 2006-11-27  6:50 UTC (permalink / raw)
  To: John Pye; +Cc: gdb

> Date: Mon, 27 Nov 2006 16:37:57 +1100
> From: John Pye <john.pye@anu.edu.au>
> 
> I often find that in exiting GDB, which requires ctrl-D to be pressed
> twice, I press ctrl-D three times and end up also logging out of my
> terminal program, which is annoying.

Any reasons why you don't use `q'?  That's one-character command, and
it doesn't run any risk to inadvertently log you off.


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

* Re: usability: exiting from GDB
  2006-11-27  6:50 ` Eli Zaretskii
@ 2006-11-27  7:43   ` John Pye
  2006-11-27 13:42     ` Eli Zaretskii
  0 siblings, 1 reply; 20+ messages in thread
From: John Pye @ 2006-11-27  7:43 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: gdb

Hi Eli

I guess the reason for that is that I think of gdb as a 'shell' that can
be exited in the same way as bash, ipython, etc.

About that 'ctrl-C' behaviour -- any reason why this couldn't be changed
(perhaps to do with signal handlers or somesuch)? Or what about
user-configurable exit confirmation -- that might be the most sensible
course of action, perhaps?

Cheers
JP

Eli Zaretskii wrote:
>> Date: Mon, 27 Nov 2006 16:37:57 +1100
>> From: John Pye <john.pye@anu.edu.au>
>>
>> I often find that in exiting GDB, which requires ctrl-D to be pressed
>> twice, I press ctrl-D three times and end up also logging out of my
>> terminal program, which is annoying.
>>     
>
> Any reasons why you don't use `q'?  That's one-character command, and
> it doesn't run any risk to inadvertently log you off.
>   


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

* Re: usability: exiting from GDB
  2006-11-27  7:43   ` John Pye
@ 2006-11-27 13:42     ` Eli Zaretskii
  0 siblings, 0 replies; 20+ messages in thread
From: Eli Zaretskii @ 2006-11-27 13:42 UTC (permalink / raw)
  To: John Pye; +Cc: gdb

> Date: Mon, 27 Nov 2006 18:42:43 +1100
> From: John Pye <john.pye@anu.edu.au>
> CC:  gdb@sourceware.org
> 
> About that 'ctrl-C' behaviour -- any reason why this couldn't be changed
> (perhaps to do with signal handlers or somesuch)?

I don't think signal handlers are the issue.  I think the main
problems with this are: (1) there might be asynchronous commands
running even though you are sitting at the GDB prompt, and (2) due to
relatively slow human reaction times, you could hit Ctrl-C to
interrupt a command, but when that Ctrl-C gets to GDB the command
could already be done, which will dump you out of GDB.

But maybe treating Ctrl-C as q (with query) would be okay, I don't
know.


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

* Re: usability: exiting from GDB
  2006-11-27  5:38 usability: exiting from GDB John Pye
  2006-11-27  6:50 ` Eli Zaretskii
@ 2006-11-27 13:51 ` Daniel Jacobowitz
  2006-11-27 14:46 ` Andrew STUBBS
  2 siblings, 0 replies; 20+ messages in thread
From: Daniel Jacobowitz @ 2006-11-27 13:51 UTC (permalink / raw)
  To: gdb

On Mon, Nov 27, 2006 at 04:37:57PM +1100, John Pye wrote:
> What I would like is that (a) the 'ctrl-C' behaviour from the gdb prompt
> was changed so that instead of (I think uselessly) outputting 'Quit' and
> bringing up another prompt line, it actually *did* quit GDB.

As Eli explained, that's not a good idea.  You could accidentally quit
GDB while trying to interrupt your program.  Does C-c quit shells?  No,
it just kills the current input line.

> Or,
> alternatively, (b) that the following prompted could somehow be
> persistently disabled: "The program is running. Exit anyway? (y or n)".
> 
> I often find that in exiting GDB, which requires ctrl-D to be pressed
> twice, I press ctrl-D three times and end up also logging out of my
> terminal program, which is annoying.

I don't know about you, but my shell prints a warning message if I try
to C-d while there are background jobs running.  GDB's behaving
exactly the same :-)

You can't disable just that one prompt, but you could disable
prompts with "set confirm off".

> Another issue is that after exiting GDB via ctrl-D-ctrl-D, GDB doesn't
> output a newline, which causes the following bash input line to be
> messed up.

This has been reported as a bug before; it ought to be easy to fix.

-- 
Daniel Jacobowitz
CodeSourcery


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

* Re: usability: exiting from GDB
  2006-11-27  5:38 usability: exiting from GDB John Pye
  2006-11-27  6:50 ` Eli Zaretskii
  2006-11-27 13:51 ` Daniel Jacobowitz
@ 2006-11-27 14:46 ` Andrew STUBBS
  2006-11-29  3:27   ` John Pye
  2 siblings, 1 reply; 20+ messages in thread
From: Andrew STUBBS @ 2006-11-27 14:46 UTC (permalink / raw)
  To: John Pye; +Cc: gdb

John Pye wrote:
> What I would like is that (a) the 'ctrl-C' behaviour from the gdb prompt
> was changed so that instead of (I think uselessly) outputting 'Quit' and
> bringing up another prompt line, it actually *did* quit GDB. Or,

Ctrl-C stops the GDB command that is currently running and, if 
necessary, stops the program being debugged. It isn't supposed to quit 
the debugger and, if it did, that would annoy me in exactly the same way 
you complain about Crtl-D.

If there is no command running then Crtl-C doesn't mean much - maybe the 
'Quit' message should be silenced somehow.

> alternatively, (b) that the following prompted could somehow be
> persistently disabled: "The program is running. Exit anyway? (y or n)".

Put this in your .gdbinit file:

define hook-quit
   set confirm off
end

Obviously this only works if you actually use the quit (or q) command.

> I often find that in exiting GDB, which requires ctrl-D to be pressed
> twice, I press ctrl-D three times and end up also logging out of my
> terminal program, which is annoying.

If I hit my light switch twice the light doesn't stay on. Not helpful, 
but there it is.

> Another issue is that after exiting GDB via ctrl-D-ctrl-D, GDB doesn't
> output a newline, which causes the following bash input line to be
> messed up.

I expect that could be changed. Care to submit a patch?

Andrew


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

* Re: usability: exiting from GDB
  2006-11-27 14:46 ` Andrew STUBBS
@ 2006-11-29  3:27   ` John Pye
  2006-11-29  4:50     ` Daniel Jacobowitz
  2006-11-29  5:04     ` Joel Brobecker
  0 siblings, 2 replies; 20+ messages in thread
From: John Pye @ 2006-11-29  3:27 UTC (permalink / raw)
  To: Andrew STUBBS; +Cc: gdb

Hi Andrew,

Andrew STUBBS wrote:
> John Pye wrote:
>> What I would like is that (a) the 'ctrl-C' behaviour from the gdb prompt
>> was changed so that instead of (I think uselessly) outputting 'Quit' and
>> bringing up another prompt line, it actually *did* quit GDB. Or,
>
> Ctrl-C stops the GDB command that is currently running and, if
> necessary, stops the program being debugged. It isn't supposed to quit
> the debugger and, if it did, that would annoy me in exactly the same
> way you complain about Crtl-D.
>
> If there is no command running then Crtl-C doesn't mean much - maybe
> the 'Quit' message should be silenced somehow.

I think that the 'Quit' message is great. But instead of *suggesting*,
it should ask for confirmation: "Ctrl-C pressed from GDB console. Do you
want to exit? (y or n)". Then this confirmation could be turned off
somewhere in the configuration settings.

>
>> alternatively, (b) that the following prompted could somehow be
>> persistently disabled: "The program is running. Exit anyway? (y or n)".
>
> Put this in your .gdbinit file:
>
> define hook-quit
>   set confirm off
> end
>
> Obviously this only works if you actually use the quit (or q) command.

This suggestion would be great if the Ctrl-C action brought up the "Exit
anyway?" question, as I said above.

Cheers
JP


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

* Re: usability: exiting from GDB
  2006-11-29  3:27   ` John Pye
@ 2006-11-29  4:50     ` Daniel Jacobowitz
  2006-11-29  5:04     ` Joel Brobecker
  1 sibling, 0 replies; 20+ messages in thread
From: Daniel Jacobowitz @ 2006-11-29  4:50 UTC (permalink / raw)
  To: John Pye; +Cc: Andrew STUBBS, gdb

On Wed, Nov 29, 2006 at 02:26:48PM +1100, John Pye wrote:
> I think that the 'Quit' message is great. But instead of *suggesting*,
> it should ask for confirmation: "Ctrl-C pressed from GDB console. Do you
> want to exit? (y or n)". Then this confirmation could be turned off
> somewhere in the configuration settings.

It's not suggesting that you exit.  It means, roughly, the previously
executing gdb command has been quit.

-- 
Daniel Jacobowitz
CodeSourcery


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

* Re: usability: exiting from GDB
  2006-11-29  3:27   ` John Pye
  2006-11-29  4:50     ` Daniel Jacobowitz
@ 2006-11-29  5:04     ` Joel Brobecker
  2006-11-29  7:16       ` John Pye
  1 sibling, 1 reply; 20+ messages in thread
From: Joel Brobecker @ 2006-11-29  5:04 UTC (permalink / raw)
  To: John Pye; +Cc: Andrew STUBBS, gdb

> I think that the 'Quit' message is great. But instead of *suggesting*,
> it should ask for confirmation: "Ctrl-C pressed from GDB console. Do you
> want to exit? (y or n)". Then this confirmation could be turned off
> somewhere in the configuration settings.

I must say, as a user, this behavior would sure surprise me. I don't
understand what the problem is with hitting 'q' followed by Enter.
When you think about it, the suggestion above makes it even longer
than it already is.

-- 
Joel


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

* Re: usability: exiting from GDB
  2006-11-29  5:04     ` Joel Brobecker
@ 2006-11-29  7:16       ` John Pye
  2006-11-29 13:38         ` Daniel Jacobowitz
  0 siblings, 1 reply; 20+ messages in thread
From: John Pye @ 2006-11-29  7:16 UTC (permalink / raw)
  To: Joel Brobecker; +Cc: Andrew STUBBS, gdb

The whole thing is that gdb is like a shell. And shells can be exited by
typing ctrl-D. It's about consistency with other similar tools. That's
my feeling, anyway.

Joel Brobecker wrote:
>> I think that the 'Quit' message is great. But instead of *suggesting*,
>> it should ask for confirmation: "Ctrl-C pressed from GDB console. Do you
>> want to exit? (y or n)". Then this confirmation could be turned off
>> somewhere in the configuration settings.
>>     
>
> I must say, as a user, this behavior would sure surprise me. I don't
> understand what the problem is with hitting 'q' followed by Enter.
> When you think about it, the suggestion above makes it even longer
> than it already is.
>
>   


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

* Re: usability: exiting from GDB
  2006-11-29  7:16       ` John Pye
@ 2006-11-29 13:38         ` Daniel Jacobowitz
  2006-11-29 14:12           ` Bob Rossi
  2006-11-30  3:59           ` John Pye
  0 siblings, 2 replies; 20+ messages in thread
From: Daniel Jacobowitz @ 2006-11-29 13:38 UTC (permalink / raw)
  To: John Pye; +Cc: Joel Brobecker, Andrew STUBBS, gdb

On Wed, Nov 29, 2006 at 06:16:22PM +1100, John Pye wrote:
> The whole thing is that gdb is like a shell. And shells can be exited by
> typing ctrl-D. It's about consistency with other similar tools. That's
> my feeling, anyway.

Did you read the previous replies to your message?  Shells don't exit
when you press C-c and it would be upsetting to at least some users if
GDB did; it does exit if you press C-d at a prompt.

-- 
Daniel Jacobowitz
CodeSourcery


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

* Re: usability: exiting from GDB
  2006-11-29 13:38         ` Daniel Jacobowitz
@ 2006-11-29 14:12           ` Bob Rossi
  2006-11-30  4:01             ` John Pye
  2006-11-30  3:59           ` John Pye
  1 sibling, 1 reply; 20+ messages in thread
From: Bob Rossi @ 2006-11-29 14:12 UTC (permalink / raw)
  To: John Pye, Joel Brobecker, Andrew STUBBS, gdb

On Wed, Nov 29, 2006 at 08:37:48AM -0500, Daniel Jacobowitz wrote:
> On Wed, Nov 29, 2006 at 06:16:22PM +1100, John Pye wrote:
> > The whole thing is that gdb is like a shell. And shells can be exited by
> > typing ctrl-D. It's about consistency with other similar tools. That's
> > my feeling, anyway.
> 
> Did you read the previous replies to your message?  Shells don't exit
> when you press C-c and it would be upsetting to at least some users if
> GDB did; it does exit if you press C-d at a prompt.

Agreed. I for one do _not_ expect GDB to exit when I type ^c at the
prompt. GDB already has the correct behavior in terms of ^c and ^d.
That is, it behaves like bash.

Bob Rossi


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

* Re: usability: exiting from GDB
  2006-11-29 13:38         ` Daniel Jacobowitz
  2006-11-29 14:12           ` Bob Rossi
@ 2006-11-30  3:59           ` John Pye
  2006-11-30 10:10             ` Andrew STUBBS
  2006-11-30 21:49             ` Michael Snyder
  1 sibling, 2 replies; 20+ messages in thread
From: John Pye @ 2006-11-30  3:59 UTC (permalink / raw)
  To: Joel Brobecker, Andrew STUBBS, gdb

Hi again

I have been reading the thread, yes. But my last post wasn't expressed
very clearly, sorry.

The ctrl-D behaviour is what I would prefer, certainly, and this would
be more shell-like. But I don't like the confirmation question "Exit
anyway?".

The hook-quit thing does turn off the confirmation in the case of the
"q" command, but *does not* work for the ctrl-D exit method.

I guess the main thing is to get the ctrl-D functionality right.
Presuming that others agree that this change would be desirable?

I find the ctrl-C behaviour unhelpful (ie suggesting I quit instead of
asking me if I'd like to go ahead and do it) but it's not important really.

Cheers

Daniel Jacobowitz wrote:
> On Wed, Nov 29, 2006 at 06:16:22PM +1100, John Pye wrote:
>   
>> The whole thing is that gdb is like a shell. And shells can be exited by
>> typing ctrl-D. It's about consistency with other similar tools. That's
>> my feeling, anyway.
>>     
>
> Did you read the previous replies to your message?  Shells don't exit
> when you press C-c and it would be upsetting to at least some users if
> GDB did; it does exit if you press C-d at a prompt.
>
>   


Daniel Jacobowitz wrote:
> On Wed, Nov 29, 2006 at 06:16:22PM +1100, John Pye wrote:
>   
>> The whole thing is that gdb is like a shell. And shells can be exited by
>> typing ctrl-D. It's about consistency with other similar tools. That's
>> my feeling, anyway.
>>     
>
> Did you read the previous replies to your message?  Shells don't exit
> when you press C-c and it would be upsetting to at least some users if
> GDB did; it does exit if you press C-d at a prompt.
>
>   


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

* Re: usability: exiting from GDB
  2006-11-29 14:12           ` Bob Rossi
@ 2006-11-30  4:01             ` John Pye
  2006-11-30  8:32               ` Brian Dessent
  0 siblings, 1 reply; 20+ messages in thread
From: John Pye @ 2006-11-30  4:01 UTC (permalink / raw)
  To: Bob Rossi; +Cc: Joel Brobecker, Andrew STUBBS, gdb

Bob Rossi wrote:
>
> Agreed. I for one do _not_ expect GDB to exit when I type ^c at the
> prompt. GDB already has the correct behavior in terms of ^c and ^d.
> That is, it behaves like bash.
Note the vital difference here: bash never asks for confirmation on ctrl-D.

Cheers
JP



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

* Re: usability: exiting from GDB
  2006-11-30  4:01             ` John Pye
@ 2006-11-30  8:32               ` Brian Dessent
  2006-11-30 11:58                 ` John Pye
  0 siblings, 1 reply; 20+ messages in thread
From: Brian Dessent @ 2006-11-30  8:32 UTC (permalink / raw)
  To: gdb

John Pye wrote:

> Note the vital difference here: bash never asks for confirmation on ctrl-D.

Did you really read the existing replies in this thread?

Daniel Jacobowitz wrote:

> I don't know about you, but my shell prints a warning message if I try
> to C-d while there are background jobs running.  GDB's behaving
> exactly the same :-)
> 
> You can't disable just that one prompt, but you could disable
> prompts with "set confirm off".

Brian


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

* Re: usability: exiting from GDB
  2006-11-30  3:59           ` John Pye
@ 2006-11-30 10:10             ` Andrew STUBBS
  2006-11-30 11:51               ` John Pye
  2006-11-30 21:49             ` Michael Snyder
  1 sibling, 1 reply; 20+ messages in thread
From: Andrew STUBBS @ 2006-11-30 10:10 UTC (permalink / raw)
  To: John Pye; +Cc: Joel Brobecker, gdb

John Pye wrote:
> The ctrl-D behaviour is what I would prefer, certainly, and this would
> be more shell-like. But I don't like the confirmation question "Exit
> anyway?".

It *is* precisely shell like. Try this:

bash$ cat &
bash$ <Ctrl-D>

bash says:

There are stopped jobs.

[1]+  Stopped                 cat

> The hook-quit thing does turn off the confirmation in the case of the
> "q" command, but *does not* work for the ctrl-D exit method.

As advertised.

> I guess the main thing is to get the ctrl-D functionality right.
> Presuming that others agree that this change would be desirable?

I think everyone is agreed that the Ctrl-D behaviour is precisely the 
same as that of bash and other shells, with the one exception that it 
does not print a line break.

> I find the ctrl-C behaviour unhelpful (ie suggesting I quit instead of
> asking me if I'd like to go ahead and do it) but it's not important really.

The Ctrl-C behaviour is also only cosmetically different. It's hard to 
see how to explain this any more clearly than has already been done, but 
here goes.

In both cases Ctrl-C interrupts the currently running command:

bash$ cat
<Ctrl-C>
bash$

(gdb) continue
Continuing.
<Ctrl-C>

Program received signal SIGINT, Interrupt.
0xblahblah in ?? ()
(gdb)

In neither case does it quit the "shell".

When you Ctrl-C a continue command it prints a message explaining where 
the inferior program has stopped.

When you Ctrl-C another GDB command it prints a message 'Quit' to tell 
you that the command exited early, potentially. If no command was 
running then the effect is *only* that you see this message. It is *not* 
any sort of suggestion. If it did not print those four characters, 
'Quit', the behaviour would be exactly the same as bash.

GDB could certainly improve it's Ctrl-C handling - there a many commands 
that just can't be interrupted - and perhaps the aesthetics could also 
be improved, but in principle it is exactly the same as that used by bash.

Hope that explains it for you

Andrew


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

* Re: usability: exiting from GDB
  2006-11-30 10:10             ` Andrew STUBBS
@ 2006-11-30 11:51               ` John Pye
  0 siblings, 0 replies; 20+ messages in thread
From: John Pye @ 2006-11-30 11:51 UTC (permalink / raw)
  To: Andrew STUBBS; +Cc: Joel Brobecker, gdb

Hi Andrew

Thanks for clarifying. Indeed you are right and the GDB behaviour does
mirror the behaviour of other shells. I hadn't considered the case of
stopped jobs, which I guess *is* analogous.

So the only outcome from my issue was the missing newline when GDB exits.

Thanks all for your comments and feedback.

Cheers
JP


Andrew STUBBS wrote:
> John Pye wrote:
>> The ctrl-D behaviour is what I would prefer, certainly, and this would
>> be more shell-like. But I don't like the confirmation question "Exit
>> anyway?".
>
> It *is* precisely shell like. Try this:
>
> bash$ cat &
> bash$ <Ctrl-D>
>
> bash says:
>
> There are stopped jobs.
>
> [1]+  Stopped                 cat
>
>> The hook-quit thing does turn off the confirmation in the case of the
>> "q" command, but *does not* work for the ctrl-D exit method.
>
> As advertised.
>
>> I guess the main thing is to get the ctrl-D functionality right.
>> Presuming that others agree that this change would be desirable?
>
> I think everyone is agreed that the Ctrl-D behaviour is precisely the
> same as that of bash and other shells, with the one exception that it
> does not print a line break.
>
>> I find the ctrl-C behaviour unhelpful (ie suggesting I quit instead of
>> asking me if I'd like to go ahead and do it) but it's not important
>> really.
>
> The Ctrl-C behaviour is also only cosmetically different. It's hard to
> see how to explain this any more clearly than has already been done,
> but here goes.
>
> In both cases Ctrl-C interrupts the currently running command:
>
> bash$ cat
> <Ctrl-C>
> bash$
>
> (gdb) continue
> Continuing.
> <Ctrl-C>
>
> Program received signal SIGINT, Interrupt.
> 0xblahblah in ?? ()
> (gdb)
>
> In neither case does it quit the "shell".
>
> When you Ctrl-C a continue command it prints a message explaining
> where the inferior program has stopped.
>
> When you Ctrl-C another GDB command it prints a message 'Quit' to tell
> you that the command exited early, potentially. If no command was
> running then the effect is *only* that you see this message. It is
> *not* any sort of suggestion. If it did not print those four
> characters, 'Quit', the behaviour would be exactly the same as bash.
>
> GDB could certainly improve it's Ctrl-C handling - there a many
> commands that just can't be interrupted - and perhaps the aesthetics
> could also be improved, but in principle it is exactly the same as
> that used by bash.
>
> Hope that explains it for you
>
> Andrew


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

* Re: usability: exiting from GDB
  2006-11-30  8:32               ` Brian Dessent
@ 2006-11-30 11:58                 ` John Pye
  2006-11-30 12:34                   ` Andrew STUBBS
  0 siblings, 1 reply; 20+ messages in thread
From: John Pye @ 2006-11-30 11:58 UTC (permalink / raw)
  To: gdb

Brian Dessent wrote:
> John Pye wrote:
>
>   
>> Note the vital difference here: bash never asks for confirmation on ctrl-D.
>>     
> Did you really read the existing replies in this thread?
>   

I was wrong here -- it does *sometimes* ask confirmation, as you've
pointed out.

> Daniel Jacobowitz wrote:
>   
>> I don't know about you, but my shell prints a warning message if I try
>> to C-d while there are background jobs running.  GDB's behaving
>> exactly the same :-)
>>     

I did try this, but not with a suitable examples, perhaps. For example,
I was thinking of:

kompare &
ctrl-D

Also note
su
wget http://example.com/bigfile.iso &
ctrl-D


There is no confirmation request in these case, although I'm not
completely confident on drawing the distinction between these and the
'cat &' case that was given.

As the programs that I tend to be working on are often like this, I
hadn't really notices the 'stopped jobs' warning.

Cheers
JP


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

* Re: usability: exiting from GDB
  2006-11-30 11:58                 ` John Pye
@ 2006-11-30 12:34                   ` Andrew STUBBS
  0 siblings, 0 replies; 20+ messages in thread
From: Andrew STUBBS @ 2006-11-30 12:34 UTC (permalink / raw)
  To: John Pye; +Cc: gdb

John Pye wrote:
> I did try this, but not with a suitable examples, perhaps. For example,
> I was thinking of:
> 
> kompare &
> ctrl-D
> 
> Also note
> su
> wget http://example.com/bigfile.iso &
> ctrl-D
> 
> 
> There is no confirmation request in these case, although I'm not
> completely confident on drawing the distinction between these and the
> 'cat &' case that was given.
> 
> As the programs that I tend to be working on are often like this, I
> hadn't really notices the 'stopped jobs' warning.

The examples you give are not stopped jobs. They are background jobs.

'cat &' starts cat and then tries to put it in the background, but it 
doesn't like that so it stops (I'm not sure what mechanism stops it). 
Other programs are less fussy - they will run in the back ground quite 
happily. When the shell quits, they continue running, still in the 
background.

Try this instead:

bash$ kompare
<Ctrl-Z>
bash$ <Ctrl-D>

The Ctrl-Z stops (pauses) the foreground job. By this mechanism you can 
reproduce the effect with any program that does not have special SIGSTOP 
handling.

Sorry if I sent you a slightly less than general case example.

Andrew


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

* Re: usability: exiting from GDB
  2006-11-30  3:59           ` John Pye
  2006-11-30 10:10             ` Andrew STUBBS
@ 2006-11-30 21:49             ` Michael Snyder
  1 sibling, 0 replies; 20+ messages in thread
From: Michael Snyder @ 2006-11-30 21:49 UTC (permalink / raw)
  To: John Pye; +Cc: Joel Brobecker, Andrew STUBBS, gdb

On Thu, 2006-11-30 at 14:59 +1100, John Pye wrote:

> I find the ctrl-C behaviour unhelpful (ie suggesting I quit instead of
> asking me if I'd like to go ahead and do it) but it's not important really.

There's your misunderstanding -- gdb is not suggesting that you quit.
"Quit" is gdb's standard response to SIGINT, ie. ctrl-c.  Ie. it is
responding "ok, I have quit", even though it was not doing anything.

Possibly it would make sense to suppress the "Quit" in this 
circumstance, and just print another prompt.  But I wouldn't
call it a high priority issue, and in async circumstances 
it might not even be the right thing to do.

Michael



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

end of thread, other threads:[~2006-11-30 21:49 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-11-27  5:38 usability: exiting from GDB John Pye
2006-11-27  6:50 ` Eli Zaretskii
2006-11-27  7:43   ` John Pye
2006-11-27 13:42     ` Eli Zaretskii
2006-11-27 13:51 ` Daniel Jacobowitz
2006-11-27 14:46 ` Andrew STUBBS
2006-11-29  3:27   ` John Pye
2006-11-29  4:50     ` Daniel Jacobowitz
2006-11-29  5:04     ` Joel Brobecker
2006-11-29  7:16       ` John Pye
2006-11-29 13:38         ` Daniel Jacobowitz
2006-11-29 14:12           ` Bob Rossi
2006-11-30  4:01             ` John Pye
2006-11-30  8:32               ` Brian Dessent
2006-11-30 11:58                 ` John Pye
2006-11-30 12:34                   ` Andrew STUBBS
2006-11-30  3:59           ` John Pye
2006-11-30 10:10             ` Andrew STUBBS
2006-11-30 11:51               ` John Pye
2006-11-30 21:49             ` Michael Snyder

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