ThreadPlanStepUntil.h revision 745ac7a5826fe7c392007941a4046bfb1a8dff81
1//===-- ThreadPlanStepUntil.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_ThreadPlanStepUntil_h_
11#define liblldb_ThreadPlanStepUntil_h_
12
13// C Includes
14// C++ Includes
15// Other libraries and framework includes
16// Project includes
17#include "lldb/Target/Thread.h"
18#include "lldb/Target/ThreadPlan.h"
19
20namespace lldb_private {
21
22
23class ThreadPlanStepUntil : public ThreadPlan
24{
25public:
26    virtual ~ThreadPlanStepUntil ();
27
28    virtual void GetDescription (Stream *s, lldb::DescriptionLevel level);
29    virtual bool ValidatePlan (Stream *error);
30    virtual bool PlanExplainsStop ();
31    virtual bool ShouldStop (Event *event_ptr);
32    virtual bool StopOthers ();
33    virtual lldb::StateType GetPlanRunState ();
34    virtual bool WillResume (lldb::StateType resume_state, bool current_plan);
35    virtual bool WillStop ();
36    virtual bool MischiefManaged ();
37
38    virtual bool
39    IsMasterPlan()
40    {
41        return true;
42    }
43
44protected:
45    ThreadPlanStepUntil (Thread &thread,
46                         lldb::addr_t *address_list,
47                         size_t num_addresses,
48                         bool stop_others);
49    void AnalyzeStop(void);
50
51private:
52
53    uint64_t m_stack_depth;
54    lldb::addr_t m_step_from_insn;
55    lldb::break_id_t m_return_bp_id;
56    lldb::addr_t m_return_addr;
57    bool m_stepped_out;
58    bool m_should_stop;
59    bool m_ran_analyze;
60    bool m_explains_stop;
61
62    typedef std::map<lldb::addr_t,lldb::break_id_t> until_collection;
63    until_collection m_until_points;
64    bool m_stop_others;
65
66    void Clear();
67
68    friend ThreadPlan *
69    Thread::QueueThreadPlanForStepUntil (bool abort_other_plans,
70                                       lldb::addr_t *address_list,
71                                       size_t num_addresses,
72                                       bool stop_others);
73
74    // Need an appropriate marker for the current stack so we can tell step out
75    // from step in.
76
77    DISALLOW_COPY_AND_ASSIGN (ThreadPlanStepUntil);
78
79};
80
81} // namespace lldb_private
82
83#endif  // liblldb_ThreadPlanStepUntil_h_
84