1 //===-- ThreadPlanStepInRange.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_ThreadPlanStepInRange_h_
11 #define liblldb_ThreadPlanStepInRange_h_
12 
13 // C Includes
14 // C++ Includes
15 // Other libraries and framework includes
16 // Project includes
17 #include "lldb/Core/AddressRange.h"
18 #include "lldb/Target/StackID.h"
19 #include "lldb/Target/Thread.h"
20 #include "lldb/Target/ThreadPlanStepRange.h"
21 #include "lldb/Target/ThreadPlanShouldStopHere.h"
22 
23 namespace lldb_private {
24 
25 class ThreadPlanStepInRange :
26     public ThreadPlanStepRange,
27     public ThreadPlanShouldStopHere
28 {
29 public:
30     ThreadPlanStepInRange (Thread &thread,
31                            const AddressRange &range,
32                            const SymbolContext &addr_context,
33                            lldb::RunMode stop_others);
34 
35     virtual
36     ~ThreadPlanStepInRange ();
37 
38     virtual void
39     GetDescription (Stream *s, lldb::DescriptionLevel level);
40 
41     virtual bool
42     ShouldStop (Event *event_ptr);
43 
44     void SetAvoidRegexp(const char *name);
45 
46     static ThreadPlan *
47     DefaultShouldStopHereCallback (ThreadPlan *current_plan, Flags &flags, void *baton);
48 
49     static void
50     SetDefaultFlagValue (uint32_t new_value);
51 
52     virtual bool
53     PlanExplainsStop ();
54 
55 protected:
56 
57     virtual void
58     SetFlagsToDefault ();
59 
60     bool
61     FrameMatchesAvoidRegexp ();
62 
63 private:
64 
65     friend ThreadPlan *
66     Thread::QueueThreadPlanForStepRange (bool abort_other_plans,
67                                          StepType type,
68                                          const AddressRange &range,
69                                          const SymbolContext &addr_context,
70                                          lldb::RunMode stop_others,
71                                          bool avoid_code_without_debug_info);
72 
73 
74     // Need an appropriate marker for the current stack so we can tell step out
75     // from step in.
76 
77     static uint32_t s_default_flag_values;
78     std::auto_ptr<RegularExpression> m_avoid_regexp_ap;
79     bool m_step_past_prologue;  // FIXME: For now hard-coded to true, we could put a switch in for this if there's
80                                 // demand for that.
81 
82     DISALLOW_COPY_AND_ASSIGN (ThreadPlanStepInRange);
83 
84 };
85 
86 } // namespace lldb_private
87 
88 #endif  // liblldb_ThreadPlanStepInRange_h_
89