Can't interrupt process without controlling terminal on Solaris (PR gdb/8527)
authorRainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
Thu, 7 Mar 2019 21:00:05 +0000 (22:00 +0100)
committerRainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
Thu, 7 Mar 2019 21:00:05 +0000 (22:00 +0100)
commit6028d151fc820579da1292c4cc393a4bcd3da8f8
tree0a57e862ce5d238576a12afed7c386bfe9897c73
parentb59063c5e210df87e9a33faf8fad72fcf427e72b
Can't interrupt process without controlling terminal on Solaris (PR gdb/8527)

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

Fixed as follows, analogous to what all all other targets do.  Patch from
the PR, recently re-submitted by Brian Vandenberg.

Tested on amd64-pc-solaris2.11, sparcv9-sun-solaris2.11, and
x86_64-pc-linux-gnu.

2019-03-07  Brian Vandenberg  <phantall@gmail.com>
    Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

gdb:
PR gdb/8527
* procfs.c (proc_wait_for_stop): Wrap write of PCWSTOP in
set_sigint_trap, clear_sigint_trap.

gdb/testsuite:
PR gdb/8527
* gdb.base/interrupt-daemon-attach.c,
gdb.base/interrupt-daemon-attach.exp: New test.
gdb/ChangeLog
gdb/procfs.c
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.base/interrupt-daemon-attach.c [new file with mode: 0644]
gdb/testsuite/gdb.base/interrupt-daemon-attach.exp [new file with mode: 0644]