| OLD | NEW |
| 1 /* Multi-process/thread control defs for GDB, the GNU debugger. | 1 /* Multi-process/thread control defs for GDB, the GNU debugger. |
| 2 Copyright (C) 1987-1993, 1997-2000, 2007-2012 Free Software | 2 Copyright (C) 1987-1993, 1997-2000, 2007-2012 Free Software |
| 3 Foundation, Inc. | 3 Foundation, Inc. |
| 4 Contributed by Lynx Real-Time Systems, Inc. Los Gatos, CA. | 4 Contributed by Lynx Real-Time Systems, Inc. Los Gatos, CA. |
| 5 | 5 |
| 6 | 6 |
| 7 This file is part of GDB. | 7 This file is part of GDB. |
| 8 | 8 |
| 9 This program is free software; you can redistribute it and/or modify | 9 This program is free software; you can redistribute it and/or modify |
| 10 it under the terms of the GNU General Public License as published by | 10 it under the terms of the GNU General Public License as published by |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 bpstat stop_bpstat; | 116 bpstat stop_bpstat; |
| 117 }; | 117 }; |
| 118 | 118 |
| 119 /* Inferior thread specific part of `struct infcall_suspend_state'. | 119 /* Inferior thread specific part of `struct infcall_suspend_state'. |
| 120 | 120 |
| 121 Inferior process counterpart is `struct inferior_suspend_state'. */ | 121 Inferior process counterpart is `struct inferior_suspend_state'. */ |
| 122 | 122 |
| 123 struct thread_suspend_state | 123 struct thread_suspend_state |
| 124 { | 124 { |
| 125 /* Last signal that the inferior received (why it stopped). */ | 125 /* Last signal that the inferior received (why it stopped). */ |
| 126 enum target_signal stop_signal; | 126 enum gdb_signal stop_signal; |
| 127 }; | 127 }; |
| 128 | 128 |
| 129 struct thread_info | 129 struct thread_info |
| 130 { | 130 { |
| 131 struct thread_info *next; | 131 struct thread_info *next; |
| 132 ptid_t ptid; /* "Actual process id"; | 132 ptid_t ptid; /* "Actual process id"; |
| 133 In fact, this may be overloaded with | 133 In fact, this may be overloaded with |
| 134 kernel thread id, etc. */ | 134 kernel thread id, etc. */ |
| 135 int num; /* Convenient handle (GDB thread id) */ | 135 int num; /* Convenient handle (GDB thread id) */ |
| 136 | 136 |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 209 | 209 |
| 210 /* This is used to remember when a fork or vfork event was caught by | 210 /* This is used to remember when a fork or vfork event was caught by |
| 211 a catchpoint, and thus the event is to be followed at the next | 211 a catchpoint, and thus the event is to be followed at the next |
| 212 resume of the thread, and not immediately. */ | 212 resume of the thread, and not immediately. */ |
| 213 struct target_waitstatus pending_follow; | 213 struct target_waitstatus pending_follow; |
| 214 | 214 |
| 215 /* True if this thread has been explicitly requested to stop. */ | 215 /* True if this thread has been explicitly requested to stop. */ |
| 216 int stop_requested; | 216 int stop_requested; |
| 217 | 217 |
| 218 /* The initiating frame of a nexting operation, used for deciding | 218 /* The initiating frame of a nexting operation, used for deciding |
| 219 which exceptions to intercept. */ | 219 which exceptions to intercept. If it is null_frame_id no |
| 220 bp_longjmp or bp_exception but longjmp has been caught just for |
| 221 bp_longjmp_call_dummy. */ |
| 220 struct frame_id initiating_frame; | 222 struct frame_id initiating_frame; |
| 221 | 223 |
| 222 /* Private data used by the target vector implementation. */ | 224 /* Private data used by the target vector implementation. */ |
| 223 struct private_thread_info *private; | 225 struct private_thread_info *private; |
| 224 | 226 |
| 225 /* Function that is called to free PRIVATE. If this is NULL, then | 227 /* Function that is called to free PRIVATE. If this is NULL, then |
| 226 xfree will be called on PRIVATE. */ | 228 xfree will be called on PRIVATE. */ |
| 227 void (*private_dtor) (struct private_thread_info *); | 229 void (*private_dtor) (struct private_thread_info *); |
| 228 }; | 230 }; |
| 229 | 231 |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 292 extern struct thread_info *any_live_thread_of_process (int pid); | 294 extern struct thread_info *any_live_thread_of_process (int pid); |
| 293 | 295 |
| 294 /* Change the ptid of thread OLD_PTID to NEW_PTID. */ | 296 /* Change the ptid of thread OLD_PTID to NEW_PTID. */ |
| 295 void thread_change_ptid (ptid_t old_ptid, ptid_t new_ptid); | 297 void thread_change_ptid (ptid_t old_ptid, ptid_t new_ptid); |
| 296 | 298 |
| 297 /* Iterator function to call a user-provided callback function | 299 /* Iterator function to call a user-provided callback function |
| 298 once for each known thread. */ | 300 once for each known thread. */ |
| 299 typedef int (*thread_callback_func) (struct thread_info *, void *); | 301 typedef int (*thread_callback_func) (struct thread_info *, void *); |
| 300 extern struct thread_info *iterate_over_threads (thread_callback_func, void *); | 302 extern struct thread_info *iterate_over_threads (thread_callback_func, void *); |
| 301 | 303 |
| 304 /* Traverse all threads. */ |
| 305 |
| 306 #define ALL_THREADS(T) \ |
| 307 for (T = thread_list; T; T = T->next) |
| 308 |
| 302 extern int thread_count (void); | 309 extern int thread_count (void); |
| 303 | 310 |
| 304 /* Switch from one thread to another. */ | 311 /* Switch from one thread to another. */ |
| 305 extern void switch_to_thread (ptid_t ptid); | 312 extern void switch_to_thread (ptid_t ptid); |
| 306 | 313 |
| 307 /* Marks thread PTID is running, or stopped. | 314 /* Marks thread PTID is running, or stopped. |
| 308 If PIDGET (PTID) is -1, marks all threads. */ | 315 If PIDGET (PTID) is -1, marks all threads. */ |
| 309 extern void set_running (ptid_t ptid, int running); | 316 extern void set_running (ptid_t ptid, int running); |
| 310 | 317 |
| 311 /* Marks or clears thread(s) PTID as having been requested to stop. | 318 /* Marks or clears thread(s) PTID as having been requested to stop. |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 382 int pid); | 389 int pid); |
| 383 | 390 |
| 384 extern struct cleanup *make_cleanup_restore_current_thread (void); | 391 extern struct cleanup *make_cleanup_restore_current_thread (void); |
| 385 | 392 |
| 386 /* Returns a pointer into the thread_info corresponding to | 393 /* Returns a pointer into the thread_info corresponding to |
| 387 INFERIOR_PTID. INFERIOR_PTID *must* be in the thread list. */ | 394 INFERIOR_PTID. INFERIOR_PTID *must* be in the thread list. */ |
| 388 extern struct thread_info* inferior_thread (void); | 395 extern struct thread_info* inferior_thread (void); |
| 389 | 396 |
| 390 extern void update_thread_list (void); | 397 extern void update_thread_list (void); |
| 391 | 398 |
| 399 extern struct thread_info *thread_list; |
| 400 |
| 392 #endif /* GDBTHREAD_H */ | 401 #endif /* GDBTHREAD_H */ |
| OLD | NEW |