ThreadPlanStepInRange.h revision 89e248f04ecb87d0df4a4b96158c3fac0a3e43c7
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
23namespace lldb_private {
24
25class ThreadPlanStepInRange :
26    public ThreadPlanStepRange,
27    public ThreadPlanShouldStopHere
28{
29public:
30    ThreadPlanStepInRange (Thread &thread,
31                           const AddressRange &range,
32                           const SymbolContext &addr_context,
33                           lldb::RunMode stop_others);
34
35    ThreadPlanStepInRange (Thread &thread,
36                           const AddressRange &range,
37                           const SymbolContext &addr_context,
38                           const char *step_into_function_name,
39                           lldb::RunMode stop_others);
40
41    virtual
42    ~ThreadPlanStepInRange ();
43
44    virtual void
45    GetDescription (Stream *s, lldb::DescriptionLevel level);
46
47    virtual bool
48    ShouldStop (Event *event_ptr);
49
50    void SetAvoidRegexp(const char *name);
51
52    void SetStepInTarget (const char *target)
53    {
54        m_step_into_target.SetCString(target);
55    }
56
57    static ThreadPlan *
58    DefaultShouldStopHereCallback (ThreadPlan *current_plan, Flags &flags, void *baton);
59
60    static void
61    SetDefaultFlagValue (uint32_t new_value);
62
63    virtual bool
64    PlanExplainsStop (Event *event_ptr);
65
66    virtual bool WillResume (lldb::StateType resume_state, bool current_plan);
67
68protected:
69
70    virtual void
71    SetFlagsToDefault ();
72
73    bool
74    FrameMatchesAvoidRegexp ();
75
76private:
77
78    friend ThreadPlan *
79    Thread::QueueThreadPlanForStepOverRange (bool abort_other_plans,
80                                         const AddressRange &range,
81                                         const SymbolContext &addr_context,
82                                         lldb::RunMode stop_others);
83    friend ThreadPlan *
84    Thread::QueueThreadPlanForStepInRange (bool abort_other_plans,
85                                         const AddressRange &range,
86                                         const SymbolContext &addr_context,
87                                         const char *step_in_target,
88                                         lldb::RunMode stop_others,
89                                         bool avoid_code_without_debug_info);
90
91
92    // Need an appropriate marker for the current stack so we can tell step out
93    // from step in.
94
95    static uint32_t s_default_flag_values;
96    std::auto_ptr<RegularExpression> m_avoid_regexp_ap;
97    bool m_step_past_prologue;  // FIXME: For now hard-coded to true, we could put a switch in for this if there's
98                                // demand for that.
99    bool m_virtual_step;        // true if we've just done a "virtual step", i.e. just moved the inline stack depth.
100    ConstString m_step_into_target;
101    DISALLOW_COPY_AND_ASSIGN (ThreadPlanStepInRange);
102
103};
104
105} // namespace lldb_private
106
107#endif  // liblldb_ThreadPlanStepInRange_h_
108