aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdbthread.h
diff options
context:
space:
mode:
authorAndrew Burgess <andrew.burgess@embecosm.com>2021-08-10 11:20:44 +0100
committerAndrew Burgess <andrew.burgess@embecosm.com>2021-09-07 12:44:08 +0100
commit611841bb1afc689becfab6dd490e1799aabf547d (patch)
tree9408d2caedec7fd55131479e3bb2964ad7382515 /gdb/gdbthread.h
parent9dc2f26777b07f9e5aa3220f7a680987ef79e75e (diff)
downloadgdb-611841bb1afc689becfab6dd490e1799aabf547d.zip
gdb-611841bb1afc689becfab6dd490e1799aabf547d.tar.gz
gdb-611841bb1afc689becfab6dd490e1799aabf547d.tar.bz2
gdb: make thread_info::executing private
Rename thread_info::executing to thread_info::m_executing, and make it private. Add a new get/set member functions, and convert GDB to make use of these. The only real change of interest in this patch is in thread.c where I have deleted the helper function set_executing_thread, and now just use the new set function thread_info::set_executing. However, the old helper function set_executing_thread included some code to reset the thread's stop_pc, so I moved this code into the new function thread_info::set_executing. However, I don't believe there is anywhere that this results in a change of behaviour, previously the executing flag was always set true through a call to set_executing_thread anyway.
Diffstat (limited to 'gdb/gdbthread.h')
-rw-r--r--gdb/gdbthread.h20
1 files changed, 15 insertions, 5 deletions
diff --git a/gdb/gdbthread.h b/gdb/gdbthread.h
index 9c178f5..e6f383c 100644
--- a/gdb/gdbthread.h
+++ b/gdb/gdbthread.h
@@ -287,15 +287,19 @@ public:
if the thread does not have a user-given name. */
char *name = NULL;
- /* True means the thread is executing. Note: this is different
- from saying that there is an active target and we are stopped at
- a breakpoint, for instance. This is a real indicator whether the
- thread is off and running. */
- bool executing = false;
+ bool executing () const
+ { return m_executing; }
+
+ /* Set the thread's 'm_executing' field from EXECUTING, and if EXECUTING
+ is true also clears the thread's stop_pc. */
+ void set_executing (bool executing);
bool resumed () const
{ return m_resumed; }
+ /* Set the thread's 'm_resumed' field from RESUMED. The thread may also
+ be added to (when RESUMED is true), or removed from (when RESUMED is
+ false), the list of threads with a pending wait status. */
void set_resumed (bool resumed);
/* Frontend view of the thread state. Note that the THREAD_RUNNING/
@@ -488,6 +492,12 @@ private:
the thread run. */
bool m_resumed = false;
+ /* True means the thread is executing. Note: this is different
+ from saying that there is an active target and we are stopped at
+ a breakpoint, for instance. This is a real indicator whether the
+ thread is off and running. */
+ bool m_executing = false;
+
/* State of inferior thread to restore after GDB is done with an inferior
call. See `struct thread_suspend_state'. */
thread_suspend_state m_suspend;