summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2018-11-23 13:36:59 +0000
committerPedro Alves <palves@redhat.com>2018-11-23 13:36:59 +0000
commit6af05e645ab7fbbb4e0b663f50febf052e6d09a0 (patch)
tree9743b9e70a55c511961125fe921c5177dee3ccb0
parentAutomatic date update in version.in (diff)
downloadbinutils-gdb-6af05e645ab7fbbb4e0b663f50febf052e6d09a0.tar.gz
binutils-gdb-6af05e645ab7fbbb4e0b663f50febf052e6d09a0.tar.bz2
binutils-gdb-6af05e645ab7fbbb4e0b663f50febf052e6d09a0.tar.xz
Remove declarations of is_running/is_stopped/is_exited
The recent commit 080363310650 ("Per-inferior thread list, thread ranges/iterators, down with ALL_THREADS, etc.") removed the definitions of is_running/is_stopped/is_exited but missed removing the declarations. gdb/ChangeLog: 2018-11-23 Pedro Alves <palves@redhat.com> * gdbthread.h (enum thread_state): Move comments here. (is_running, is_stopped, is_exited): Remove declarations.
-rw-r--r--gdb/ChangeLog5
-rw-r--r--gdb/gdbthread.h48
2 files changed, 27 insertions, 26 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 0b8651c..90e8d7a 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
12018-11-23 Pedro Alves <palves@redhat.com>
2
3 * gdbthread.h (enum thread_state): Move comments here.
4 (is_running, is_stopped, is_exited): Remove declarations.
5
12018-11-22 Pedro Alves <palves@redhat.com> 62018-11-22 Pedro Alves <palves@redhat.com>
2 7
3 * Makefile.in (COMMON_SFILES): Add thread-iter.c. 8 * Makefile.in (COMMON_SFILES): Add thread-iter.c.
diff --git a/gdb/gdbthread.h b/gdb/gdbthread.h
index 94fc1b7..2e8f4f1 100644
--- a/gdb/gdbthread.h
+++ b/gdb/gdbthread.h
@@ -36,11 +36,32 @@ struct symtab;
36struct inferior; 36struct inferior;
37 37
38/* Frontend view of the thread state. Possible extensions: stepping, 38/* Frontend view of the thread state. Possible extensions: stepping,
39 finishing, until(ling),... */ 39 finishing, until(ling),...
40
41 NOTE: Since the thread state is not a boolean, most times, you do
42 not want to check it with negation. If you really want to check if
43 the thread is stopped,
44
45 use (good):
46
47 if (tp->state == THREAD_STOPPED)
48
49 instead of (bad):
50
51 if (tp->state != THREAD_RUNNING)
52
53 The latter is also true for exited threads, most likely not what
54 you want. */
40enum thread_state 55enum thread_state
41{ 56{
57 /* In the frontend's perpective, the thread is stopped. */
42 THREAD_STOPPED, 58 THREAD_STOPPED,
59
60 /* In the frontend's perpective, the thread is running. */
43 THREAD_RUNNING, 61 THREAD_RUNNING,
62
63 /* The thread is listed, but known to have exited. We keep it
64 listed (but not visible) until it's safe to delete it. */
44 THREAD_EXITED, 65 THREAD_EXITED,
45}; 66};
46 67
@@ -566,31 +587,6 @@ extern void set_running (ptid_t ptid, int running);
566 observer is called with PTID as argument. */ 587 observer is called with PTID as argument. */
567extern void set_stop_requested (ptid_t ptid, int stop); 588extern void set_stop_requested (ptid_t ptid, int stop);
568 589
569/* NOTE: Since the thread state is not a boolean, most times, you do
570 not want to check it with negation. If you really want to check if
571 the thread is stopped,
572
573 use (good):
574
575 if (is_stopped (ptid))
576
577 instead of (bad):
578
579 if (!is_running (ptid))
580
581 The latter also returns true on exited threads, most likelly not
582 what you want. */
583
584/* Reports if in the frontend's perpective, thread PTID is running. */
585extern int is_running (ptid_t ptid);
586
587/* Is this thread listed, but known to have exited? We keep it listed
588 (but not visible) until it's safe to delete. */
589extern int is_exited (ptid_t ptid);
590
591/* In the frontend's perpective, is this thread stopped? */
592extern int is_stopped (ptid_t ptid);
593
594/* Marks thread PTID as executing, or not. If PTID is minus_one_ptid, 590/* Marks thread PTID as executing, or not. If PTID is minus_one_ptid,
595 marks all threads. 591 marks all threads.
596 592