diff options
Diffstat (limited to 'gdb/gdbthread.h')
-rw-r--r-- | gdb/gdbthread.h | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/gdb/gdbthread.h b/gdb/gdbthread.h index 06ed78f5681..47cf1258a12 100644 --- a/gdb/gdbthread.h +++ b/gdb/gdbthread.h @@ -22,6 +22,7 @@ #define GDBTHREAD_H struct symtab; +class user_selection; #include "breakpoint.h" #include "frame.h" @@ -253,7 +254,13 @@ struct thread_info /* 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 if we detect it exiting. */ - int refcount; + int refcount_; + + void get () + { refcount_++; } + + void put () + { refcount_--; } /* State of GDB control of inferior thread execution. See `struct thread_control_state'. */ @@ -440,8 +447,9 @@ void thread_change_ptid (ptid_t old_ptid, ptid_t new_ptid); /* Iterator function to call a user-provided callback function once for each known thread. */ -typedef int (*thread_callback_func) (struct thread_info *, void *); -extern struct thread_info *iterate_over_threads (thread_callback_func, void *); +typedef std::function<int(struct thread_info *, void*)> thread_callback_func; +extern struct thread_info *iterate_over_threads (thread_callback_func callback, + void *data = nullptr); /* Traverse all threads. */ #define ALL_THREADS(T) \ @@ -469,6 +477,9 @@ extern struct thread_info *iterate_over_threads (thread_callback_func, void *); extern int thread_count (void); +/* Change the user-selected thread. */ +extern bool thread_select (const char *tidstr, bool tid_is_qualified); + /* Switch from one thread to another. Also sets the STOP_PC global. */ extern void switch_to_thread (ptid_t ptid); @@ -508,15 +519,17 @@ extern void set_stop_requested (ptid_t ptid, int stop); The latter also returns true on exited threads, most likelly not what you want. */ -/* Reports if in the frontend's perpective, thread PTID is running. */ +/* Reports if in the frontend's perspective, thread PTID is running. */ extern int is_running (ptid_t ptid); /* Is this thread listed, but known to have exited? We keep it listed (but not visible) until it's safe to delete. */ extern int is_exited (ptid_t ptid); +extern bool is_exited (struct thread_info *thread); -/* In the frontend's perpective, is this thread stopped? */ +/* In the frontend's perspective, is this thread stopped? */ extern int is_stopped (ptid_t ptid); +extern bool is_stopped (struct thread_info *thread); /* Marks thread PTID as executing, or not. If PTID is minus_one_ptid, marks all threads. @@ -636,7 +649,8 @@ extern int show_thread_that_caused_stop (void); /* Print the message for a thread or/and frame selected. */ extern void print_selected_thread_frame (struct ui_out *uiout, - user_selected_what selection); + user_selection *us, + user_selected_what selection); extern struct thread_info *thread_list; |