summaryrefslogtreecommitdiff
path: root/gdb/tid-parse.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/tid-parse.c')
-rw-r--r--gdb/tid-parse.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/gdb/tid-parse.c b/gdb/tid-parse.c
index 2f7f9be5cdb..7f2d08ab065 100644
--- a/gdb/tid-parse.c
+++ b/gdb/tid-parse.c
@@ -55,7 +55,6 @@ parse_thread_id (const char *tidstr, const char **end)
{
const char *number = tidstr;
const char *dot, *p1;
- struct thread_info *tp;
struct inferior *inf;
int thr_num;
int explicit_inf_id = 0;
@@ -90,12 +89,13 @@ parse_thread_id (const char *tidstr, const char **end)
if (thr_num == 0)
invalid_thread_id_error (number);
- ALL_THREADS (tp)
- {
- if (tp->ptid.pid () == inf->pid
- && tp->per_inf_num == thr_num)
+ thread_info *tp = nullptr;
+ for (thread_info *it : inf->threads ())
+ if (it->per_inf_num == thr_num)
+ {
+ tp = it;
break;
- }
+ }
if (tp == NULL)
{