Jim Ingham | b66cd07 | 2010-09-28 01:25:32 +0000 | [diff] [blame] | 1 | //===-- AppleThreadPlanStepThroughObjCTrampoline.h --------------------------*- C++ -*-===// |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 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 | |
Jim Ingham | b66cd07 | 2010-09-28 01:25:32 +0000 | [diff] [blame] | 10 | #ifndef lldb_AppleThreadPlanStepThroughObjCTrampoline_h_ |
| 11 | #define lldb_AppleThreadPlanStepThroughObjCTrampoline_h_ |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 12 | |
| 13 | // C Includes |
| 14 | // C++ Includes |
| 15 | // Other libraries and framework includes |
| 16 | // Project includes |
Greg Clayton | 54e7afa | 2010-07-09 20:39:50 +0000 | [diff] [blame] | 17 | #include "lldb/lldb-types.h" |
| 18 | #include "lldb/lldb-enumerations.h" |
Jim Ingham | 1831e78 | 2012-04-07 00:00:41 +0000 | [diff] [blame] | 19 | #include "lldb/Core/Value.h" |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 20 | #include "lldb/Target/ThreadPlan.h" |
Jim Ingham | b66cd07 | 2010-09-28 01:25:32 +0000 | [diff] [blame] | 21 | #include "AppleObjCTrampolineHandler.h" |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 22 | |
| 23 | namespace lldb_private |
| 24 | { |
| 25 | |
Jim Ingham | b66cd07 | 2010-09-28 01:25:32 +0000 | [diff] [blame] | 26 | class AppleThreadPlanStepThroughObjCTrampoline : public ThreadPlan |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 27 | { |
| 28 | public: |
| 29 | //------------------------------------------------------------------ |
| 30 | // Constructors and Destructors |
| 31 | //------------------------------------------------------------------ |
Jim Ingham | b66cd07 | 2010-09-28 01:25:32 +0000 | [diff] [blame] | 32 | AppleThreadPlanStepThroughObjCTrampoline(Thread &thread, |
Jim Ingham | 6507dd9 | 2010-12-10 00:26:25 +0000 | [diff] [blame] | 33 | AppleObjCTrampolineHandler *trampoline_handler, |
Jim Ingham | 1831e78 | 2012-04-07 00:00:41 +0000 | [diff] [blame] | 34 | ValueList &values, |
Jim Ingham | 6507dd9 | 2010-12-10 00:26:25 +0000 | [diff] [blame] | 35 | lldb::addr_t isa_addr, |
| 36 | lldb::addr_t sel_addr, |
| 37 | bool stop_others); |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 38 | |
Jim Ingham | b66cd07 | 2010-09-28 01:25:32 +0000 | [diff] [blame] | 39 | virtual ~AppleThreadPlanStepThroughObjCTrampoline(); |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 40 | |
| 41 | virtual void |
| 42 | GetDescription (Stream *s, |
| 43 | lldb::DescriptionLevel level); |
| 44 | |
| 45 | virtual bool |
| 46 | ValidatePlan (Stream *error); |
| 47 | |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 48 | virtual lldb::StateType |
Jim Ingham | 745ac7a | 2010-11-11 19:26:09 +0000 | [diff] [blame] | 49 | GetPlanRunState (); |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 50 | |
| 51 | virtual bool |
| 52 | ShouldStop (Event *event_ptr); |
Jim Ingham | b6b7f3e | 2013-03-22 01:28:17 +0000 | [diff] [blame] | 53 | |
| 54 | virtual bool |
| 55 | StopOthers() |
| 56 | { |
| 57 | return m_stop_others; |
| 58 | } |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 59 | |
| 60 | // The base class MischiefManaged does some cleanup - so you have to call it |
| 61 | // in your MischiefManaged derived class. |
| 62 | virtual bool |
| 63 | MischiefManaged (); |
| 64 | |
| 65 | virtual void |
| 66 | DidPush(); |
| 67 | |
Jim Ingham | 1831e78 | 2012-04-07 00:00:41 +0000 | [diff] [blame] | 68 | static bool |
| 69 | PreResumeInitializeClangFunction(void *myself); |
| 70 | |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 71 | virtual bool |
| 72 | WillStop(); |
| 73 | |
| 74 | |
| 75 | |
| 76 | protected: |
| 77 | //------------------------------------------------------------------ |
Jim Ingham | b66cd07 | 2010-09-28 01:25:32 +0000 | [diff] [blame] | 78 | // Classes that inherit from AppleThreadPlanStepThroughObjCTrampoline can see and modify these |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 79 | //------------------------------------------------------------------ |
Jim Ingham | 7c79a27 | 2013-05-08 00:35:16 +0000 | [diff] [blame^] | 80 | virtual bool |
| 81 | DoPlanExplainsStop (Event *event_ptr); |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 82 | |
| 83 | private: |
Jim Ingham | 1831e78 | 2012-04-07 00:00:41 +0000 | [diff] [blame] | 84 | bool |
| 85 | InitializeClangFunction (); |
| 86 | |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 87 | //------------------------------------------------------------------ |
Jim Ingham | b66cd07 | 2010-09-28 01:25:32 +0000 | [diff] [blame] | 88 | // For AppleThreadPlanStepThroughObjCTrampoline only |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 89 | //------------------------------------------------------------------ |
Jim Ingham | 6507dd9 | 2010-12-10 00:26:25 +0000 | [diff] [blame] | 90 | AppleObjCTrampolineHandler *m_trampoline_handler; // FIXME - ensure this doesn't go away on us? SP maybe? |
| 91 | lldb::addr_t m_args_addr; // Stores the address for our step through function result structure. |
Jim Ingham | 1831e78 | 2012-04-07 00:00:41 +0000 | [diff] [blame] | 92 | //lldb::addr_t m_object_addr; // This is only for Description. |
| 93 | ValueList m_input_values; |
Jim Ingham | 6507dd9 | 2010-12-10 00:26:25 +0000 | [diff] [blame] | 94 | lldb::addr_t m_isa_addr; // isa_addr and sel_addr are the keys we will use to cache the implementation. |
| 95 | lldb::addr_t m_sel_addr; |
Greg Clayton | 6e0101c | 2011-09-17 06:21:20 +0000 | [diff] [blame] | 96 | lldb::ThreadPlanSP m_func_sp; // This is the function call plan. We fill it at start, then set it |
| 97 | // to NULL when this plan is done. That way we know to go to: |
| 98 | lldb::ThreadPlanSP m_run_to_sp; // The plan that runs to the target. |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 99 | ClangFunction *m_impl_function; // This is a pointer to a impl function that |
| 100 | // is owned by the client that pushes this plan. |
Jim Ingham | 6507dd9 | 2010-12-10 00:26:25 +0000 | [diff] [blame] | 101 | bool m_stop_others; |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 102 | }; |
| 103 | |
Greg Clayton | 54e7afa | 2010-07-09 20:39:50 +0000 | [diff] [blame] | 104 | } // namespace lldb_private |
| 105 | |
Jim Ingham | b66cd07 | 2010-09-28 01:25:32 +0000 | [diff] [blame] | 106 | #endif // lldb_AppleThreadPlanStepThroughObjCTrampoline_h_ |