From: Joel Brobecker <brobecker@adacore.com>
To: Kevin Buettner <kevinb@redhat.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [commit/RFA] Avoid switch to invalid ptid during Ada task switch.
Date: Mon, 08 Mar 2010 18:41:00 -0000 [thread overview]
Message-ID: <20100308184112.GJ3081@adacore.com> (raw)
In-Reply-To: <20100308062637.3a03cd51@redhat.com>
> I think that the wording that you added is fine, though I find it
> confusing to see that there's a new thread, [New Thread 10250], but
> that GDB is unable to switch to it. I think it might be less
> confusing if the [New Thread...] message did not appear at all. I'm
> guessing though that suppressing that message would not be easy, and
> probably not worthwhile, especially for a case that's not supposed to
> happen.
Thanks for the feedback. About that new-thread message, I don't think
it's avoidable. On some targets, we "discover" threads only on demand.
What I mean by that is that the kernel does not send a notification
of some kind when a new thread is created or destroyed. It's GDB that
has to actively go look for new threads (target_ops to_find_new_threads).
GDB does not do this update systematically every time we stop - it would
be very expensive. So GDB it only does so when it needs to access that
thread list. For instance, when the user requests the list of threads.
Using the same example I used in my first message, here is the output
I get if I use "info threads" rather than try to perform a task switch:
(gdb) info threads
[New Thread 7598]
3 Thread 7598 0x00007f865d88e5a9 in pthread_cond_wait@@GLIBC_2.3.2 ()
from /lib/libpthread.so.0
* 2 Thread 7599 task_switch.break_me () at task_switch.adb:44
1 Thread 7592 0x00007f865d88e5a9 in pthread_cond_wait@@GLIBC_2.3.2 ()
from /lib/libpthread.so.0
And if I only now try to perform the task switch, I only get the new
error message:
(gdb) task 1
Unable to compute thread ID for task 1.
Cannot switch to this task.
(no new-thread notification).
--
Joel
next prev parent reply other threads:[~2010-03-08 18:41 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-07 15:25 Joel Brobecker
2010-03-08 13:27 ` Kevin Buettner
2010-03-08 18:41 ` Joel Brobecker [this message]
2010-03-16 18:51 ` Joel Brobecker
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=20100308184112.GJ3081@adacore.com \
--to=brobecker@adacore.com \
--cc=gdb-patches@sourceware.org \
--cc=kevinb@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