public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Joel Brobecker <brobecker@adacore.com>
To: Brian Vandenberg <phantall@gmail.com>
Cc: gdb-patches@sourceware.org, ro@CeBiTec.Uni-Bielefeld.DE
Subject: Re: [PATCH][PR gdb/8527] Interrupt not functional in Eclipse/CDT on Solaris
Date: Thu, 01 Nov 2018 21:19:00 -0000	[thread overview]
Message-ID: <20181101211949.GB2705@adacore.com> (raw)
In-Reply-To: <CAEJ-0i_YWq+__iD079Z=RNws+pa8QQD4uBqqbLb7jc4QvCdCQQ@mail.gmail.com>

Hi Brian,

> In Solaris:
> 
> 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.
> 
> This is a fix that was proposed for this problem quite awhile ago but
> never implemented; it's been in the Adacore GDB branch for quite
> awhile.
> 
> Without going into unnecessary details I cannot easily run the test
> suite against this change right now.  If this patch gets rejected
> based on that, when I have time I'll see about getting IllumOS
> installed in a VM and test it there, but the problem was originally
> found in sparc Solaris.
> 
> ----
> 
> note: this patch was tested against 8.1.1.  It looks like it probably
> still applies on the 8.2 branch, but I won't be able to test it until
> 8.2 is released.
> 
> -brian
> 
> ps, my assignment/release forms were completed/received 10/30/2017

> gdb/Changelog:
> 2018-08-07  Brian Vandenberg  <phantall@gmail.com>
> 
> 	PR gdb/8527
> 	* procfs.c (proc_wait_for_stop): calls to set_sigint_trap and
> 	clear_sigint_trap.

I'm not sure anyone took the time to answer this message; if not,
I apologize.

I can testify that, for as long as we got the patch in the AdaCore
sources, we never noticed any ill effect. We never got to validate
it against the official testsuite, unfortunately, because for some
reason, when I did so, our Solaris machines would badly crash. Did
you run the testsuite before and after the patch, by any chance?

Rainer (in Cc:) is our maintainer for Solaris, so he may have an opinion.

In the meantime, I have a trivial coding style comment:

> 
> diff --git a/gdb/procfs.c b/gdb/procfs.c
> index 7b7ff45..7cd870c 100644
> --- a/gdb/procfs.c
> +++ b/gdb/procfs.c
> @@ -913,7 +913,12 @@ proc_wait_for_stop (procinfo *pi)
> 
>      procfs_ctl_t cmd = PCWSTOP;
> 
> +    /* PR gdb/8527
> +     * Was not correctly interrupting the inferior process
> +     * when ^C was pressed in the debug terminal.
> +     */

For multiline comments like the above, we do not repeat the '*'
at the beginning of each line. 

       /* PR gdb/8527: Was not correctly interrupting the inferior process
          when ^C was pressed in the debug terminal.  */

And if I may, reading this sentence, it's a bit hard to understand
what the comment is trying to explain. The following might be
a little more precise:

       /* PR gdb/8527: Call set_sigint_trap to make sure that a ctrl-c
          pressed in the debugger terminal gets passed down to the
          inferior, thus causing it to be interrupted.  */

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


-- 
Joel

  reply	other threads:[~2018-11-01 21:19 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-07 19:13 Brian Vandenberg
2018-11-01 21:19 ` Joel Brobecker [this message]
2018-11-01 21:46   ` Brian Vandenberg
2018-11-09 22:08     ` Simon Marchi
2018-11-09 22:22       ` Rainer Orth
2018-11-22 10:19   ` Rainer Orth
2019-02-26 15:14     ` Rainer Orth
2019-02-26 16:09       ` Pedro Alves
2019-02-26 20:03         ` Rainer Orth
2019-02-28 15:16           ` Rainer Orth
2019-03-05 15:47             ` Tom Tromey
2019-03-05 18:58               ` Pedro Alves

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181101211949.GB2705@adacore.com \
    --to=brobecker@adacore.com \
    --cc=gdb-patches@sourceware.org \
    --cc=phantall@gmail.com \
    --cc=ro@CeBiTec.Uni-Bielefeld.DE \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).