Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Michael Snyder <msnyder@redhat.com>
To: Mark Kettenis <kettenis@chello.nl>
Cc: drow@mvista.com, gdb-patches@sources.redhat.com
Subject: Re: RFA: lin-lwp bug with software-single-step or schedlock
Date: Wed, 23 Oct 2002 14:44:00 -0000	[thread overview]
Message-ID: <3DB71827.3195CECD@redhat.com> (raw)
In-Reply-To: <200210232113.g9NLDMxA000796@elgar.kettenis.dyndns.org>

Mark Kettenis wrote:
> 
>    Date: Wed, 23 Oct 2002 00:26:15 -0400
>    From: Daniel Jacobowitz <drow@mvista.com>
> 
>    This bug was noticed on MIPS, because MIPS GNU/Linux is
>    SOFTWARE_SINGLE_STEP_P.  There's a comment in lin_lwp_resume:
> 
>      /* Apparently the interpretation of PID is dependent on STEP: If
>         STEP is non-zero, a specific PID means `step only this process
>         id'.  But if STEP is zero, then PID means `continue *all*
>         processes, but give the signal only to this one'.  */
>      resume_all = (PIDGET (ptid) == -1) || !step;
> 
> I'm fairly certain it's not without reason that I wrote this comment
> as it is.

Uh, you didn't.  I did.  You copied it from "lin-thread.c".
And I wrote it because I found it empirically to be true at the time.


>    Now, I did some digging, and I believe this comment is completely
>    incorrect.  Saying "signal SIGWINCH" causes PIDGET (ptid) == -1,
>    and it is assumed the signal will be delivered to inferior_ptid.
>    There's some other problem there - I think I've discovered that we
>    will neglect to single-step over a breakpoint if we are told to
>    continue with a signal, which is a bit dubious of a decision - but
>    by and large it works as expected.
> 
> I don't see directly why, but I wouldn't be surprised by it.

The whole business is rather unplanned.  The exact meaning and 
connotation of those variables is nowhere defined in writing.
Mainly it's a matter of keeping consistent with what the code
in gdb expects, which you sometimes have to guess, or learn by
examining an older threaded architecture (eg. solaris).

>    So if STEP is 0, we always resume all processes.  STEP at this point _only_
>    refers to whether we want a PTRACE_SINGLESTEP or equivalent;
>    SOFTWARE_SINGLE_STEP has already been handled.  We can't make policy
>    decisions based on STEP any more.
> 
> Indeed, there's something wrong here.

Sounds like something has changed upstream.


>    I tried removing the || !step.  It's pretty hard to tell, since there are
>    still a few non-deterministic failures on my test systems (which is what I
>    was actually hunting when I found this!) but I believe testsuite results are
>    improved on i386.
> 
> There is one thing that might be affected.  Suppose you have a signal
> such as SIGUSR1 that stops the inferior but is also passed on to the
> inferior.  If a multi-threaded program gets this signal, GDB will
> stop.  If you now change the current thread to some other thread and
> try to single-step.  Will the signal be delivered to the origional
> thread?

That's what "prepare_to_proceed" is supposed to take care of.

> If your patch doesn't affect this, I think your patch is OK to check
> in.  Otherwise we'll have to think about this a bit more.

I'll pipe up and comment, as above, but I'll let you two guys
work out the decision between you.

Michael


  reply	other threads:[~2002-10-23 21:44 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-10-22 21:25 Daniel Jacobowitz
2002-10-22 22:35 ` Andrew Cagney
2002-10-23  7:40   ` Daniel Jacobowitz
2002-10-23 14:13 ` Mark Kettenis
2002-10-23 14:44   ` Michael Snyder [this message]
2002-10-23 14:55   ` Daniel Jacobowitz
2002-10-31 13:01 ` Daniel Jacobowitz

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=3DB71827.3195CECD@redhat.com \
    --to=msnyder@redhat.com \
    --cc=drow@mvista.com \
    --cc=gdb-patches@sources.redhat.com \
    --cc=kettenis@chello.nl \
    /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