Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* GDB does not respond to CTRL+Z and CTRL+C
@ 2006-06-20 17:03 Christoph Bartoschek
  2006-06-20 17:59 ` Daniel Jacobowitz
  0 siblings, 1 reply; 6+ messages in thread
From: Christoph Bartoschek @ 2006-06-20 17:03 UTC (permalink / raw)
  To: gdb

Hi,

when I attach to a process and continue it I cannot stop it again by pressing 
CTRL+Z or CTRL+C. Gdb does not respond to these signals.

To be able to stop intercept debugging I have to switch to another console:

kill -STOP <pid of gdb>

and then put it back into foreground.

After this sequence gdb responds to CTRL+Z and CTRL+C. What could be wrong?

Christoph


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

* Re: GDB does not respond to CTRL+Z and CTRL+C
  2006-06-20 17:03 GDB does not respond to CTRL+Z and CTRL+C Christoph Bartoschek
@ 2006-06-20 17:59 ` Daniel Jacobowitz
  2006-06-20 18:04   ` Christoph Bartoschek
  0 siblings, 1 reply; 6+ messages in thread
From: Daniel Jacobowitz @ 2006-06-20 17:59 UTC (permalink / raw)
  To: Christoph Bartoschek; +Cc: gdb

On Tue, Jun 20, 2006 at 06:27:25PM +0200, Christoph Bartoschek wrote:
> Hi,
> 
> when I attach to a process and continue it I cannot stop it again by pressing 
> CTRL+Z or CTRL+C. Gdb does not respond to these signals.
> 
> To be able to stop intercept debugging I have to switch to another console:
> 
> kill -STOP <pid of gdb>
> 
> and then put it back into foreground.
> 
> After this sequence gdb responds to CTRL+Z and CTRL+C. What could be wrong?

It works for me; does it work for you if you debug a simple process (I
usually use /bin/cat when I want something I can attach to)?

-- 
Daniel Jacobowitz
CodeSourcery


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

* Re: GDB does not respond to CTRL+Z and CTRL+C
  2006-06-20 17:59 ` Daniel Jacobowitz
@ 2006-06-20 18:04   ` Christoph Bartoschek
  2006-06-20 18:19     ` Daniel Jacobowitz
  0 siblings, 1 reply; 6+ messages in thread
From: Christoph Bartoschek @ 2006-06-20 18:04 UTC (permalink / raw)
  To: gdb

Am Dienstag 20 Juni 2006 19:03 schrieb Daniel Jacobowitz:

> It works for me; does it work for you if you debug a simple process (I
> usually use /bin/cat when I want something I can attach to)?

It works when I attach to cat or tail -f but not when I attach to our 
programm.

Christoph Bartoschek


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

* Re: GDB does not respond to CTRL+Z and CTRL+C
  2006-06-20 18:04   ` Christoph Bartoschek
@ 2006-06-20 18:19     ` Daniel Jacobowitz
  2006-06-20 18:31       ` Christoph Bartoschek
  0 siblings, 1 reply; 6+ messages in thread
From: Daniel Jacobowitz @ 2006-06-20 18:19 UTC (permalink / raw)
  To: gdb

On Tue, Jun 20, 2006 at 08:02:05PM +0200, Christoph Bartoschek wrote:
> Am Dienstag 20 Juni 2006 19:03 schrieb Daniel Jacobowitz:
> 
> > It works for me; does it work for you if you debug a simple process (I
> > usually use /bin/cat when I want something I can attach to)?
> 
> It works when I attach to cat or tail -f but not when I attach to our 
> programm.

Then it is likely that your program is blocking the signal.  GDB
doesn't handle either directly; it forwards them to the program and
lets the OS handle delivery.

-- 
Daniel Jacobowitz
CodeSourcery


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

* Re: GDB does not respond to CTRL+Z and CTRL+C
  2006-06-20 18:19     ` Daniel Jacobowitz
@ 2006-06-20 18:31       ` Christoph Bartoschek
  2006-06-20 20:08         ` Daniel Jacobowitz
  0 siblings, 1 reply; 6+ messages in thread
From: Christoph Bartoschek @ 2006-06-20 18:31 UTC (permalink / raw)
  To: gdb


> Then it is likely that your program is blocking the signal.  GDB
> doesn't handle either directly; it forwards them to the program and
> lets the OS handle delivery.

I do not think that we block the signal. However, I have to check the code.
But this does not explain why I am able to use CTRL+Z and CTRL+C as intended 
after sending SIGSTOP directly to GDB and foregrounding it again.

CTRL+Z and CTRL+C are only ignored until GDB receives the first SIGSTOP via 
the kill command. If the signals are blocked, then I would expect that GDB  
behaves similarly before and after SIGSTOP.

If the signals are really blocked, how should one interrupt debugging to set 
breakpoints for example?

Christoph Bartoschek


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

* Re: GDB does not respond to CTRL+Z and CTRL+C
  2006-06-20 18:31       ` Christoph Bartoschek
@ 2006-06-20 20:08         ` Daniel Jacobowitz
  0 siblings, 0 replies; 6+ messages in thread
From: Daniel Jacobowitz @ 2006-06-20 20:08 UTC (permalink / raw)
  To: gdb

On Tue, Jun 20, 2006 at 08:18:56PM +0200, Christoph Bartoschek wrote:
> 
> > Then it is likely that your program is blocking the signal.  GDB
> > doesn't handle either directly; it forwards them to the program and
> > lets the OS handle delivery.
> 
> I do not think that we block the signal. However, I have to check the code.
> But this does not explain why I am able to use CTRL+Z and CTRL+C as intended 
> after sending SIGSTOP directly to GDB and foregrounding it again.
> 
> CTRL+Z and CTRL+C are only ignored until GDB receives the first SIGSTOP via 
> the kill command. If the signals are blocked, then I would expect that GDB  
> behaves similarly before and after SIGSTOP.

I don't know what's going on and can't reproduce it; you'd have to
figure this out yourself, I'm afraid.

> If the signals are really blocked, how should one interrupt debugging to set 
> breakpoints for example?

Try sending the program (not GDB) a SIGSTOP.  Don't confuse this with
CTRL-Z; that sends SIGTSTP, which can be blocked, but SIGSTOP can not.

-- 
Daniel Jacobowitz
CodeSourcery


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

end of thread, other threads:[~2006-06-20 18:31 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-06-20 17:03 GDB does not respond to CTRL+Z and CTRL+C Christoph Bartoschek
2006-06-20 17:59 ` Daniel Jacobowitz
2006-06-20 18:04   ` Christoph Bartoschek
2006-06-20 18:19     ` Daniel Jacobowitz
2006-06-20 18:31       ` Christoph Bartoschek
2006-06-20 20:08         ` Daniel Jacobowitz

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