From: Pedro Alves <pedro@codesourcery.com>
To: "Ulrich Weigand" <uweigand@de.ibm.com>
Cc: gdb-patches@sourceware.org
Subject: Re: Fixes for a couple of infrun bugs (thread hop, revert to step thread).
Date: Mon, 16 Aug 2010 18:30:00 -0000 [thread overview]
Message-ID: <201008161930.20550.pedro@codesourcery.com> (raw)
In-Reply-To: <201008161738.o7GHceKx024097@d12av02.megacenter.de.ibm.com>
On Monday 16 August 2010 18:38:40, Ulrich Weigand wrote:
> Pedro Alves wrote:
>
> > Index: src/gdb/testsuite/gdb.threads/threxit-hop-specific.exp
> [snip]
> > +# Set a thread specific breakpoint somewhere the main thread will pass
> > +# by, but make it specific to the thread that is going to exit. Step
> > +# over the pthread_exit call. GDB should still be able to step over
> > +# the thread specific breakpoint, and reach the other breakpoint,
> > +# which is not thread specific.
> > +set bpthrline [gdb_get_line_number "set thread specific breakpoint here"]
> > +gdb_test "break $bpthrline thread 2" \
> > + "Breakpoint .*$srcfile.*$bpthrline.*" \
> > + "set thread specific breakpoint"
> > +
> > +set bpexitline [gdb_get_line_number "set exit breakpoint here"]
> > +gdb_breakpoint "$bpexitline"
> > +
> > +gdb_test "next" \
> > + ".*set exit breakpoint here.*" \
> > + "get passed the thread specific breakpoint"
>
> I'm seeing failures in this test on an ARM system with debug info
> packages installed for libc / libpthread. The problem is that
> pthread_exit is implemented in terms of pthread cancellation,
> which under the covers does a longjmp back up to the start_thread
> routine in libpthread.
>
> Normally, GDB will consider this routine to be assembler code and
> continue stepping until the end. However, if we actually have
> debug info, GDB will stop stepping here (because start_thread
> is in fact the parent of the application's thread routine), and
> thus the test fails.
>
> This does look like the correct behaviour under the circumstances,
> which would imply the test case is not quite correct. Do you
> agree or am I missing something here?
I agree.
> Any thoughts on how to fix the test?
Replacing the "next" by a "continue" should work. I've looked over the
original description of the problem this is covering, and, that
would still exercise the problem (which is gdb trying to step
the other (main) thread with inferior_ptid still pointing at
the thread that was being "next"ed, and in the process failing
to remove breakpoints from memory because inferior_ptid pointed
at an inferior thread.
--
Pedro Alves
next prev parent reply other threads:[~2010-08-16 18:30 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-05-27 22:00 Pedro Alves
2009-05-28 11:12 ` Ulrich Weigand
2009-05-28 17:20 ` Pedro Alves
2009-06-09 19:58 ` Joel Brobecker
2009-06-10 16:20 ` Pedro Alves
2009-06-10 16:37 ` Joel Brobecker
2010-08-16 17:38 ` Ulrich Weigand
2010-08-16 18:30 ` Pedro Alves [this message]
2010-08-16 18:32 ` Pedro Alves
2010-08-16 18:41 ` Ulrich Weigand
2010-08-16 18:53 ` Pedro Alves
2010-08-16 19:01 ` Ulrich Weigand
2010-09-08 18:18 ` [commit] " Ulrich Weigand
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=201008161930.20550.pedro@codesourcery.com \
--to=pedro@codesourcery.com \
--cc=gdb-patches@sourceware.org \
--cc=uweigand@de.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