45 abi = process_sp->GetABI().get();
59 if (!
error.Success()) {
61 "Trying to put the stack in unreadable memory at: 0x%" PRIx64
".",
63 LLDB_LOGF(log,
"ThreadPlanCallFunction(%p): %s.",
static_cast<void *
>(
this),
71 "%s", llvm::toString(start_address.takeError()).c_str());
72 LLDB_LOGF(log,
"ThreadPlanCallFunction(%p): %s.",
static_cast<void *
>(
this),
83 "Original register state was:");
87 "checkpoint thread state.");
88 LLDB_LOGF(log,
"ThreadPlanCallFunction(%p): %s.",
static_cast<void *
>(
this),
102 m_valid(false), m_stop_other_threads(options.GetStopOthers()),
103 m_unwind_on_error(options.DoesUnwindOnError()),
104 m_ignore_breakpoints(options.DoesIgnoreBreakpoints()),
105 m_debug_execution(options.GetDebug()),
106 m_trap_exceptions(options.GetTrapExceptions()), m_function_addr(function),
107 m_start_addr(), m_function_sp(0), m_subplan_sp(),
108 m_cxx_language_runtime(nullptr), m_objc_language_runtime(nullptr),
109 m_stored_thread_state(), m_real_stop_info_sp(), m_constructor_errors(),
110 m_return_valobj_sp(), m_takedown_done(false),
111 m_should_clear_objc_exception_bp(false),
112 m_should_clear_cxx_exception_bp(false),
122 start_load_addr, args))
135 m_valid(false), m_stop_other_threads(options.GetStopOthers()),
136 m_unwind_on_error(options.DoesUnwindOnError()),
137 m_ignore_breakpoints(options.DoesIgnoreBreakpoints()),
138 m_debug_execution(options.GetDebug()),
139 m_trap_exceptions(options.GetTrapExceptions()), m_function_addr(function),
140 m_start_addr(), m_function_sp(0), m_subplan_sp(),
141 m_cxx_language_runtime(nullptr), m_objc_language_runtime(nullptr),
142 m_stored_thread_state(), m_real_stop_info_sp(), m_constructor_errors(),
143 m_return_valobj_sp(), m_takedown_done(false),
144 m_should_clear_objc_exception_bp(false),
145 m_should_clear_cxx_exception_bp(false),
163 reg_idx < num_registers; ++reg_idx) {
181 "ThreadPlanCallFunction(%p): Log called on "
182 "ThreadPlanCallFunction that was never valid.",
183 static_cast<void *
>(
this));
193 "ThreadPlanCallFunction(%p): DoTakedown called for thread "
194 "0x%4.4" PRIx64
", m_valid: %d complete: %d.\n",
202 "ThreadPlanCallFunction(%p): DoTakedown failed to restore "
204 static_cast<void *
>(
this));
210 "Restored register state:");
213 "ThreadPlanCallFunction(%p): DoTakedown called as no-op for "
214 "thread 0x%4.4" PRIx64
", m_valid: %d complete: %d.\n",
223 s->
Printf(
"Function call thread plan");
225 s->
Printf(
"Thread plan to call 0x%" PRIx64,
236 error->PutCString(
"Unknown error");
270 "ThreadPlanCallFunction::PlanExplainsStop: Got stop reason - {0}.",
280 LLDB_LOGF(log,
"ThreadPlanCallFunction::PlanExplainsStop: The event is an "
281 "Interrupt, returning true.");
294 uint32_t num_owners = bp_site_sp->GetNumberOfConstituents();
295 bool is_internal =
true;
296 for (uint32_t i = 0; i < num_owners; i++) {
297 Breakpoint &bp = bp_site_sp->GetConstituentAtIndex(i)->GetBreakpoint();
299 "ThreadPlanCallFunction::PlanExplainsStop: hit "
300 "breakpoint %d while calling function",
309 LLDB_LOGF(log,
"ThreadPlanCallFunction::PlanExplainsStop hit an "
310 "internal breakpoint, not stopping.");
317 "ThreadPlanCallFunction::PlanExplainsStop: we are ignoring "
318 "breakpoints, overriding breakpoint stop info ShouldStop, "
323 LLDB_LOGF(log,
"ThreadPlanCallFunction::PlanExplainsStop: we are not "
324 "ignoring breakpoints, overriding breakpoint stop info "
325 "ShouldStop, returning true");
378#ifndef SINGLE_STEP_EXPRESSIONS
394 LLDB_LOGF(log,
"ThreadPlanCallFunction(%p): Completed call function plan.",
395 static_cast<void *
>(
this));
443 LLDB_LOGF(log,
"ThreadPlanCallFunction::BreakpointsExplainStop - Hit an "
444 "exception breakpoint, setting plan complete.");
451 stop_info_sp->OverrideShouldStop(
true);
470 const bool persistent =
false;
static llvm::raw_ostream & error(Stream &strm)
#define LLDB_LOG(log,...)
The LLDB_LOG* macros defined below are the way to emit log messages.
#define LLDB_LOGF(log,...)
virtual bool PrepareTrivialCall(lldb_private::Thread &thread, lldb::addr_t sp, lldb::addr_t functionAddress, lldb::addr_t returnAddress, llvm::ArrayRef< lldb::addr_t > args) const =0
lldb::ValueObjectSP GetReturnValueObject(Thread &thread, CompilerType &type, bool persistent=true) const
virtual size_t GetRedZoneSize() const =0
A section + offset based address class.
lldb::addr_t GetLoadAddress(Target *target) const
Get the load address.
General Outline: A breakpoint has four main parts, a filter, a resolver, the list of breakpoint locat...
bool IsInternal() const
Tell whether this breakpoint is an "internal" breakpoint.
Generic representation of a type in a programming language.
virtual void SetExceptionBreakpoints()
virtual bool ExceptionBreakpointsExplainStop(lldb::StopInfoSP stop_reason)
virtual void ClearExceptionBreakpoints()
virtual bool ExceptionBreakpointsAreSet()
void PutCString(const char *cstr)
void PutString(llvm::StringRef str)
static bool GetInterruptedFromEvent(const Event *event_ptr)
StopPointSiteList< lldb_private::BreakpointSite > & GetBreakpointSiteList()
LanguageRuntime * GetLanguageRuntime(lldb::LanguageType language)
const lldb::ABISP & GetABI()
virtual const RegisterInfo * GetRegisterInfoAtIndex(size_t reg)=0
virtual size_t GetRegisterCount()=0
virtual bool ReadRegister(const RegisterInfo *reg_info, RegisterValue ®_value)=0
StopPointSiteSP FindByID(typename StopPointSite::SiteID site_id)
Returns a shared pointer to the site with id site_id.
lldb::break_id_t GetID() const
const char * GetData() const
llvm::StringRef GetString() const
A stream class that can stream formatted output to a file.
size_t Printf(const char *format,...) __attribute__((format(printf
Output printf formatted output to the stream.
size_t EOL()
Output and End of Line character to the stream.
llvm::Expected< lldb_private::Address > GetEntryPointAddress()
This method will return the address of the starting function for this binary, e.g.
StreamString m_constructor_errors
void SetStopOthers(bool new_value) override
bool ValidatePlan(Stream *error) override
Returns whether this plan could be successfully created.
bool ConstructorSetup(Thread &thread, ABI *&abi, lldb::addr_t &start_load_addr, lldb::addr_t &function_load_addr)
bool m_ignore_breakpoints
bool MischiefManaged() override
lldb::addr_t m_stop_address
lldb::StopInfoSP m_real_stop_info_sp
Vote ShouldReportStop(Event *event_ptr) override
bool m_should_clear_objc_exception_bp
bool StopOthers() override
void ReportRegisterState(const char *message)
ThreadPlanCallFunction(Thread &thread, const Address &function, const CompilerType &return_type, llvm::ArrayRef< lldb::addr_t > args, const EvaluateExpressionOptions &options)
LanguageRuntime * m_cxx_language_runtime
bool DoPlanExplainsStop(Event *event_ptr) override
bool BreakpointsExplainStop()
lldb::StateType GetPlanRunState() override
void RestoreThreadState() override
LanguageRuntime * m_objc_language_runtime
CompilerType m_return_type
bool ShouldStop(Event *event_ptr) override
lldb::ThreadPlanSP m_subplan_sp
~ThreadPlanCallFunction() override
bool m_stop_other_threads
void GetDescription(Stream *s, lldb::DescriptionLevel level) override
Print a description of this thread to the stream s.
lldb::ValueObjectSP m_return_valobj_sp
virtual void SetReturnValue()
bool m_should_clear_cxx_exception_bp
Thread::ThreadStateCheckpoint m_stored_thread_state
lldb::addr_t m_function_sp
virtual void DoTakedown(bool success)
virtual Vote ShouldReportStop(Event *event_ptr)
void SetPrivate(bool input)
void SetPlanComplete(bool success=true)
Thread & GetThread()
Returns the Thread that is using this thread plan.
void SetOkayToDiscard(bool value)
virtual bool MischiefManaged()
bool SetIsControllingPlan(bool value)
lldb::StopInfoSP GetPrivateStopInfo()
virtual lldb::StackFrameSP GetStackFrameAtIndex(uint32_t idx)
void RestoreThreadStateFromCheckpoint(ThreadStateCheckpoint &saved_state)
Status QueueThreadPlan(lldb::ThreadPlanSP &plan_sp, bool abort_other_plans)
Queues a generic thread plan.
virtual lldb::RegisterContextSP GetRegisterContext()=0
virtual bool RestoreRegisterStateFromCheckpoint(ThreadStateCheckpoint &saved_state)
void SetStopInfoToNothing()
static std::string StopReasonAsString(lldb::StopReason reason)
virtual bool CheckpointThreadState(ThreadStateCheckpoint &saved_state)
lldb::ProcessSP GetProcess() const
#define LLDB_INVALID_ADDRESS
A class that represents a running process on the host machine.
Log * GetLog(Cat mask)
Retrieve the Log object for the channel associated with the given log enum.
void DumpRegisterValue(const RegisterValue ®_val, Stream &s, const RegisterInfo ®_info, bool prefix_with_name, bool prefix_with_alt_name, lldb::Format format, uint32_t reg_name_right_align_at=0, ExecutionContextScope *exe_scope=nullptr, bool print_flags=false, lldb::TargetSP target_sp=nullptr)
std::shared_ptr< lldb_private::BreakpointSite > BreakpointSiteSP
DescriptionLevel
Description levels for "void GetDescription(Stream *, DescriptionLevel)" calls.
StateType
Process and Thread States.
@ eStateRunning
Process or thread is running and can't be examined.
@ eLanguageTypeObjC
Objective-C.
@ eLanguageTypeC_plus_plus
ISO C++:1998.
std::shared_ptr< lldb_private::Process > ProcessSP
std::shared_ptr< lldb_private::StopInfo > StopInfoSP
StopReason
Thread stop reasons.
Every register is described in detail including its name, alternate name (optional),...