X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=gdb%2Fthread.c;h=95f265a7fcbb9799e41f6ad7db7e1fa267768365;hb=d90e17a74d28db7b3632eced357327ce2fb14f01;hp=ffb93bedc088f7445db365e256d3b8af69ba1bfb;hpb=fb14de7bbddf9dc2f97af953b95b5aa5ea9889c4;p=deliverable%2Fbinutils-gdb.git diff --git a/gdb/thread.c b/gdb/thread.c index ffb93bedc0..95f265a7fc 100644 --- a/gdb/thread.c +++ b/gdb/thread.c @@ -509,21 +509,23 @@ void set_running (ptid_t ptid, int running) { struct thread_info *tp; + int all = ptid_equal (ptid, minus_one_ptid); /* We try not to notify the observer if no thread has actually changed the running state -- merely to reduce the number of messages to frontend. Frontend is supposed to handle multiple *running just fine. */ - if (PIDGET (ptid) == -1) + if (all || ptid_is_pid (ptid)) { int any_started = 0; for (tp = thread_list; tp; tp = tp->next) - { - if (tp->state_ == THREAD_EXITED) - continue; - if (running && tp->state_ == THREAD_STOPPED) - any_started = 1; - tp->state_ = running ? THREAD_RUNNING : THREAD_STOPPED; - } + if (all || ptid_get_pid (tp->ptid) == ptid_get_pid (ptid)) + { + if (tp->state_ == THREAD_EXITED) + continue; + if (running && tp->state_ == THREAD_STOPPED) + any_started = 1; + tp->state_ = running ? THREAD_RUNNING : THREAD_STOPPED; + } if (any_started) observer_notify_target_resumed (ptid); } @@ -616,11 +618,13 @@ void set_executing (ptid_t ptid, int executing) { struct thread_info *tp; + int all = ptid_equal (ptid, minus_one_ptid); - if (PIDGET (ptid) == -1) + if (all || ptid_is_pid (ptid)) { for (tp = thread_list; tp; tp = tp->next) - tp->executing_ = executing; + if (all || ptid_get_pid (tp->ptid) == ptid_get_pid (ptid)) + tp->executing_ = executing; } else {