diff options
author | Pedro Alves <palves@redhat.com> | 2012-03-02 16:54:59 +0000 |
---|---|---|
committer | Pedro Alves <palves@redhat.com> | 2012-03-02 16:54:59 +0000 |
commit | 2a2ef594da159f295299c151eb98c5ec706ce4bb (patch) | |
tree | 4d2287ec53f3b56416d15dd7c0b0904d90d5af59 | |
parent | 05044653678510ef24f2a66773ba2e8f40e12b48 (diff) | |
download | gdb-2a2ef594da159f295299c151eb98c5ec706ce4bb.zip gdb-2a2ef594da159f295299c151eb98c5ec706ce4bb.tar.gz gdb-2a2ef594da159f295299c151eb98c5ec706ce4bb.tar.bz2 |
2012-03-02 Pedro Alves <palves@redhat.com>
* linux-thread-db.c (attach_thread): Avoid in_thread_list call.
-rw-r--r-- | gdb/ChangeLog | 4 | ||||
-rw-r--r-- | gdb/linux-thread-db.c | 8 |
2 files changed, 7 insertions, 5 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 772f7fb..ca22249 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,7 @@ +2012-03-02 Pedro Alves <palves@redhat.com> + + * linux-thread-db.c (attach_thread): Avoid in_thread_list call. + 2012-03-02 Ulrich Weigand <uweigand@de.ibm.com> Fix -Wmissing-prototypes build. diff --git a/gdb/linux-thread-db.c b/gdb/linux-thread-db.c index b64ac2e..ea34bf4 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 |