Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: "Mike Wellington" <mike.b.wellington@gmail.com>
To: insight@sourceware.org, gdb@sourceware.org
Cc: mike.b.wellington@gmail.com
Subject: plain/text: Re: insight/gdb stops single-stepping multi-threaded application - newbie question
Date: Sat, 22 Jul 2006 20:09:00 -0000	[thread overview]
Message-ID: <d1ed0eb40607221302o2cf29abke35652fb0a97056@mail.gmail.com> (raw)

I sent the first post in HTML by mistake.  sorry.

On 7/22/06, Mike Wellington <mike.b.wellington@gmail.com> wrote:
>
>
>
> Hello -
>   I am trying to debug a multi-theaded application with Insight-6.0/gdb-6.0
> on a PowerPC 4xx processor, the kernel is a modified Linux 2.6.0.
>
>    I set a non-thread-specific breakpoint at a location that is
> reached regularly.  I use a gdb user macro to "continue" each time
> the breakpoint is reached.   I start the application.  The application
> creates and starts about 25 threads.  After the breakpoint
> has been reached 50 - 80 times, the debugger stops - a continue
> is entered - but the thread that hit the breakpoint is never run
> again.
> ----
> 1)  Has anyone seen this problem, or one similar to it, before?
> ----
>    This only occurs after the single step after the breakpoint is
> performed.   On the target side I have verified with a printk that
> the breakpoint was hit, then a single-step is performed, then
> the breakpoint trap is never encountered after that.
>
> If I do a "ps" on the target system at this point I can see that
> 4-10 threads are all in the 'T' or stopped state.  If I send a SIG_CONT
> to the threads then things start running again, for a little while.
>
>   I set "int debug_threads" = 1;"   inside gdb/gdbserver/linux- low.c
> I also added some other printfs to try to see what was going on.
>
> When a continue after a breakpoint is executed there are a
> series of ptrace( ) calls that are executed to restart the
> thread that hit the breakpoint.  The registers are read, and written,
> some other PEEKS and POKES of the thread's memory space are
> done - then the last ptrace( ) is the one that performs a PTRACE_CONT
> to signal the thread to run again.
>
> Well, while these commands are being executed I see a call to
> ptrace execute a PTRACE_CONT with the "data" parameter set to
> 0.   for a different thread.  Then the rest of the ptrace calls
> to restart the breakpointed thread are executed.
>
> The thread never hits the next breakpoint,.  All I see are continued
> PTRACE_CONT for a different thread with 32 as the signal.  The
> thread that repeatedly signals is in a rt_sigsuspend ()
> system call.
>
> ------
> 2)  I don't know if the breakpoint failure has anything to do with the
> recurring asynchronous PTRACE_CONT from rt_sigsuspend() occuring
> while gdbserver is trying to restart after a breakpoint / singlestep, but it
> looks suspicious.
> -----
>
> If anybody knows anything about what might cause this problem
> and/or how to fix it I would really appreciate the help.
>
> thanks
>
>
> -mike
>
>


             reply	other threads:[~2006-07-22 20:02 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-22 20:09 Mike Wellington [this message]
2006-07-22 20:38 ` 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=d1ed0eb40607221302o2cf29abke35652fb0a97056@mail.gmail.com \
    --to=mike.b.wellington@gmail.com \
    --cc=gdb@sourceware.org \
    --cc=insight@sourceware.org \
    /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