AppleThreadPlanStepThroughObjCTrampoline.h revision 745ac7a5826fe7c392007941a4046bfb1a8dff81
1//===-- AppleThreadPlanStepThroughObjCTrampoline.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 lldb_AppleThreadPlanStepThroughObjCTrampoline_h_ 11#define lldb_AppleThreadPlanStepThroughObjCTrampoline_h_ 12 13// C Includes 14// C++ Includes 15// Other libraries and framework includes 16// Project includes 17#include "lldb/lldb-types.h" 18#include "lldb/lldb-enumerations.h" 19#include "lldb/Target/ThreadPlan.h" 20#include "AppleObjCTrampolineHandler.h" 21 22namespace lldb_private 23{ 24 25class AppleThreadPlanStepThroughObjCTrampoline : public ThreadPlan 26{ 27public: 28 //------------------------------------------------------------------ 29 // Constructors and Destructors 30 //------------------------------------------------------------------ 31 AppleThreadPlanStepThroughObjCTrampoline(Thread &thread, 32 AppleObjCTrampolineHandler *trampoline_handler, 33 lldb::addr_t args_addr, 34 lldb::addr_t object_ptr, 35 lldb::addr_t class_ptr, 36 lldb::addr_t sel_ptr, 37 bool stop_others); 38 39 virtual ~AppleThreadPlanStepThroughObjCTrampoline(); 40 41 virtual void 42 GetDescription (Stream *s, 43 lldb::DescriptionLevel level); 44 45 virtual bool 46 ValidatePlan (Stream *error); 47 48 virtual bool 49 PlanExplainsStop (); 50 51 52 virtual lldb::StateType 53 GetPlanRunState (); 54 55 virtual bool 56 ShouldStop (Event *event_ptr); 57 58 // The base class MischiefManaged does some cleanup - so you have to call it 59 // in your MischiefManaged derived class. 60 virtual bool 61 MischiefManaged (); 62 63 virtual void 64 DidPush(); 65 66 virtual bool 67 WillStop(); 68 69 70 71protected: 72 //------------------------------------------------------------------ 73 // Classes that inherit from AppleThreadPlanStepThroughObjCTrampoline can see and modify these 74 //------------------------------------------------------------------ 75 76private: 77 //------------------------------------------------------------------ 78 // For AppleThreadPlanStepThroughObjCTrampoline only 79 //------------------------------------------------------------------ 80 bool m_stop_others; 81 lldb::addr_t m_object_ptr; 82 lldb::addr_t m_class_ptr; 83 lldb::addr_t m_sel_ptr; 84 85 ThreadPlanSP m_func_sp; // This is the function call plan. We fill it at start, then set it 86 // to NULL when this plan is done. That way we know to go to: 87 lldb::addr_t m_args_addr; // Stores the address for our step through function result structure. 88 ThreadPlanSP m_run_to_sp; // The plan that runs to the target. 89 AppleObjCTrampolineHandler *m_objc_trampoline_handler; 90 ClangFunction *m_impl_function; // This is a pointer to a impl function that 91 // is owned by the client that pushes this plan. 92}; 93 94} // namespace lldb_private 95 96#endif // lldb_AppleThreadPlanStepThroughObjCTrampoline_h_ 97