1 //===-- AppleThreadPlanStepThroughObjCTrampoline.h --------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #ifndef lldb_AppleThreadPlanStepThroughObjCTrampoline_h_
11 #define lldb_AppleThreadPlanStepThroughObjCTrampoline_h_
13 #include "AppleObjCTrampolineHandler.h"
14 #include "lldb/Core/Value.h"
15 #include "lldb/Target/ThreadPlan.h"
16 #include "lldb/lldb-enumerations.h"
17 #include "lldb/lldb-types.h"
19 namespace lldb_private {
21 class AppleThreadPlanStepThroughObjCTrampoline : public ThreadPlan {
23 AppleThreadPlanStepThroughObjCTrampoline(
24 Thread &thread, AppleObjCTrampolineHandler *trampoline_handler,
25 ValueList &values, lldb::addr_t isa_addr, lldb::addr_t sel_addr,
28 ~AppleThreadPlanStepThroughObjCTrampoline() override;
30 static bool PreResumeInitializeFunctionCaller(void *myself);
32 void GetDescription(Stream *s, lldb::DescriptionLevel level) override;
34 bool ValidatePlan(Stream *error) override;
36 lldb::StateType GetPlanRunState() override;
38 bool ShouldStop(Event *event_ptr) override;
40 bool StopOthers() override { return m_stop_others; }
42 // The base class MischiefManaged does some cleanup - so you have to call it
43 // in your MischiefManaged derived class.
44 bool MischiefManaged() override;
46 void DidPush() override;
48 bool WillStop() override;
51 bool DoPlanExplainsStop(Event *event_ptr) override;
54 bool InitializeFunctionCaller();
56 AppleObjCTrampolineHandler *m_trampoline_handler; // FIXME - ensure this
57 // doesn't go away on us?
59 lldb::addr_t m_args_addr; // Stores the address for our step through function
61 // lldb::addr_t m_object_addr; // This is only for Description.
62 ValueList m_input_values;
63 lldb::addr_t m_isa_addr; // isa_addr and sel_addr are the keys we will use to
64 // cache the implementation.
65 lldb::addr_t m_sel_addr;
66 lldb::ThreadPlanSP m_func_sp; // This is the function call plan. We fill it
67 // at start, then set it
68 // to NULL when this plan is done. That way we know to go to:
69 lldb::ThreadPlanSP m_run_to_sp; // The plan that runs to the target.
70 FunctionCaller *m_impl_function; // This is a pointer to a impl function that
71 // is owned by the client that pushes this plan.
75 } // namespace lldb_private
77 #endif // lldb_AppleThreadPlanStepThroughObjCTrampoline_h_