Thread.h revision 5c4b1607e8783a3d3f1f28fa66fcaa89ac246bd1
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() { return m_process; }
210
211    const Process &
212    GetProcess() const { return m_process; }
213
214    int
215    GetResumeSignal () const
216    {
217        return m_resume_signal;
218    }
219
220    void
221    SetResumeSignal (int signal)
222    {
223        m_resume_signal = signal;
224    }
225
226    lldb::StateType
227    GetState() const;
228
229    lldb::ThreadSP
230    GetSP ();
231
232    void
233    SetState (lldb::StateType state);
234
235    lldb::StateType
236    GetResumeState () const
237    {
238        return m_resume_state;
239    }
240
241    void
242    SetResumeState (lldb::StateType state)
243    {
244        m_resume_state = state;
245    }
246
247    // This function is called on all the threads before "WillResume" in case
248    // a thread needs to change its state before the ThreadList polls all the
249    // threads to figure out which ones actually will get to run and how.
250    void
251    SetupForResume ();
252
253    // Override this to do platform specific tasks before resume, but always
254    // call the Thread::WillResume at the end of your work.
255
256    virtual bool
257    WillResume (lldb::StateType resume_state);
258
259    // This clears generic thread state after a resume.  If you subclass this,
260    // be sure to call it.
261    virtual void
262    DidResume ();
263
264    virtual void
265    RefreshStateAfterStop() = 0;
266
267    void
268    WillStop ();
269
270    bool
271    ShouldStop (Event *event_ptr);
272
273    Vote
274    ShouldReportStop (Event *event_ptr);
275
276    Vote
277    ShouldReportRun (Event *event_ptr);
278
279    // Return whether this thread matches the specification in ThreadSpec.  This is a virtual
280    // method because at some point we may extend the thread spec with a platform specific
281    // dictionary of attributes, which then only the platform specific Thread implementation
282    // would know how to match.  For now, this just calls through to the ThreadSpec's
283    // ThreadPassesBasicTests method.
284    virtual bool
285    MatchesSpec (const ThreadSpec *spec);
286
287    lldb::StopInfoSP
288    GetStopInfo ();
289
290    // This sets the stop reason to a "blank" stop reason, so you can call functions on the thread
291    // without having the called function run with whatever stop reason you stopped with.
292    void
293    SetStopInfoToNothing();
294
295    bool
296    ThreadStoppedForAReason ();
297
298    static const char *
299    RunModeAsCString (lldb::RunMode mode);
300
301    static const char *
302    StopReasonAsCString (lldb::StopReason reason);
303
304    virtual const char *
305    GetInfo () = 0;
306
307    virtual const char *
308    GetName ()
309    {
310        return NULL;
311    }
312
313    virtual const char *
314    GetQueueName ()
315    {
316        return NULL;
317    }
318
319    virtual uint32_t
320    GetStackFrameCount();
321
322    virtual lldb::StackFrameSP
323    GetStackFrameAtIndex (uint32_t idx);
324
325    virtual lldb::StackFrameSP
326    GetFrameWithConcreteFrameIndex (uint32_t unwind_idx);
327
328    virtual lldb::StackFrameSP
329    GetFrameWithStackID(StackID &stack_id);
330
331    uint32_t
332    GetSelectedFrameIndex ();
333
334    lldb::StackFrameSP
335    GetSelectedFrame ();
336
337    uint32_t
338    SetSelectedFrame (lldb_private::StackFrame *frame);
339
340    void
341    SetSelectedFrameByIndex (uint32_t frame_idx);
342
343    virtual lldb::RegisterContextSP
344    GetRegisterContext () = 0;
345
346    virtual lldb::RegisterContextSP
347    CreateRegisterContextForFrame (StackFrame *frame) = 0;
348
349    virtual void
350    ClearStackFrames ();
351
352    void
353    DumpUsingSettingsFormat (Stream &strm, uint32_t frame_idx);
354
355    //------------------------------------------------------------------
356    // Thread Plan Providers:
357    // This section provides the basic thread plans that the Process control
358    // machinery uses to run the target.  ThreadPlan.h provides more details on
359    // how this mechanism works.
360    // The thread provides accessors to a set of plans that perform basic operations.
361    // The idea is that particular Platform plugins can override these methods to
362    // provide the implementation of these basic operations appropriate to their
363    // environment.
364    //------------------------------------------------------------------
365
366    //------------------------------------------------------------------
367    /// Queues the base plan for a thread.
368    /// The version returned by Process does some things that are useful,
369    /// like handle breakpoints and signals, so if you return a plugin specific
370    /// one you probably want to call through to the Process one for anything
371    /// your plugin doesn't explicitly handle.
372    ///
373    /// @param[in] abort_other_plans
374    ///    \b true if we discard the currently queued plans and replace them with this one.
375    ///    Otherwise this plan will go on the end of the plan stack.
376    ///
377    /// @return
378    ///     A pointer to the newly queued thread plan, or NULL if the plan could not be queued.
379    //------------------------------------------------------------------
380    virtual ThreadPlan *
381    QueueFundamentalPlan (bool abort_other_plans);
382
383    //------------------------------------------------------------------
384    /// Queues the plan used to step over a breakpoint at the current PC of \a thread.
385    /// The default version returned by Process handles trap based breakpoints, and
386    /// will disable the breakpoint, single step over it, then re-enable it.
387    ///
388    /// @param[in] abort_other_plans
389    ///    \b true if we discard the currently queued plans and replace them with this one.
390    ///    Otherwise this plan will go on the end of the plan stack.
391    ///
392    /// @return
393    ///     A pointer to the newly queued thread plan, or NULL if the plan could not be queued.
394    //------------------------------------------------------------------
395    virtual ThreadPlan *
396    QueueThreadPlanForStepOverBreakpointPlan (bool abort_other_plans);
397
398    //------------------------------------------------------------------
399    /// Queues the plan used to step one instruction from the current PC of \a thread.
400    ///
401    /// @param[in] step_over
402    ///    \b true if we step over calls to functions, false if we step in.
403    ///
404    /// @param[in] abort_other_plans
405    ///    \b true if we discard the currently queued plans and replace them with this one.
406    ///    Otherwise this plan will go on the end of the plan stack.
407    ///
408    /// @param[in] stop_other_threads
409    ///    \b true if we will stop other threads while we single step this one.
410    ///
411    /// @return
412    ///     A pointer to the newly queued thread plan, or NULL if the plan could not be queued.
413    //------------------------------------------------------------------
414    virtual ThreadPlan *
415    QueueThreadPlanForStepSingleInstruction (bool step_over,
416                                             bool abort_other_plans,
417                                             bool stop_other_threads);
418
419    //------------------------------------------------------------------
420    /// Queues the plan used to step through an address range, stepping into or over
421    /// function calls depending on the value of StepType.
422    ///
423    /// @param[in] abort_other_plans
424    ///    \b true if we discard the currently queued plans and replace them with this one.
425    ///    Otherwise this plan will go on the end of the plan stack.
426    ///
427    /// @param[in] type
428    ///    Type of step to do, only eStepTypeInto and eStepTypeOver are supported by this plan.
429    ///
430    /// @param[in] range
431    ///    The address range to step through.
432    ///
433    /// @param[in] addr_context
434    ///    When dealing with stepping through inlined functions the current PC is not enough information to know
435    ///    what "step" means.  For instance a series of nested inline functions might start at the same address.
436    //     The \a addr_context provides the current symbol context the step
437    ///    is supposed to be out of.
438    //   FIXME: Currently unused.
439    ///
440    /// @param[in] stop_other_threads
441    ///    \b true if we will stop other threads while we single step this one.
442    ///
443    /// @return
444    ///     A pointer to the newly queued thread plan, or NULL if the plan could not be queued.
445    //------------------------------------------------------------------
446    virtual ThreadPlan *
447    QueueThreadPlanForStepRange (bool abort_other_plans,
448                                 StepType type,
449                                 const AddressRange &range,
450                                 const SymbolContext &addr_context,
451                                 lldb::RunMode stop_other_threads,
452                                 bool avoid_code_without_debug_info);
453
454    //------------------------------------------------------------------
455    /// Queue the plan used to step out of the function at the current PC of
456    /// \a thread.
457    ///
458    /// @param[in] abort_other_plans
459    ///    \b true if we discard the currently queued plans and replace them with this one.
460    ///    Otherwise this plan will go on the end of the plan stack.
461    ///
462    /// @param[in] addr_context
463    ///    When dealing with stepping through inlined functions the current PC is not enough information to know
464    ///    what "step" means.  For instance a series of nested inline functions might start at the same address.
465    //     The \a addr_context provides the current symbol context the step
466    ///    is supposed to be out of.
467    //   FIXME: Currently unused.
468    ///
469    /// @param[in] first_insn
470    ///     \b true if this is the first instruction of a function.
471    ///
472    /// @param[in] stop_other_threads
473    ///    \b true if we will stop other threads while we single step this one.
474    ///
475    /// @param[in] stop_vote
476    /// @param[in] run_vote
477    ///    See standard meanings for the stop & run votes in ThreadPlan.h.
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    QueueThreadPlanForStepOut (bool abort_other_plans,
484                               SymbolContext *addr_context,
485                               bool first_insn,
486                               bool stop_other_threads,
487                               Vote stop_vote, // = eVoteYes,
488                               Vote run_vote, // = eVoteNoOpinion);
489                               uint32_t frame_idx);
490
491    //------------------------------------------------------------------
492    /// Gets the plan used to step through the code that steps from a function
493    /// call site at the current PC into the actual function call.
494    ///
495    /// @param[in] abort_other_plans
496    ///    \b true if we discard the currently queued plans and replace them with this one.
497    ///    Otherwise this plan will go on the end of the plan stack.
498    ///
499    /// @param[in] stop_other_threads
500    ///    \b true if we will stop other threads while we single step this one.
501    ///
502    /// @return
503    ///     A pointer to the newly queued thread plan, or NULL if the plan could not be queued.
504    //------------------------------------------------------------------
505    virtual ThreadPlan *
506    QueueThreadPlanForStepThrough (bool abort_other_plans,
507                                   bool stop_other_threads);
508
509    //------------------------------------------------------------------
510    /// Gets the plan used to continue from the current PC.
511    /// This is a simple plan, mostly useful as a backstop when you are continuing
512    /// for some particular purpose.
513    ///
514    /// @param[in] abort_other_plans
515    ///    \b true if we discard the currently queued plans and replace them with this one.
516    ///    Otherwise this plan will go on the end of the plan stack.
517    ///
518    /// @param[in] target_addr
519    ///    The address to which we're running.
520    ///
521    /// @param[in] stop_other_threads
522    ///    \b true if we will stop other threads while we single step this one.
523    ///
524    /// @return
525    ///     A pointer to the newly queued thread plan, or NULL if the plan could not be queued.
526    //------------------------------------------------------------------
527    virtual ThreadPlan *
528    QueueThreadPlanForRunToAddress (bool abort_other_plans,
529                                    Address &target_addr,
530                                    bool stop_other_threads);
531
532    virtual ThreadPlan *
533    QueueThreadPlanForStepUntil (bool abort_other_plans,
534                                 lldb::addr_t *address_list,
535                                 size_t num_addresses,
536                                 bool stop_others,
537                                 uint32_t frame_idx);
538
539    virtual ThreadPlan *
540    QueueThreadPlanForCallFunction (bool abort_other_plans,
541                                    Address& function,
542                                    lldb::addr_t arg,
543                                    bool stop_other_threads,
544                                    bool discard_on_error = false);
545
546    //------------------------------------------------------------------
547    // Thread Plan accessors:
548    //------------------------------------------------------------------
549
550    //------------------------------------------------------------------
551    /// Gets the plan which will execute next on the plan stack.
552    ///
553    /// @return
554    ///     A pointer to the next executed plan.
555    //------------------------------------------------------------------
556    ThreadPlan *
557    GetCurrentPlan ();
558
559private:
560    bool
561    PlanIsBasePlan (ThreadPlan *plan_ptr)
562    {
563        if (m_plan_stack.size() == 0)
564            return false;
565        return m_plan_stack[0].get() == plan_ptr;
566    }
567public:
568
569    //------------------------------------------------------------------
570    /// Gets the inner-most plan that was popped off the plan stack in the
571    /// most recent stop.  Useful for printing the stop reason accurately.
572    ///
573    /// @return
574    ///     A pointer to the last completed plan.
575    //------------------------------------------------------------------
576    lldb::ThreadPlanSP
577    GetCompletedPlan ();
578
579    //------------------------------------------------------------------
580    ///  Checks whether the given plan is in the completed plans for this
581    ///  stop.
582    ///
583    /// @param[in] plan
584    ///     Pointer to the plan you're checking.
585    ///
586    /// @return
587    ///     Returns true if the input plan is in the completed plan stack,
588    ///     false otherwise.
589    //------------------------------------------------------------------
590    bool
591    IsThreadPlanDone (ThreadPlan *plan);
592
593    //------------------------------------------------------------------
594    ///  Checks whether the given plan is in the discarded plans for this
595    ///  stop.
596    ///
597    /// @param[in] plan
598    ///     Pointer to the plan you're checking.
599    ///
600    /// @return
601    ///     Returns true if the input plan is in the discarded plan stack,
602    ///     false otherwise.
603    //------------------------------------------------------------------
604    bool
605    WasThreadPlanDiscarded (ThreadPlan *plan);
606
607    //------------------------------------------------------------------
608    /// Queues a generic thread plan.
609    ///
610    /// @param[in] plan_sp
611    ///    The plan to queue.
612    ///
613    /// @param[in] abort_other_plans
614    ///    \b true if we discard the currently queued plans and replace them with this one.
615    ///    Otherwise this plan will go on the end of the plan stack.
616    ///
617    /// @return
618    ///     A pointer to the last completed plan.
619    //------------------------------------------------------------------
620    void
621    QueueThreadPlan (lldb::ThreadPlanSP &plan_sp, bool abort_other_plans);
622
623
624    //------------------------------------------------------------------
625    /// Discards the plans queued on the plan stack of the current thread.  This is
626    /// arbitrated by the "Master" ThreadPlans, using the "OkayToDiscard" call.
627    //  But if \a force is true, all thread plans are discarded.
628    //------------------------------------------------------------------
629    void
630    DiscardThreadPlans (bool force);
631
632    //------------------------------------------------------------------
633    /// Discards the plans queued on the plan stack of the current thread up to and
634    /// including up_to_plan_sp.
635    //
636    // @param[in] up_to_plan_sp
637    //   Discard all plans up to and including this one.
638    //------------------------------------------------------------------
639    void
640    DiscardThreadPlansUpToPlan (lldb::ThreadPlanSP &up_to_plan_sp);
641
642    //------------------------------------------------------------------
643    /// Prints the current plan stack.
644    ///
645    /// @param[in] s
646    ///    The stream to which to dump the plan stack info.
647    ///
648    //------------------------------------------------------------------
649    void
650    DumpThreadPlans (Stream *s) const;
651
652    virtual bool
653    CheckpointThreadState (ThreadStateCheckpoint &saved_state);
654
655    virtual bool
656    RestoreThreadStateFromCheckpoint (ThreadStateCheckpoint &saved_state);
657
658    void
659    EnableTracer (bool value, bool single_step);
660
661    void
662    SetTracer (lldb::ThreadPlanTracerSP &tracer_sp);
663
664    //------------------------------------------------------------------
665    /// The regular expression returned determines symbols that this
666    /// thread won't stop in during "step-in" operations.
667    ///
668    /// @return
669    ///    A pointer to a regular expression to compare against symbols,
670    ///    or NULL if all symbols are allowed.
671    ///
672    //------------------------------------------------------------------
673    RegularExpression *
674    GetSymbolsToAvoidRegexp()
675    {
676        return ThreadInstanceSettings::GetSymbolsToAvoidRegexp();
677    }
678
679    // Get the thread index ID. The index ID that is guaranteed to not be
680    // re-used by a process. They start at 1 and increase with each new thread.
681    // This allows easy command line access by a unique ID that is easier to
682    // type than the actual system thread ID.
683    uint32_t
684    GetIndexID () const;
685
686    //------------------------------------------------------------------
687    // lldb::ExecutionContextScope pure virtual functions
688    //------------------------------------------------------------------
689    virtual Target *
690    CalculateTarget ();
691
692    virtual Process *
693    CalculateProcess ();
694
695    virtual Thread *
696    CalculateThread ();
697
698    virtual StackFrame *
699    CalculateStackFrame ();
700
701    virtual void
702    CalculateExecutionContext (ExecutionContext &exe_ctx);
703
704    lldb::StackFrameSP
705    GetStackFrameSPForStackFramePtr (StackFrame *stack_frame_ptr);
706
707protected:
708
709    friend class ThreadPlan;
710    friend class StackFrameList;
711
712    // This is necessary to make sure thread assets get destroyed while the thread is still in good shape
713    // to call virtual thread methods.  This must be called by classes that derive from Thread in their destructor.
714    virtual void DestroyThread ();
715
716    void
717    PushPlan (lldb::ThreadPlanSP &plan_sp);
718
719    void
720    PopPlan ();
721
722    void
723    DiscardPlan ();
724
725    ThreadPlan *GetPreviousPlan (ThreadPlan *plan);
726
727    // When you implement this method, make sure you don't overwrite the m_actual_stop_info if it claims to be
728    // valid.  The stop info may be a "checkpointed and restored" stop info, so if it is still around it is right
729    // even if you have not calculated this yourself, or if it disagrees with what you might have calculated.
730    virtual lldb::StopInfoSP
731    GetPrivateStopReason () = 0;
732
733    typedef std::vector<lldb::ThreadPlanSP> plan_stack;
734
735    void
736    SetStopInfo (const lldb::StopInfoSP &stop_info_sp);
737
738    virtual bool
739    SaveFrameZeroState (RegisterCheckpoint &checkpoint) = 0;
740
741    virtual bool
742    RestoreSaveFrameZero (const RegisterCheckpoint &checkpoint) = 0;
743
744    virtual lldb_private::Unwind *
745    GetUnwinder () = 0;
746
747    StackFrameList &
748    GetStackFrameList ();
749
750    struct ThreadState
751    {
752        uint32_t           orig_stop_id;
753        lldb::StopInfoSP   stop_info_sp;
754        RegisterCheckpoint register_backup;
755    };
756
757    //------------------------------------------------------------------
758    // Classes that inherit from Process can see and modify these
759    //------------------------------------------------------------------
760    Process &           m_process;          ///< The process that owns this thread.
761    lldb::StopInfoSP    m_actual_stop_info_sp;     ///< The private stop reason for this thread
762    const uint32_t      m_index_id;         ///< A unique 1 based index assigned to each thread for easy UI/command line access.
763    lldb::RegisterContextSP   m_reg_context_sp;   ///< The register context for this thread's current register state.
764    lldb::StateType     m_state;            ///< The state of our process.
765    mutable Mutex       m_state_mutex;      ///< Multithreaded protection for m_state.
766    plan_stack          m_plan_stack;       ///< The stack of plans this thread is executing.
767    plan_stack          m_completed_plan_stack;  ///< Plans that have been completed by this stop.  They get deleted when the thread resumes.
768    plan_stack          m_discarded_plan_stack;  ///< Plans that have been discarded by this stop.  They get deleted when the thread resumes.
769    std::auto_ptr<StackFrameList> m_curr_frames_ap; ///< The stack frames that get lazily populated after a thread stops.
770    lldb::StackFrameListSP m_prev_frames_sp; ///< The previous stack frames from the last time this thread stopped.
771    int                 m_resume_signal;    ///< The signal that should be used when continuing this thread.
772    lldb::StateType     m_resume_state;     ///< The state that indicates what this thread should do when the process is resumed.
773    std::auto_ptr<lldb_private::Unwind> m_unwinder_ap;
774    bool                m_destroy_called;    // This is used internally to make sure derived Thread classes call DestroyThread.
775    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
776                                             // the thread's m_actual_stop_info_sp is current and you don't have to fetch it again
777
778private:
779    //------------------------------------------------------------------
780    // For Thread only
781    //------------------------------------------------------------------
782
783    DISALLOW_COPY_AND_ASSIGN (Thread);
784
785};
786
787} // namespace lldb_private
788
789#endif  // liblldb_Thread_h_
790