This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFC] mask off is-syscall bit for TRAP_IS_SYSCALL
- From: Pedro Alves <pedro at codesourcery dot com>
- To: gdb-patches at sourceware dot org
- Cc: Doug Evans <dje at google dot com>, sergiodj at linux dot vnet dot ibm dot com
- Date: Mon, 28 Sep 2009 20:58:48 +0100
- Subject: Re: [RFC] mask off is-syscall bit for TRAP_IS_SYSCALL
- References: <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