Use enum thread_state

Message ID 1403156984-13511-1-git-send-email-yao@codesourcery.com
State Committed
Headers

Commit Message

Yao Qi June 19, 2014, 5:49 a.m. UTC
  This patch is to change field state's type to 'enum thread_state', and
replace RUNNING with THREAD_RUNNING and STOPPED with THREAD_STOPPED
respectively in comments.

Rebuild GDB for linux and mingw.

gdb:

2014-06-19  Yao Qi  <yao@codesourcery.com>

	* gdbthread.h (struct thread_info) <state>: Change its type to
	'enum thread_state'.  Update comments.
---
 gdb/gdbthread.h | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)
  

Comments

Pedro Alves June 19, 2014, 8:32 a.m. UTC | #1
On 06/19/2014 06:49 AM, Yao Qi wrote:
> This patch is to change field state's type to 'enum thread_state', and
> replace RUNNING with THREAD_RUNNING and STOPPED with THREAD_STOPPED
> respectively in comments.

Thanks!  I've been meaning to do this for ages...

OK.
  
Yao Qi June 19, 2014, 12:16 p.m. UTC | #2
On 06/19/2014 04:32 PM, Pedro Alves wrote:
> On 06/19/2014 06:49 AM, Yao Qi wrote:
>> This patch is to change field state's type to 'enum thread_state', and
>> replace RUNNING with THREAD_RUNNING and STOPPED with THREAD_STOPPED
>> respectively in comments.
> 
> Thanks!  I've been meaning to do this for ages...
> 
> OK.
> 

Thanks, patch is pushed in.
  

Patch

diff --git a/gdb/gdbthread.h b/gdb/gdbthread.h
index 9f5dee6..1f10469 100644
--- a/gdb/gdbthread.h
+++ b/gdb/gdbthread.h
@@ -157,14 +157,12 @@  struct thread_info
      thread is off and running.  */
   int executing;
 
-  /* Frontend view of the thread state.  Note that the RUNNING/STOPPED
-     states are different from EXECUTING.  When the thread is stopped
-     internally while handling an internal event, like a software
-     single-step breakpoint, EXECUTING will be false, but running will
-     still be true.  As a possible future extension, this could turn
-     into enum { stopped, exited, stepping, finishing, until(ling),
-     running ... }  */
-  int state;
+  /* Frontend view of the thread state.  Note that the THREAD_RUNNING/
+     THREAD_STOPPED states are different from EXECUTING.  When the
+     thread is stopped internally while handling an internal event,
+     like a software single-step breakpoint, EXECUTING will be false,
+     but STATE will still be THREAD_RUNNING.  */
+  enum thread_state state;
 
   /* If this is > 0, then it means there's code out there that relies
      on this thread being listed.  Don't delete it from the lists even