summaryrefslogtreecommitdiff
path: root/gdb/linux-thread-db.c
diff options
context:
space:
mode:
authorPedro Alves <pedro@codesourcery.com>2012-03-02 16:54:58 +0000
committerPedro Alves <pedro@codesourcery.com>2012-03-02 16:54:58 +0000
commit9e2fde2975e2b6fda0658378e5f82648df0259e0 (patch)
tree019411b1f5f58e118b5b306c732c21f51968c992 /gdb/linux-thread-db.c
parent09e986085d6671a39426078535557e64bd1580e6 (diff)
downloadgdb-9e2fde2975e2b6fda0658378e5f82648df0259e0.tar.gz
2012-03-02 Pedro Alves <palves@redhat.com>
* linux-thread-db.c (attach_thread): Avoid in_thread_list call.
Diffstat (limited to 'gdb/linux-thread-db.c')
-rw-r--r--gdb/linux-thread-db.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/gdb/linux-thread-db.c b/gdb/linux-thread-db.c
index b64ac2ed0c0..ea34bf4fd7b 100644
--- a/gdb/linux-thread-db.c
+++ b/gdb/linux-thread-db.c
@@ -1116,7 +1116,7 @@ attach_thread (ptid_t ptid, const td_thrhandle_t *th_p,
const td_thrinfo_t *ti_p)
{
struct private_thread_info *private;
- struct thread_info *tp = NULL;
+ struct thread_info *tp;
td_err_e err;
struct thread_db_info *info;
@@ -1130,11 +1130,9 @@ attach_thread (ptid_t ptid, const td_thrhandle_t *th_p,
thread ID. In the first case we don't need to do anything; in
the second case we should discard information about the dead
thread and attach to the new one. */
- if (in_thread_list (ptid))
+ tp = find_thread_ptid (ptid);
+ if (tp != NULL)
{
- tp = find_thread_ptid (ptid);
- gdb_assert (tp != NULL);
-
/* If tp->private is NULL, then GDB is already attached to this
thread, but we do not know anything about it. We can learn
about it here. This can only happen if we have some other