File indexing completed on 2026-05-10 08:42:56
0001
0002
0003
0004
0005
0006
0007
0008
0009 #ifndef LLDB_TARGET_THREADPLANCALLFUNCTION_H
0010 #define LLDB_TARGET_THREADPLANCALLFUNCTION_H
0011
0012 #include "lldb/Target/Thread.h"
0013 #include "lldb/Target/ThreadPlan.h"
0014 #include "lldb/lldb-private.h"
0015
0016 #include "llvm/ADT/ArrayRef.h"
0017
0018 namespace lldb_private {
0019
0020 class ThreadPlanCallFunction : public ThreadPlan {
0021
0022
0023
0024 public:
0025 ThreadPlanCallFunction(Thread &thread, const Address &function,
0026 const CompilerType &return_type,
0027 llvm::ArrayRef<lldb::addr_t> args,
0028 const EvaluateExpressionOptions &options);
0029
0030 ThreadPlanCallFunction(Thread &thread, const Address &function,
0031 const EvaluateExpressionOptions &options);
0032
0033 ~ThreadPlanCallFunction() override;
0034
0035 void GetDescription(Stream *s, lldb::DescriptionLevel level) override;
0036
0037 bool ValidatePlan(Stream *error) override;
0038
0039 bool ShouldStop(Event *event_ptr) override;
0040
0041 Vote ShouldReportStop(Event *event_ptr) override;
0042
0043 bool StopOthers() override;
0044
0045 lldb::StateType GetPlanRunState() override;
0046
0047 void DidPush() override;
0048
0049 bool WillStop() override;
0050
0051 bool MischiefManaged() override;
0052
0053
0054
0055
0056
0057
0058
0059
0060
0061
0062 lldb::ValueObjectSP GetReturnValueObject() override {
0063 return m_return_valobj_sp;
0064 }
0065
0066
0067
0068
0069 lldb::addr_t GetFunctionStackPointer() { return m_function_sp; }
0070
0071
0072
0073
0074 void DidPop() override;
0075
0076
0077
0078
0079
0080
0081
0082
0083
0084 virtual lldb::StopInfoSP GetRealStopInfo() {
0085 if (m_real_stop_info_sp)
0086 return m_real_stop_info_sp;
0087 else
0088 return GetPrivateStopInfo();
0089 }
0090
0091 lldb::addr_t GetStopAddress() { return m_stop_address; }
0092
0093 void RestoreThreadState() override;
0094
0095 void ThreadDestroyed() override { m_takedown_done = true; }
0096
0097 void SetStopOthers(bool new_value) override;
0098
0099 protected:
0100 void ReportRegisterState(const char *message);
0101
0102 bool DoPlanExplainsStop(Event *event_ptr) override;
0103
0104 virtual void SetReturnValue();
0105
0106 bool ConstructorSetup(Thread &thread, ABI *&abi,
0107 lldb::addr_t &start_load_addr,
0108 lldb::addr_t &function_load_addr);
0109
0110 virtual void DoTakedown(bool success);
0111
0112 void SetBreakpoints();
0113
0114 void ClearBreakpoints();
0115
0116 bool BreakpointsExplainStop();
0117
0118 bool m_valid;
0119 bool m_stop_other_threads;
0120 bool m_unwind_on_error;
0121 bool m_ignore_breakpoints;
0122 bool m_debug_execution;
0123 bool m_trap_exceptions;
0124 Address m_function_addr;
0125 Address m_start_addr;
0126 lldb::addr_t m_function_sp;
0127 lldb::ThreadPlanSP m_subplan_sp;
0128 LanguageRuntime *m_cxx_language_runtime;
0129 LanguageRuntime *m_objc_language_runtime;
0130 Thread::ThreadStateCheckpoint m_stored_thread_state;
0131 lldb::StopInfoSP
0132 m_real_stop_info_sp;
0133
0134
0135
0136 StreamString m_constructor_errors;
0137 lldb::ValueObjectSP m_return_valobj_sp;
0138
0139
0140 bool m_takedown_done;
0141
0142 bool m_should_clear_objc_exception_bp;
0143 bool m_should_clear_cxx_exception_bp;
0144 lldb::addr_t m_stop_address;
0145
0146
0147 private:
0148 CompilerType m_return_type;
0149 ThreadPlanCallFunction(const ThreadPlanCallFunction &) = delete;
0150 const ThreadPlanCallFunction &
0151 operator=(const ThreadPlanCallFunction &) = delete;
0152 };
0153
0154 }
0155
0156 #endif