1 //===-- AppleThreadPlanStepThroughObjCTrampoline.h --------------*- C++ -*-===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 #ifndef lldb_AppleThreadPlanStepThroughObjCTrampoline_h_
10 #define lldb_AppleThreadPlanStepThroughObjCTrampoline_h_
12 #include "AppleObjCTrampolineHandler.h"
13 #include "lldb/Core/Value.h"
14 #include "lldb/Target/ThreadPlan.h"
15 #include "lldb/lldb-enumerations.h"
16 #include "lldb/lldb-types.h"
18 namespace lldb_private {
20 class AppleThreadPlanStepThroughObjCTrampoline : public ThreadPlan {
22 AppleThreadPlanStepThroughObjCTrampoline(
23 Thread &thread, AppleObjCTrampolineHandler *trampoline_handler,
24 ValueList &values, lldb::addr_t isa_addr, lldb::addr_t sel_addr,
27 ~AppleThreadPlanStepThroughObjCTrampoline() override;
29 static bool PreResumeInitializeFunctionCaller(void *myself);
31 void GetDescription(Stream *s, lldb::DescriptionLevel level) override;
33 bool ValidatePlan(Stream *error) override;
35 lldb::StateType GetPlanRunState() override;
37 bool ShouldStop(Event *event_ptr) override;
39 bool StopOthers() override { return m_stop_others; }
41 // The base class MischiefManaged does some cleanup - so you have to call it
42 // in your MischiefManaged derived class.
43 bool MischiefManaged() override;
45 void DidPush() override;
47 bool WillStop() override;
50 bool DoPlanExplainsStop(Event *event_ptr) override;
53 bool InitializeFunctionCaller();
55 AppleObjCTrampolineHandler *m_trampoline_handler; // FIXME - ensure this
56 // doesn't go away on us?
58 lldb::addr_t m_args_addr; // Stores the address for our step through function
60 // lldb::addr_t m_object_addr; // This is only for Description.
61 ValueList m_input_values;
62 lldb::addr_t m_isa_addr; // isa_addr and sel_addr are the keys we will use to
63 // cache the implementation.
64 lldb::addr_t m_sel_addr;
65 lldb::ThreadPlanSP m_func_sp; // This is the function call plan. We fill it
66 // at start, then set it
67 // to NULL when this plan is done. That way we know to go to:
68 lldb::ThreadPlanSP m_run_to_sp; // The plan that runs to the target.
69 FunctionCaller *m_impl_function; // This is a pointer to a impl function that
70 // is owned by the client that pushes this plan.
74 } // namespace lldb_private
76 #endif // lldb_AppleThreadPlanStepThroughObjCTrampoline_h_