Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <pedro@codesourcery.com>
To: gdb-patches@sourceware.org
Cc: Doug Evans <dje@google.com>,  sergiodj@linux.vnet.ibm.com
Subject: Re: [RFC] mask off is-syscall bit for TRAP_IS_SYSCALL
Date: Mon, 28 Sep 2009 19:58:00 -0000	[thread overview]
Message-ID: <200909282058.49161.pedro@codesourcery.com> (raw)
In-Reply-To: <20090928193905.32592843AC@ruffy.mtv.corp.google.com>

On Monday 28 September 2009 20:39:05, Doug Evans wrote:
> Hi.
> 
> On one system I use (bi-arch ubuntu-hardy clone),
> i386-disp-step.exp is failing because the wait status
> value linux_nat_wait_1 gets when hitting a system call is 0857f
> which gets passed to the upper layers which then get confused
> by a signal of 0x85 (== 0x80 | SIGTRAP).
> 
> This patch fixes things by masking off the 0x80 bit before
> passing the signal number to up the call chain.
> 
> Ok to check in?

This seems OK-is to me, although I see one extra case that
isn't handled correctly:

stop_wait_callback:

      status = wait_lwp (lp);

...

      if (WSTOPSIG (status) != SIGSTOP)
	{
	  if (WSTOPSIG (status) == SIGTRAP)
	    {
...
            }
          else
            {
	      /* If the lp->status field is still empty, use it to
		 hold this event.  If not, then this event must be
		 returned to the event queue of the LWP.  */
	      if (lp->status)
		{
		  if (debug_linux_nat)
		    {
		      fprintf_unfiltered (gdb_stdlog,
					  "SWC: kill %s, %s\n",
					  target_pid_to_str (lp->ptid),
					  status_to_str ((int) status));
		    }
		  kill_lwp (GET_LWP (lp->ptid), WSTOPSIG (status));      <<<<<<<<
		}

It seems we can reach that <<< marked code with a TRAP_IS_SYSCALL, but,
I doubt that we want to requeue that signal in the kernel (?).

-- 
Pedro Alves


  parent reply	other threads:[~2009-09-28 19:58 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-28 19:39 Doug Evans
2009-09-28 19:46 ` Sérgio Durigan Júnior
2009-09-28 19:58 ` Pedro Alves [this message]
2009-09-28 23:27   ` Pedro Alves
2009-09-29 12:45 Doug Evans
2009-09-29 14:32 ` 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=200909282058.49161.pedro@codesourcery.com \
    --to=pedro@codesourcery.com \
    --cc=dje@google.com \
    --cc=gdb-patches@sourceware.org \
    --cc=sergiodj@linux.vnet.ibm.com \
    /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