ThreadPlanRunToAddress.h revision c0fa53324d62a48257c092a3347d6e7236aa3152
1//===-- ThreadPlanRunToAddress.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_ThreadPlanRunToAddress_h_ 11#define liblldb_ThreadPlanRunToAddress_h_ 12 13// C Includes 14// C++ Includes 15#include <vector> 16 17// Other libraries and framework includes 18// Project includes 19#include "lldb/lldb-private.h" 20#include "lldb/Target/ThreadPlan.h" 21 22namespace lldb_private { 23 24class ThreadPlanRunToAddress : public ThreadPlan 25{ 26public: 27 ThreadPlanRunToAddress (Thread &thread, 28 Address &address, 29 bool stop_others); 30 31 ThreadPlanRunToAddress (Thread &thread, 32 lldb::addr_t address, 33 bool stop_others); 34 35 ThreadPlanRunToAddress (Thread &thread, 36 const std::vector<lldb::addr_t> &addresses, 37 bool stop_others); 38 39 40 virtual 41 ~ThreadPlanRunToAddress (); 42 43 virtual void 44 GetDescription (Stream *s, lldb::DescriptionLevel level); 45 46 virtual bool 47 ValidatePlan (Stream *error); 48 49 virtual bool 50 PlanExplainsStop (); 51 52 virtual bool 53 ShouldStop (Event *event_ptr); 54 55 virtual bool 56 StopOthers (); 57 58 virtual void 59 SetStopOthers (bool new_value); 60 61 virtual lldb::StateType 62 GetPlanRunState (); 63 64 virtual bool 65 WillStop (); 66 67 virtual bool 68 MischiefManaged (); 69 70protected: 71 void SetInitialBreakpoints(); 72 bool AtOurAddress(); 73private: 74 bool m_stop_others; 75 std::vector<lldb::addr_t> m_addresses; // This is the address we are going to run to. 76 // TODO: Would it be useful to have multiple addresses? 77 std::vector<lldb::user_id_t> m_break_ids; // This is the breakpoint we are using to stop us at m_address. 78 79 DISALLOW_COPY_AND_ASSIGN (ThreadPlanRunToAddress); 80 81}; 82 83} // namespace lldb_private 84 85#endif // liblldb_ThreadPlanRunToAddress_h_ 86