[RFC][PATCH][PR gdb/8527] Fix interrupt (^C) in Solaris

Brian Vandenberg phantall@gmail.com
Wed Dec 16 22:17:00 GMT 2015


This patch addresses an issue in Solaris, bug 8527.

The problem:

If gdb attaches to a process that either has no controlling
terminal, or the controlling terminal differs from the one
gdb is running under, hitting ^C doesn't interrupt the
debugged process.

The change makes it possible to interrupt/resume
without any apparent problems, but I don't know the
ramifications of these changes.  I ran across this
issue and a fix that was proposed 12 years ago.

Is this a reasonable change?

-brian
-------------- next part --------------
gdb/Changelog:
2015-12-16  Brian Vandenberg <phantall@gmail.com>

	PR gdb/8527
	* gdb/procfs.c (proc_wait_for_stop): Added set_sigint_trap() & clear_sigint_trap()

diff --git a/gdb/procfs.c b/gdb/procfs.c
index 7b7ff45..7cd870c 100644
--- a/gdb/procfs.c
+++ b/gdb/procfs.c
@@ -1487,7 +1487,12 @@ proc_wait_for_stop (procinfo *pi)
   {
     procfs_ctl_t cmd = PCWSTOP;

+    set_sigint_trap();
+
     win = (write (pi->ctl_fd, (char *) &cmd, sizeof (cmd)) == sizeof (cmd));
+
+    clear_sigint_trap();
+
     /* We been runnin' and we stopped -- need to update status.  */
     pi->status_valid = 0;
   }


More information about the Gdb-patches mailing list