Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Daniel Jacobowitz <drow@false.org>
To: Daniel THOMPSON <daniel.thompson@st.com>
Cc: gdb@sources.redhat.com
Subject: Re: gdbserver, NPTL pthreads and PEEKUSER based targets
Date: Fri, 01 Apr 2005 14:08:00 -0000	[thread overview]
Message-ID: <20050401140938.GA29152@nevyn.them.org> (raw)
In-Reply-To: <424D02C8.7040307@st.com>

On Fri, Apr 01, 2005 at 09:14:00AM +0100, Daniel THOMPSON wrote:
> Daniel Jacobowitz wrote:
> >>Unfortunately the gdbserver bails out inside pthread_create() with an 
> >>SIGTRAP signal.
> >
> >That will be an unrelated problem.  It sounds like you may need a
> >reinsert_addr method.
> 
> I not quite sure about this, primarily because the SH4 kernel supports 
> PTRACE_SINGLESTEP since it has h/ware to assist this.

Then probably not.  You may have a broken PTRACE_SINGLESTEP; I know
I've had to fix the SH kernel support in the past.  More likely it's
something completely different.

> Running with strace shows the following assuming the debug threads 
> output and the ptrace output are correctly interleaved (pids have 
> changed because this is a different gdbserver session):
> 
> | Resuming process 309 (step, signal 0, stop not expected)
> |   pending reinsert at 2957c8a0
> | Checking for breakpoint.
> | ptrace(PTRACE_PEEKTEXT, 309, 0x2957c8a0, [0x4f222fe6]) = 0
> | Removed breakpoint.
> | <most of the boring PTRACE_POKEUSERs to keep this mail small>
> | ptrace(PTRACE_POKEUSER, 309, 4*REG_PC, 0x2957c8a0) = 0
> | ptrace(PTRACE_POKEUSER, 309, 4*REG_PR, 0x2957dc4c) = 0
> | ptrace(PTRACE_POKEUSER, 309, 4*REG_GBR, 0x296b27a8) = 0
> | ptrace(PTRACE_SINGLESTEP, 309, 0, SIG_0) = 0
> | --- SIGCHLD (Child exited) @ 0 (0) ---
> | --- SIGCHLD (Child exited) @ 0 (0) ---
> | Got an event from 310 (5)
> | Thread 703277904 (LWP 310) exiting
> | Got an event from 309 (5)
> | Thread 694887272 (LWP 309) exiting
> 
> This smells to me like a kernel bug in PTRACE_SINGLESTEP. Has the kernel 
> failed to apply the signal mask?

More likely, this is a completely different problem.  You may have hit
the situation where gdbserver has not yet attached to a thread, but
another thread hitting a breakpoint has caused it to exit.  Gdbserver
needs to use PTRACE_SETOPTIONS to attach to new threads; GDB was
recently changed to do this.

I thought I had some code lying around for this, but I can't find it
now.

-- 
Daniel Jacobowitz
CodeSourcery, LLC


      reply	other threads:[~2005-04-01 14:08 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-03-31 15:43 Daniel THOMPSON
2005-03-31 15:49 ` Daniel Jacobowitz
2005-04-01  8:14   ` Daniel THOMPSON
2005-04-01 14:08     ` Daniel Jacobowitz [this message]

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=20050401140938.GA29152@nevyn.them.org \
    --to=drow@false.org \
    --cc=daniel.thompson@st.com \
    --cc=gdb@sources.redhat.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