Thread.h revision fdf24efe672bf3fa041cdbebd2d7f406b11882bd
1//===-- Thread.h ------------------------------------------------*- C++ -*-===// 2// 3// The LLVM Compiler Infrastructure 4// 5// This file is distributed under the University of Illinois Open Source 6// License. See LICENSE.TXT for details. 7// 8//===----------------------------------------------------------------------===// 9 10#ifndef liblldb_Thread_h_ 11#define liblldb_Thread_h_ 12 13#include "lldb/lldb-private.h" 14#include "lldb/Host/Mutex.h" 15#include "lldb/Core/UserID.h" 16#include "lldb/Core/UserSettingsController.h" 17#include "lldb/Target/ExecutionContextScope.h" 18#include "lldb/Target/StackFrameList.h" 19 20#define LLDB_THREAD_MAX_STOP_EXC_DATA 8 21 22namespace lldb_private { 23 24class ThreadInstanceSettings : public InstanceSettings 25{ 26public: 27 28 ThreadInstanceSettings (UserSettingsController &owner, bool live_instance = true, const char *name = NULL); 29 30 ThreadInstanceSettings (const ThreadInstanceSettings &rhs); 31 32 virtual 33 ~ThreadInstanceSettings (); 34 35 ThreadInstanceSettings& 36 operator= (const ThreadInstanceSettings &rhs); 37 38 39 void 40 UpdateInstanceSettingsVariable (const ConstString &var_name, 41 const char *index_value, 42 const char *value, 43 const ConstString &instance_name, 44 const SettingEntry &entry, 45 VarSetOperationType op, 46 Error &err, 47 bool pending); 48 49 bool 50 GetInstanceSettingsValue (const SettingEntry &entry, 51 const ConstString &var_name, 52 StringList &value, 53 Error *err); 54 55 RegularExpression * 56 GetSymbolsToAvoidRegexp() 57 { 58 return m_avoid_regexp_ap.get(); 59 } 60 61 static const ConstString & 62 StepAvoidRegexpVarName (); 63 64 bool 65 GetTraceEnabledState() 66 { 67 return m_trace_enabled; 68 } 69 static const ConstString & 70 GetTraceThreadVarName (); 71 72protected: 73 74 void 75 CopyInstanceSettings (const lldb::InstanceSettingsSP &new_settings, 76 bool pending); 77 78 const ConstString 79 CreateInstanceName (); 80 81private: 82 83 std::auto_ptr<RegularExpression> m_avoid_regexp_ap; 84 bool m_trace_enabled; 85}; 86 87class Thread : 88 public UserID, 89 public ExecutionContextScope, 90 public ThreadInstanceSettings 91{ 92public: 93 94 class SettingsController : public UserSettingsController 95 { 96 public: 97 98 SettingsController (); 99 100 virtual 101 ~SettingsController (); 102 103 static SettingEntry global_settings_table[]; 104 static SettingEntry instance_settings_table[]; 105 106 protected: 107 108 lldb::InstanceSettingsSP 109 CreateInstanceSettings (const char *instance_name); 110 111 private: 112 113 // Class-wide settings. 114 115 DISALLOW_COPY_AND_ASSIGN (SettingsController); 116 }; 117 118 // TODO: You shouldn't just checkpoint the register state alone, so this should get 119 // moved to protected. To do that ThreadStateCheckpoint needs to be returned as a token... 120 class RegisterCheckpoint 121 { 122 public: 123 124 RegisterCheckpoint() : 125 m_stack_id (), 126 m_data_sp () 127 { 128 } 129 130 RegisterCheckpoint (const StackID &stack_id) : 131 m_stack_id (stack_id), 132 m_data_sp () 133 { 134 } 135 136 ~RegisterCheckpoint() 137 { 138 } 139 140 const RegisterCheckpoint& 141 operator= (const RegisterCheckpoint &rhs) 142 { 143 if (this != &rhs) 144 { 145 this->m_stack_id = rhs.m_stack_id; 146 this->m_data_sp = rhs.m_data_sp; 147 } 148 return *this; 149 } 150 151 RegisterCheckpoint (const RegisterCheckpoint &rhs) : 152 m_stack_id (rhs.m_stack_id), 153 m_data_sp (rhs.m_data_sp) 154 { 155 } 156 157 const StackID & 158 GetStackID() 159 { 160 return m_stack_id; 161 } 162 163 void 164 SetStackID (const StackID &stack_id) 165 { 166 m_stack_id = stack_id; 167 } 168 169 lldb::DataBufferSP & 170 GetData() 171 { 172 return m_data_sp; 173 } 174 175 const lldb::DataBufferSP & 176 GetData() const 177 { 178 return m_data_sp; 179 } 180 181 protected: 182 StackID m_stack_id; 183 lldb::DataBufferSP m_data_sp; 184 }; 185 186 struct ThreadStateCheckpoint 187 { 188 uint32_t orig_stop_id; // Dunno if I need this yet but it is an interesting bit of data. 189 lldb::StopInfoSP stop_info_sp; // You have to restore the stop info or you might continue with the wrong signals. 190 RegisterCheckpoint register_backup; // You need to restore the registers, of course... 191 }; 192 193 void 194 UpdateInstanceName (); 195 196 static void 197 SettingsInitialize (); 198 199 static void 200 SettingsTerminate (); 201 202 static lldb::UserSettingsControllerSP & 203 GetSettingsController (); 204 205 Thread (Process &process, lldb::tid_t tid); 206 virtual ~Thread(); 207 208 Process & 209 GetProcess() 210 { 211 return m_process; 212 } 213 214 const Process & 215 GetProcess() const 216 { 217 return m_process; 218 } 219 220 int 221 GetResumeSignal () const 222 { 223 return m_resume_signal; 224 } 225 226 void 227 SetResumeSignal (int signal) 228 { 229 m_resume_signal = signal; 230 } 231 232 lldb::StateType 233 GetState() const; 234 235 lldb::ThreadSP 236 GetSP (); 237 238 void 239 SetState (lldb::StateType state); 240 241 lldb::StateType 242 GetResumeState () const 243 { 244 return m_resume_state; 245 } 246 247 void 248 SetResumeState (lldb::StateType state) 249 { 250 m_resume_state = state; 251 } 252 253 // This function is called on all the threads before "WillResume" in case 254 // a thread needs to change its state before the ThreadList polls all the 255 // threads to figure out which ones actually will get to run and how. 256 void 257 SetupForResume (); 258 259 // Override this to do platform specific tasks before resume, but always 260 // call the Thread::WillResume at the end of your work. 261 262 virtual bool 263 WillResume (lldb::StateType resume_state); 264 265 // This clears generic thread state after a resume. If you subclass this, 266 // be sure to call it. 267 virtual void 268 DidResume (); 269 270 virtual void 271 RefreshStateAfterStop() = 0; 272 273 void 274 WillStop (); 275 276 bool 277 ShouldStop (Event *event_ptr); 278 279 Vote 280 ShouldReportStop (Event *event_ptr); 281 282 Vote 283 ShouldReportRun (Event *event_ptr); 284 285 // Return whether this thread matches the specification in ThreadSpec. This is a virtual 286 // method because at some point we may extend the thread spec with a platform specific 287 // dictionary of attributes, which then only the platform specific Thread implementation 288 // would know how to match. For now, this just calls through to the ThreadSpec's 289 // ThreadPassesBasicTests method. 290 virtual bool 291 MatchesSpec (const ThreadSpec *spec); 292 293 lldb::StopInfoSP 294 GetStopInfo (); 295 296 // This sets the stop reason to a "blank" stop reason, so you can call functions on the thread 297 // without having the called function run with whatever stop reason you stopped with. 298 void 299 SetStopInfoToNothing(); 300 301 bool 302 ThreadStoppedForAReason (); 303 304 static const char * 305 RunModeAsCString (lldb::RunMode mode); 306 307 static const char * 308 StopReasonAsCString (lldb::StopReason reason); 309 310 virtual const char * 311 GetInfo () 312 { 313 return NULL; 314 } 315 316 virtual const char * 317 GetName () 318 { 319 return NULL; 320 } 321 322 virtual const char * 323 GetQueueName () 324 { 325 return NULL; 326 } 327 328 virtual uint32_t 329 GetStackFrameCount() 330 { 331 return GetStackFrameList().GetNumFrames(); 332 } 333 334 virtual lldb::StackFrameSP 335 GetStackFrameAtIndex (uint32_t idx) 336 { 337 return GetStackFrameList().GetFrameAtIndex(idx); 338 } 339 340 virtual lldb::StackFrameSP 341 GetFrameWithConcreteFrameIndex (uint32_t unwind_idx); 342 343 virtual lldb::StackFrameSP 344 GetFrameWithStackID(StackID &stack_id) 345 { 346 return GetStackFrameList().GetFrameWithStackID (stack_id); 347 } 348 349 uint32_t 350 GetSelectedFrameIndex () 351 { 352 return GetStackFrameList().GetSelectedFrameIndex(); 353 } 354 355 lldb::StackFrameSP 356 GetSelectedFrame () 357 { 358 return GetStackFrameAtIndex (GetStackFrameList().GetSelectedFrameIndex()); 359 } 360 361 uint32_t 362 SetSelectedFrame (lldb_private::StackFrame *frame) 363 { 364 return GetStackFrameList().SetSelectedFrame(frame); 365 } 366 367 void 368 SetSelectedFrameByIndex (uint32_t frame_idx) 369 { 370 GetStackFrameList().SetSelectedFrameByIndex(frame_idx); 371 } 372 373 void 374 SetDefaultFileAndLineToSelectedFrame() 375 { 376 GetStackFrameList().SetDefaultFileAndLineToSelectedFrame(); 377 } 378 379 virtual lldb::RegisterContextSP 380 GetRegisterContext () = 0; 381 382 virtual lldb::RegisterContextSP 383 CreateRegisterContextForFrame (StackFrame *frame) = 0; 384 385 virtual void 386 ClearStackFrames (); 387 388 void 389 DumpUsingSettingsFormat (Stream &strm, uint32_t frame_idx); 390 391 //------------------------------------------------------------------ 392 // Thread Plan Providers: 393 // This section provides the basic thread plans that the Process control 394 // machinery uses to run the target. ThreadPlan.h provides more details on 395 // how this mechanism works. 396 // The thread provides accessors to a set of plans that perform basic operations. 397 // The idea is that particular Platform plugins can override these methods to 398 // provide the implementation of these basic operations appropriate to their 399 // environment. 400 //------------------------------------------------------------------ 401 402 //------------------------------------------------------------------ 403 /// Queues the base plan for a thread. 404 /// The version returned by Process does some things that are useful, 405 /// like handle breakpoints and signals, so if you return a plugin specific 406 /// one you probably want to call through to the Process one for anything 407 /// your plugin doesn't explicitly handle. 408 /// 409 /// @param[in] abort_other_plans 410 /// \b true if we discard the currently queued plans and replace them with this one. 411 /// Otherwise this plan will go on the end of the plan stack. 412 /// 413 /// @return 414 /// A pointer to the newly queued thread plan, or NULL if the plan could not be queued. 415 //------------------------------------------------------------------ 416 virtual ThreadPlan * 417 QueueFundamentalPlan (bool abort_other_plans); 418 419 //------------------------------------------------------------------ 420 /// Queues the plan used to step over a breakpoint at the current PC of \a thread. 421 /// The default version returned by Process handles trap based breakpoints, and 422 /// will disable the breakpoint, single step over it, then re-enable it. 423 /// 424 /// @param[in] abort_other_plans 425 /// \b true if we discard the currently queued plans and replace them with this one. 426 /// Otherwise this plan will go on the end of the plan stack. 427 /// 428 /// @return 429 /// A pointer to the newly queued thread plan, or NULL if the plan could not be queued. 430 //------------------------------------------------------------------ 431 virtual ThreadPlan * 432 QueueThreadPlanForStepOverBreakpointPlan (bool abort_other_plans); 433 434 //------------------------------------------------------------------ 435 /// Queues the plan used to step one instruction from the current PC of \a thread. 436 /// 437 /// @param[in] step_over 438 /// \b true if we step over calls to functions, false if we step in. 439 /// 440 /// @param[in] abort_other_plans 441 /// \b true if we discard the currently queued plans and replace them with this one. 442 /// Otherwise this plan will go on the end of the plan stack. 443 /// 444 /// @param[in] stop_other_threads 445 /// \b true if we will stop other threads while we single step this one. 446 /// 447 /// @return 448 /// A pointer to the newly queued thread plan, or NULL if the plan could not be queued. 449 //------------------------------------------------------------------ 450 virtual ThreadPlan * 451 QueueThreadPlanForStepSingleInstruction (bool step_over, 452 bool abort_other_plans, 453 bool stop_other_threads); 454 455 //------------------------------------------------------------------ 456 /// Queues the plan used to step through an address range, stepping into or over 457 /// function calls depending on the value of StepType. 458 /// 459 /// @param[in] abort_other_plans 460 /// \b true if we discard the currently queued plans and replace them with this one. 461 /// Otherwise this plan will go on the end of the plan stack. 462 /// 463 /// @param[in] type 464 /// Type of step to do, only eStepTypeInto and eStepTypeOver are supported by this plan. 465 /// 466 /// @param[in] range 467 /// The address range to step through. 468 /// 469 /// @param[in] addr_context 470 /// When dealing with stepping through inlined functions the current PC is not enough information to know 471 /// what "step" means. For instance a series of nested inline functions might start at the same address. 472 // The \a addr_context provides the current symbol context the step 473 /// is supposed to be out of. 474 // FIXME: Currently unused. 475 /// 476 /// @param[in] stop_other_threads 477 /// \b true if we will stop other threads while we single step this one. 478 /// 479 /// @return 480 /// A pointer to the newly queued thread plan, or NULL if the plan could not be queued. 481 //------------------------------------------------------------------ 482 virtual ThreadPlan * 483 QueueThreadPlanForStepRange (bool abort_other_plans, 484 StepType type, 485 const AddressRange &range, 486 const SymbolContext &addr_context, 487 lldb::RunMode stop_other_threads, 488 bool avoid_code_without_debug_info); 489 490 //------------------------------------------------------------------ 491 /// Queue the plan used to step out of the function at the current PC of 492 /// \a thread. 493 /// 494 /// @param[in] abort_other_plans 495 /// \b true if we discard the currently queued plans and replace them with this one. 496 /// Otherwise this plan will go on the end of the plan stack. 497 /// 498 /// @param[in] addr_context 499 /// When dealing with stepping through inlined functions the current PC is not enough information to know 500 /// what "step" means. For instance a series of nested inline functions might start at the same address. 501 // The \a addr_context provides the current symbol context the step 502 /// is supposed to be out of. 503 // FIXME: Currently unused. 504 /// 505 /// @param[in] first_insn 506 /// \b true if this is the first instruction of a function. 507 /// 508 /// @param[in] stop_other_threads 509 /// \b true if we will stop other threads while we single step this one. 510 /// 511 /// @param[in] stop_vote 512 /// @param[in] run_vote 513 /// See standard meanings for the stop & run votes in ThreadPlan.h. 514 /// 515 /// @return 516 /// A pointer to the newly queued thread plan, or NULL if the plan could not be queued. 517 //------------------------------------------------------------------ 518 virtual ThreadPlan * 519 QueueThreadPlanForStepOut (bool abort_other_plans, 520 SymbolContext *addr_context, 521 bool first_insn, 522 bool stop_other_threads, 523 Vote stop_vote, // = eVoteYes, 524 Vote run_vote, // = eVoteNoOpinion); 525 uint32_t frame_idx); 526 527 //------------------------------------------------------------------ 528 /// Gets the plan used to step through the code that steps from a function 529 /// call site at the current PC into the actual function call. 530 /// 531 /// @param[in] abort_other_plans 532 /// \b true if we discard the currently queued plans and replace them with this one. 533 /// Otherwise this plan will go on the end of the plan stack. 534 /// 535 /// @param[in] stop_other_threads 536 /// \b true if we will stop other threads while we single step this one. 537 /// 538 /// @return 539 /// A pointer to the newly queued thread plan, or NULL if the plan could not be queued. 540 //------------------------------------------------------------------ 541 virtual ThreadPlan * 542 QueueThreadPlanForStepThrough (bool abort_other_plans, 543 bool stop_other_threads); 544 545 //------------------------------------------------------------------ 546 /// Gets the plan used to continue from the current PC. 547 /// This is a simple plan, mostly useful as a backstop when you are continuing 548 /// for some particular purpose. 549 /// 550 /// @param[in] abort_other_plans 551 /// \b true if we discard the currently queued plans and replace them with this one. 552 /// Otherwise this plan will go on the end of the plan stack. 553 /// 554 /// @param[in] target_addr 555 /// The address to which we're running. 556 /// 557 /// @param[in] stop_other_threads 558 /// \b true if we will stop other threads while we single step this one. 559 /// 560 /// @return 561 /// A pointer to the newly queued thread plan, or NULL if the plan could not be queued. 562 //------------------------------------------------------------------ 563 virtual ThreadPlan * 564 QueueThreadPlanForRunToAddress (bool abort_other_plans, 565 Address &target_addr, 566 bool stop_other_threads); 567 568 virtual ThreadPlan * 569 QueueThreadPlanForStepUntil (bool abort_other_plans, 570 lldb::addr_t *address_list, 571 size_t num_addresses, 572 bool stop_others, 573 uint32_t frame_idx); 574 575 virtual ThreadPlan * 576 QueueThreadPlanForCallFunction (bool abort_other_plans, 577 Address& function, 578 lldb::addr_t arg, 579 bool stop_other_threads, 580 bool discard_on_error = false); 581 582 //------------------------------------------------------------------ 583 // Thread Plan accessors: 584 //------------------------------------------------------------------ 585 586 //------------------------------------------------------------------ 587 /// Gets the plan which will execute next on the plan stack. 588 /// 589 /// @return 590 /// A pointer to the next executed plan. 591 //------------------------------------------------------------------ 592 ThreadPlan * 593 GetCurrentPlan (); 594 595private: 596 bool 597 PlanIsBasePlan (ThreadPlan *plan_ptr) 598 { 599 if (m_plan_stack.size() == 0) 600 return false; 601 return m_plan_stack[0].get() == plan_ptr; 602 } 603public: 604 605 //------------------------------------------------------------------ 606 /// Gets the inner-most plan that was popped off the plan stack in the 607 /// most recent stop. Useful for printing the stop reason accurately. 608 /// 609 /// @return 610 /// A pointer to the last completed plan. 611 //------------------------------------------------------------------ 612 lldb::ThreadPlanSP 613 GetCompletedPlan (); 614 615 //------------------------------------------------------------------ 616 /// Checks whether the given plan is in the completed plans for this 617 /// stop. 618 /// 619 /// @param[in] plan 620 /// Pointer to the plan you're checking. 621 /// 622 /// @return 623 /// Returns true if the input plan is in the completed plan stack, 624 /// false otherwise. 625 //------------------------------------------------------------------ 626 bool 627 IsThreadPlanDone (ThreadPlan *plan); 628 629 //------------------------------------------------------------------ 630 /// Checks whether the given plan is in the discarded plans for this 631 /// stop. 632 /// 633 /// @param[in] plan 634 /// Pointer to the plan you're checking. 635 /// 636 /// @return 637 /// Returns true if the input plan is in the discarded plan stack, 638 /// false otherwise. 639 //------------------------------------------------------------------ 640 bool 641 WasThreadPlanDiscarded (ThreadPlan *plan); 642 643 //------------------------------------------------------------------ 644 /// Queues a generic thread plan. 645 /// 646 /// @param[in] plan_sp 647 /// The plan to queue. 648 /// 649 /// @param[in] abort_other_plans 650 /// \b true if we discard the currently queued plans and replace them with this one. 651 /// Otherwise this plan will go on the end of the plan stack. 652 /// 653 /// @return 654 /// A pointer to the last completed plan. 655 //------------------------------------------------------------------ 656 void 657 QueueThreadPlan (lldb::ThreadPlanSP &plan_sp, bool abort_other_plans); 658 659 660 //------------------------------------------------------------------ 661 /// Discards the plans queued on the plan stack of the current thread. This is 662 /// arbitrated by the "Master" ThreadPlans, using the "OkayToDiscard" call. 663 // But if \a force is true, all thread plans are discarded. 664 //------------------------------------------------------------------ 665 void 666 DiscardThreadPlans (bool force); 667 668 //------------------------------------------------------------------ 669 /// Discards the plans queued on the plan stack of the current thread up to and 670 /// including up_to_plan_sp. 671 // 672 // @param[in] up_to_plan_sp 673 // Discard all plans up to and including this one. 674 //------------------------------------------------------------------ 675 void 676 DiscardThreadPlansUpToPlan (lldb::ThreadPlanSP &up_to_plan_sp); 677 678 //------------------------------------------------------------------ 679 /// Prints the current plan stack. 680 /// 681 /// @param[in] s 682 /// The stream to which to dump the plan stack info. 683 /// 684 //------------------------------------------------------------------ 685 void 686 DumpThreadPlans (Stream *s) const; 687 688 virtual bool 689 CheckpointThreadState (ThreadStateCheckpoint &saved_state); 690 691 virtual bool 692 RestoreThreadStateFromCheckpoint (ThreadStateCheckpoint &saved_state); 693 694 void 695 EnableTracer (bool value, bool single_step); 696 697 void 698 SetTracer (lldb::ThreadPlanTracerSP &tracer_sp); 699 700 //------------------------------------------------------------------ 701 /// The regular expression returned determines symbols that this 702 /// thread won't stop in during "step-in" operations. 703 /// 704 /// @return 705 /// A pointer to a regular expression to compare against symbols, 706 /// or NULL if all symbols are allowed. 707 /// 708 //------------------------------------------------------------------ 709 RegularExpression * 710 GetSymbolsToAvoidRegexp() 711 { 712 return ThreadInstanceSettings::GetSymbolsToAvoidRegexp(); 713 } 714 715 // Get the thread index ID. The index ID that is guaranteed to not be 716 // re-used by a process. They start at 1 and increase with each new thread. 717 // This allows easy command line access by a unique ID that is easier to 718 // type than the actual system thread ID. 719 uint32_t 720 GetIndexID () const; 721 722 //------------------------------------------------------------------ 723 // lldb::ExecutionContextScope pure virtual functions 724 //------------------------------------------------------------------ 725 virtual Target * 726 CalculateTarget (); 727 728 virtual Process * 729 CalculateProcess (); 730 731 virtual Thread * 732 CalculateThread (); 733 734 virtual StackFrame * 735 CalculateStackFrame (); 736 737 virtual void 738 CalculateExecutionContext (ExecutionContext &exe_ctx); 739 740 lldb::StackFrameSP 741 GetStackFrameSPForStackFramePtr (StackFrame *stack_frame_ptr); 742 743 size_t 744 GetStatus (Stream &strm, 745 uint32_t start_frame, 746 uint32_t num_frames, 747 uint32_t num_frames_with_source); 748 749 size_t 750 GetStackFrameStatus (Stream& strm, 751 uint32_t first_frame, 752 uint32_t num_frames, 753 bool show_frame_info, 754 uint32_t num_frames_with_source, 755 uint32_t source_lines_before, 756 uint32_t source_lines_after); 757 758protected: 759 760 friend class ThreadPlan; 761 friend class StackFrameList; 762 763 // This is necessary to make sure thread assets get destroyed while the thread is still in good shape 764 // to call virtual thread methods. This must be called by classes that derive from Thread in their destructor. 765 virtual void DestroyThread (); 766 767 void 768 PushPlan (lldb::ThreadPlanSP &plan_sp); 769 770 void 771 PopPlan (); 772 773 void 774 DiscardPlan (); 775 776 ThreadPlan *GetPreviousPlan (ThreadPlan *plan); 777 778 // When you implement this method, make sure you don't overwrite the m_actual_stop_info if it claims to be 779 // valid. The stop info may be a "checkpointed and restored" stop info, so if it is still around it is right 780 // even if you have not calculated this yourself, or if it disagrees with what you might have calculated. 781 virtual lldb::StopInfoSP 782 GetPrivateStopReason () = 0; 783 784 typedef std::vector<lldb::ThreadPlanSP> plan_stack; 785 786 void 787 SetStopInfo (const lldb::StopInfoSP &stop_info_sp); 788 789 virtual bool 790 SaveFrameZeroState (RegisterCheckpoint &checkpoint); 791 792 virtual bool 793 RestoreSaveFrameZero (const RegisterCheckpoint &checkpoint); 794 795 virtual lldb_private::Unwind * 796 GetUnwinder (); 797 798 StackFrameList & 799 GetStackFrameList (); 800 801 struct ThreadState 802 { 803 uint32_t orig_stop_id; 804 lldb::StopInfoSP stop_info_sp; 805 RegisterCheckpoint register_backup; 806 }; 807 808 //------------------------------------------------------------------ 809 // Classes that inherit from Process can see and modify these 810 //------------------------------------------------------------------ 811 Process & m_process; ///< The process that owns this thread. 812 lldb::StopInfoSP m_actual_stop_info_sp; ///< The private stop reason for this thread 813 const uint32_t m_index_id; ///< A unique 1 based index assigned to each thread for easy UI/command line access. 814 lldb::RegisterContextSP m_reg_context_sp; ///< The register context for this thread's current register state. 815 lldb::StateType m_state; ///< The state of our process. 816 mutable Mutex m_state_mutex; ///< Multithreaded protection for m_state. 817 plan_stack m_plan_stack; ///< The stack of plans this thread is executing. 818 plan_stack m_completed_plan_stack; ///< Plans that have been completed by this stop. They get deleted when the thread resumes. 819 plan_stack m_discarded_plan_stack; ///< Plans that have been discarded by this stop. They get deleted when the thread resumes. 820 lldb::StackFrameListSP m_curr_frames_sp; ///< The stack frames that get lazily populated after a thread stops. 821 lldb::StackFrameListSP m_prev_frames_sp; ///< The previous stack frames from the last time this thread stopped. 822 int m_resume_signal; ///< The signal that should be used when continuing this thread. 823 lldb::StateType m_resume_state; ///< The state that indicates what this thread should do when the process is resumed. 824 std::auto_ptr<lldb_private::Unwind> m_unwinder_ap; 825 bool m_destroy_called; // This is used internally to make sure derived Thread classes call DestroyThread. 826 uint32_t m_thread_stop_reason_stop_id; // This is the stop id for which the StopInfo is valid. Can use this so you know that 827 // the thread's m_actual_stop_info_sp is current and you don't have to fetch it again 828 829private: 830 //------------------------------------------------------------------ 831 // For Thread only 832 //------------------------------------------------------------------ 833 834 DISALLOW_COPY_AND_ASSIGN (Thread); 835 836}; 837 838} // namespace lldb_private 839 840#endif // liblldb_Thread_h_ 841