ThreadPlanStepInRange.h revision 0c8fa2d7dd18ae1816c82846234c45f79142e3df
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    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    virtual bool WillResume (lldb::StateType resume_state, bool current_plan);
56
57protected:
58
59    virtual void
60    SetFlagsToDefault ();
61
62    bool
63    FrameMatchesAvoidRegexp ();
64
65private:
66
67    friend ThreadPlan *
68    Thread::QueueThreadPlanForStepRange (bool abort_other_plans,
69                                         StepType type,
70                                         const AddressRange &range,
71                                         const SymbolContext &addr_context,
72                                         lldb::RunMode stop_others,
73                                         bool avoid_code_without_debug_info);
74
75
76    // Need an appropriate marker for the current stack so we can tell step out
77    // from step in.
78
79    static uint32_t s_default_flag_values;
80    std::auto_ptr<RegularExpression> m_avoid_regexp_ap;
81    bool m_step_past_prologue;  // FIXME: For now hard-coded to true, we could put a switch in for this if there's
82                                // demand for that.
83
84    DISALLOW_COPY_AND_ASSIGN (ThreadPlanStepInRange);
85
86};
87
88} // namespace lldb_private
89
90#endif  // liblldb_ThreadPlanStepInRange_h_
91