Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* [rfc/remote] Tell remote stubs which signals are boring
@ 2006-10-25 21:24 Daniel Jacobowitz
  2006-10-25 21:33 ` Mark Kettenis
                   ` (3 more replies)
  0 siblings, 4 replies; 18+ messages in thread
From: Daniel Jacobowitz @ 2006-10-25 21:24 UTC (permalink / raw)
  To: gdb

Some time ago, I got a bug report that gdbserver couldn't be used to
debug a program.  You'd tell it to "continue", and it wouldn't - it
would just spin in place.

We realized eventually that the problem was SIGALRM.  There was a tiny
signal handler running every timer tick (at about 100Hz, if I remember
right).  That's plenty of time for native GDB to notice, resume, and
let the code run.  But if you have to stop the program, including any
threads, and send a packet over a socket to another machine, only to
have GDB tell you that you're not interested in it anyway, then you
never make any progress.  By the time the program returns from its
signal handler, SIGALRM is pending again.

This is the solution I came up with for that problem, adjusted to HEAD
and given a more sensible packet name.  I have a tested implementation
of this patch for HEAD, if my remote protocol choices are acceptable.
The new mechanism is completely transparent to the user.

All comments welcome!

`QPassSignals SIGNAL [;SIGNAL]...'
     Each listed SIGNAL, using the same signal numbering used in
     continue packets and stop responses, should be passed directly to
     the inferior process.  Each SIGNAL list item should be strictly
     greater than the previous item.  These signals do not need to stop
     the inferior, or be reported to GDB.  All other signals should be
     reported to GDB.  Multiple `QPassSignals' packets do not combine;
     any earlier `QPassSignals' list is completely replaced by the new
     list.  This packet improves performance when using `handle SIGNAL
     nostop noprint pass'.

     Reply:
    `OK'
          The request succeeded.

    `E NN'
          An error occurred.  NN are hex digits.

    `'
          An empty reply indicates that `QPassSignals' is not supported
          by the stub.

     Use of this packet is controlled by the `set remote pass-signals'
     command (*note set remote pass-signals: Remote configuration.).
     This packet is not probed by default; the remote stub must request
     it, by supplying an appropriate `qSupported' response (*note
     qSupported::).

-- 
Daniel Jacobowitz
CodeSourcery


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

end of thread, other threads:[~2006-10-26 21:37 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-10-25 21:24 [rfc/remote] Tell remote stubs which signals are boring Daniel Jacobowitz
2006-10-25 21:33 ` Mark Kettenis
2006-10-25 22:56 ` David Daney
2006-10-26  1:40   ` Daniel Jacobowitz
2006-10-26  7:02     ` Eli Zaretskii
2006-10-26  6:57 ` Eli Zaretskii
2006-10-26 12:18   ` Daniel Jacobowitz
2006-10-26 15:01     ` Eli Zaretskii
2006-10-26 15:10       ` Daniel Jacobowitz
2006-10-26 15:18         ` Eli Zaretskii
2006-10-26 15:22           ` Daniel Jacobowitz
2006-10-26 15:27     ` Mark Kettenis
2006-10-26 15:37       ` Daniel Jacobowitz
2006-10-26 17:54         ` Mark Kettenis
2006-10-26 21:11 ` Jim Blandy
2006-10-26 21:16   ` Daniel Jacobowitz
2006-10-26 21:28     ` Jim Blandy
2006-10-26 21:37       ` Daniel Jacobowitz

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