GNU Binutils with patches for OS216
Revisión | e6e53b4014d4974d749e1afad3b3216ef5a1caf0 (tree) |
---|---|
Tiempo | 2011-04-20 00:28:52 |
Autor | Marc Khouzam <marc.khouzam@eric...> |
Commiter | Marc Khouzam |
2011-04-19 Marc Khouzam <marc.khouzam@ericsson.com>
* thread.c (any_live_thread_of_process): Prioritize threads
that are not executing.
* gdbthread.h (any_live_thread_of_process): Update comment
as per above change.
@@ -1,3 +1,10 @@ | ||
1 | +2011-04-19 Marc Khouzam <marc.khouzam@ericsson.com> | |
2 | + | |
3 | + * thread.c (any_live_thread_of_process): Prioritize threads | |
4 | + that are not executing. | |
5 | + * gdbthread.h (any_live_thread_of_process): Update comment | |
6 | + as per above change. | |
7 | + | |
1 | 8 | 2011-03-18 Kwok Cheung Yeung <kcy@codesourcery.com> |
2 | 9 | |
3 | 10 | * MAINTAINERS: Add myself as a write-after-approval maintainer. |
@@ -251,7 +251,7 @@ struct thread_info *first_thread_of_process (int pid); | ||
251 | 251 | extern struct thread_info *any_thread_of_process (int pid); |
252 | 252 | |
253 | 253 | /* Returns any non-exited thread of process PID, giving preference for |
254 | - already stopped threads. */ | |
254 | + not executing threads. */ | |
255 | 255 | extern struct thread_info *any_live_thread_of_process (int pid); |
256 | 256 | |
257 | 257 | /* Change the ptid of thread OLD_PTID to NEW_PTID. */ |
@@ -448,18 +448,18 @@ struct thread_info * | ||
448 | 448 | any_live_thread_of_process (int pid) |
449 | 449 | { |
450 | 450 | struct thread_info *tp; |
451 | - struct thread_info *tp_running = NULL; | |
451 | + struct thread_info *tp_executing = NULL; | |
452 | 452 | |
453 | 453 | for (tp = thread_list; tp; tp = tp->next) |
454 | - if (ptid_get_pid (tp->ptid) == pid) | |
454 | + if (tp->state_ != THREAD_EXITED && ptid_get_pid (tp->ptid) == pid) | |
455 | 455 | { |
456 | - if (tp->state_ == THREAD_STOPPED) | |
456 | + if (tp->executing_) | |
457 | + tp_executing = tp; | |
458 | + else | |
457 | 459 | return tp; |
458 | - else if (tp->state_ == THREAD_RUNNING) | |
459 | - tp_running = tp; | |
460 | 460 | } |
461 | 461 | |
462 | - return tp_running; | |
462 | + return tp_executing; | |
463 | 463 | } |
464 | 464 | |
465 | 465 | /* Print a list of thread ids currently known, and the total number of |