]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/tools/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleThreadPlanStepThroughObjCTrampoline.h
Merge llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp
[FreeBSD/FreeBSD.git] / contrib / llvm / tools / lldb / source / Plugins / LanguageRuntime / ObjC / AppleObjCRuntime / AppleThreadPlanStepThroughObjCTrampoline.h
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 #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"
18
19 namespace lldb_private {
20
21 class AppleThreadPlanStepThroughObjCTrampoline : public ThreadPlan {
22 public:
23   AppleThreadPlanStepThroughObjCTrampoline(
24       Thread &thread, AppleObjCTrampolineHandler *trampoline_handler,
25       ValueList &values, lldb::addr_t isa_addr, lldb::addr_t sel_addr,
26       bool stop_others);
27
28   ~AppleThreadPlanStepThroughObjCTrampoline() override;
29
30   static bool PreResumeInitializeFunctionCaller(void *myself);
31
32   void GetDescription(Stream *s, lldb::DescriptionLevel level) override;
33
34   bool ValidatePlan(Stream *error) override;
35
36   lldb::StateType GetPlanRunState() override;
37
38   bool ShouldStop(Event *event_ptr) override;
39
40   bool StopOthers() override { return m_stop_others; }
41
42   // The base class MischiefManaged does some cleanup - so you have to call it
43   // in your MischiefManaged derived class.
44   bool MischiefManaged() override;
45
46   void DidPush() override;
47
48   bool WillStop() override;
49
50 protected:
51   bool DoPlanExplainsStop(Event *event_ptr) override;
52
53 private:
54   bool InitializeFunctionCaller();
55
56   AppleObjCTrampolineHandler *m_trampoline_handler; // FIXME - ensure this
57                                                     // doesn't go away on us?
58                                                     // SP maybe?
59   lldb::addr_t m_args_addr; // Stores the address for our step through function
60                             // result structure.
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.
72   bool m_stop_others;
73 };
74
75 } // namespace lldb_private
76
77 #endif // lldb_AppleThreadPlanStepThroughObjCTrampoline_h_