Eliminate STOP_SIGNAL, use SIGTSTP directly
authorPedro Alves <palves@redhat.com>
Mon, 6 Nov 2017 15:36:47 +0000 (15:36 +0000)
committerPedro Alves <palves@redhat.com>
Mon, 6 Nov 2017 16:13:05 +0000 (16:13 +0000)
commit6aa899ce25d73c397748e4df926da3fd7e5870e5
treeb11debf0beb0fdef449fd5f62c50958ecf933473
parenta94799ac1e430404fda5cbc181406cf5f3630108
Eliminate STOP_SIGNAL, use SIGTSTP directly

The STOP_SIGNAL macro was originally added for Convex Unix
(https://en.wikipedia.org/wiki/Convex_Computer).

In:

  git show 7a67dd45ca1c:gdb/m-convex.h

we see:

~~~
  /* Use SIGCONT rather than SIGTSTP because convex Unix occasionally
     turkeys SIGTSTP.  I think.  */

  #define STOP_SIGNAL SIGCONT
~~~

That's gdb-3.5, 1990...  In gdb/ChangeLog-3.x we see:

~~~
Tue Apr 18 13:43:37 1989  Randall Smith  (randy at apple-gunkies.ai.mit.edu)

        Various changes involved in 1) getting gdb to work on the convex,
[...]
        Made whatever signal indicates a stop configurable (via macro
        STOP_SIGNAL).
        (main): Setup use of above as a signal handler.  Added check for
        "-nw" in args already processed.
        (command_line_input): SIGTSTP ==>STOP_SIGNAL.
~~~

Support for Convex Unix is long gone, and nothing else overrides
STOP_SIGNAL.  So just use SIGTSTP directly, removing a little
obfuscation.

(I don't really understand why we override [1] readline's SIGTSTP
handler (only) when reading scripts (and then fail to restore it
properly, assuming SIG_DFL...), but I'll leave that for another pass.

[1] - Actually, starting with readline 6.3, readline is no longer
installing its handlers while GDB is in control...)

gdb/ChangeLog:
2017-11-06  Pedro Alves  <palves@redhat.com>

* event-top.c: Check SIGTSTP instead of STOP_SIGNAL thoughout.
(async_init_signals): Adjust.
(handle_stop_sig): Rename to ...
(handle_sigtstp): ... this.
(async_stop_sig): Rename to ...
(async_sigtstp_handler): ... this, and delete STOP_SIGNAL !=
SIGTSTP path.
* event-top.h: Move signal.h include to the top.  Check SIGTSTP
instead of STOP_SIGNAL thoughout.
(handle_stop_sig): Rename to ...
(handle_sigtstp): ... this.
* top.c (command_line_input): Replace STOP_SIGNAL -> SIGTSTP.
gdb/ChangeLog
gdb/event-top.c
gdb/event-top.h
gdb/top.c
This page took 0.027659 seconds and 4 git commands to generate.