LLDB  mainline
ThreadPlanCallFunction.cpp
Go to the documentation of this file.
1 //===-- ThreadPlanCallFunction.cpp ----------------------------------------===//
2 //
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
6 //
7 //===----------------------------------------------------------------------===//
8 
12 #include "lldb/Core/Address.h"
14 #include "lldb/Core/Module.h"
15 #include "lldb/Symbol/ObjectFile.h"
16 #include "lldb/Target/ABI.h"
18 #include "lldb/Target/Process.h"
20 #include "lldb/Target/StopInfo.h"
21 #include "lldb/Target/Target.h"
22 #include "lldb/Target/Thread.h"
24 #include "lldb/Utility/LLDBLog.h"
25 #include "lldb/Utility/Log.h"
26 #include "lldb/Utility/Stream.h"
27 
28 #include <memory>
29 
30 using namespace lldb;
31 using namespace lldb_private;
32 
33 // ThreadPlanCallFunction: Plan to call a single function
34 bool ThreadPlanCallFunction::ConstructorSetup(
35  Thread &thread, ABI *&abi, lldb::addr_t &start_load_addr,
36  lldb::addr_t &function_load_addr) {
37  SetIsControllingPlan(true);
38  SetOkayToDiscard(false);
39  SetPrivate(true);
40 
41  ProcessSP process_sp(thread.GetProcess());
42  if (!process_sp)
43  return false;
44 
45  abi = process_sp->GetABI().get();
46 
47  if (!abi)
48  return false;
49 
50  Log *log = GetLog(LLDBLog::Step);
51 
52  SetBreakpoints();
53 
54  m_function_sp = thread.GetRegisterContext()->GetSP() - abi->GetRedZoneSize();
55  // If we can't read memory at the point of the process where we are planning
56  // to put our function, we're not going to get any further...
57  Status error;
58  process_sp->ReadUnsignedIntegerFromMemory(m_function_sp, 4, 0, error);
59  if (!error.Success()) {
60  m_constructor_errors.Printf(
61  "Trying to put the stack in unreadable memory at: 0x%" PRIx64 ".",
62  m_function_sp);
63  LLDB_LOGF(log, "ThreadPlanCallFunction(%p): %s.", static_cast<void *>(this),
64  m_constructor_errors.GetData());
65  return false;
66  }
67 
68  llvm::Expected<Address> start_address = GetTarget().GetEntryPointAddress();
69  if (!start_address) {
70  m_constructor_errors.Printf(
71  "%s", llvm::toString(start_address.takeError()).c_str());
72  LLDB_LOGF(log, "ThreadPlanCallFunction(%p): %s.", static_cast<void *>(this),
73  m_constructor_errors.GetData());
74  return false;
75  }
76 
77  m_start_addr = *start_address;
78  start_load_addr = m_start_addr.GetLoadAddress(&GetTarget());
79 
80  // Checkpoint the thread state so we can restore it later.
81  if (log && log->GetVerbose())
82  ReportRegisterState("About to checkpoint thread before function call. "
83  "Original register state was:");
84 
85  if (!thread.CheckpointThreadState(m_stored_thread_state)) {
86  m_constructor_errors.Printf("Setting up ThreadPlanCallFunction, failed to "
87  "checkpoint thread state.");
88  LLDB_LOGF(log, "ThreadPlanCallFunction(%p): %s.", static_cast<void *>(this),
89  m_constructor_errors.GetData());
90  return false;
91  }
92  function_load_addr = m_function_addr.GetLoadAddress(&GetTarget());
93 
94  return true;
95 }
96 
97 ThreadPlanCallFunction::ThreadPlanCallFunction(
98  Thread &thread, const Address &function, const CompilerType &return_type,
99  llvm::ArrayRef<addr_t> args, const EvaluateExpressionOptions &options)
100  : ThreadPlan(ThreadPlan::eKindCallFunction, "Call function plan", thread,
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_function_sp(0), m_takedown_done(false),
108  m_should_clear_objc_exception_bp(false),
109  m_should_clear_cxx_exception_bp(false),
110  m_stop_address(LLDB_INVALID_ADDRESS), m_return_type(return_type) {
111  lldb::addr_t start_load_addr = LLDB_INVALID_ADDRESS;
112  lldb::addr_t function_load_addr = LLDB_INVALID_ADDRESS;
113  ABI *abi = nullptr;
114 
115  if (!ConstructorSetup(thread, abi, start_load_addr, function_load_addr))
116  return;
117 
118  if (!abi->PrepareTrivialCall(thread, m_function_sp, function_load_addr,
119  start_load_addr, args))
120  return;
121 
122  ReportRegisterState("Function call was set up. Register state was:");
123 
124  m_valid = true;
125 }
126 
128  Thread &thread, const Address &function,
129  const EvaluateExpressionOptions &options)
130  : ThreadPlan(ThreadPlan::eKindCallFunction, "Call function plan", thread,
132  m_valid(false), m_stop_other_threads(options.GetStopOthers()),
133  m_unwind_on_error(options.DoesUnwindOnError()),
134  m_ignore_breakpoints(options.DoesIgnoreBreakpoints()),
135  m_debug_execution(options.GetDebug()),
136  m_trap_exceptions(options.GetTrapExceptions()), m_function_addr(function),
137  m_function_sp(0), m_takedown_done(false),
138  m_should_clear_objc_exception_bp(false),
139  m_should_clear_cxx_exception_bp(false),
140  m_stop_address(LLDB_INVALID_ADDRESS), m_return_type(CompilerType()) {}
141 
144 }
145 
147  Log *log = GetLog(LLDBLog::Step);
148  if (log && log->GetVerbose()) {
149  StreamString strm;
150  RegisterContext *reg_ctx = GetThread().GetRegisterContext().get();
151 
152  log->PutCString(message);
153 
154  RegisterValue reg_value;
155 
156  for (uint32_t reg_idx = 0, num_registers = reg_ctx->GetRegisterCount();
157  reg_idx < num_registers; ++reg_idx) {
158  const RegisterInfo *reg_info = reg_ctx->GetRegisterInfoAtIndex(reg_idx);
159  if (reg_ctx->ReadRegister(reg_info, reg_value)) {
160  DumpRegisterValue(reg_value, &strm, reg_info, true, false,
162  strm.EOL();
163  }
164  }
165  log->PutString(strm.GetString());
166  }
167 }
168 
170  Log *log = GetLog(LLDBLog::Step);
171 
172  if (!m_valid) {
173  // Don't call DoTakedown if we were never valid to begin with.
174  LLDB_LOGF(log,
175  "ThreadPlanCallFunction(%p): Log called on "
176  "ThreadPlanCallFunction that was never valid.",
177  static_cast<void *>(this));
178  return;
179  }
180 
181  if (!m_takedown_done) {
182  Thread &thread = GetThread();
183  if (success) {
184  SetReturnValue();
185  }
186  LLDB_LOGF(log,
187  "ThreadPlanCallFunction(%p): DoTakedown called for thread "
188  "0x%4.4" PRIx64 ", m_valid: %d complete: %d.\n",
189  static_cast<void *>(this), m_tid, m_valid, IsPlanComplete());
190  m_takedown_done = true;
192  thread.GetStackFrameAtIndex(0)->GetRegisterContext()->GetPC();
195  LLDB_LOGF(log,
196  "ThreadPlanCallFunction(%p): DoTakedown failed to restore "
197  "register state",
198  static_cast<void *>(this));
199  }
200  SetPlanComplete(success);
202  if (log && log->GetVerbose())
203  ReportRegisterState("Restoring thread state after function call. "
204  "Restored register state:");
205  } else {
206  LLDB_LOGF(log,
207  "ThreadPlanCallFunction(%p): DoTakedown called as no-op for "
208  "thread 0x%4.4" PRIx64 ", m_valid: %d complete: %d.\n",
209  static_cast<void *>(this), m_tid, m_valid, IsPlanComplete());
210  }
211 }
212 
214 
216  if (level == eDescriptionLevelBrief) {
217  s->Printf("Function call thread plan");
218  } else {
219  s->Printf("Thread plan to call 0x%" PRIx64,
221  }
222 }
223 
225  if (!m_valid) {
226  if (error) {
227  if (m_constructor_errors.GetSize() > 0)
228  error->PutCString(m_constructor_errors.GetString());
229  else
230  error->PutCString("Unknown error");
231  }
232  return false;
233  }
234 
235  return true;
236 }
237 
240  return eVoteYes;
241  else
242  return ThreadPlan::ShouldReportStop(event_ptr);
243 }
244 
248 
249  // If our subplan knows why we stopped, even if it's done (which would
250  // forward the question to us) we answer yes.
251  if (m_subplan_sp && m_subplan_sp->PlanExplainsStop(event_ptr)) {
252  SetPlanComplete();
253  return true;
254  }
255 
256  // Check if the breakpoint is one of ours.
257 
258  StopReason stop_reason;
259  if (!m_real_stop_info_sp)
260  stop_reason = eStopReasonNone;
261  else
262  stop_reason = m_real_stop_info_sp->GetStopReason();
263  LLDB_LOG(log,
264  "ThreadPlanCallFunction::PlanExplainsStop: Got stop reason - {0}.",
265  Thread::StopReasonAsString(stop_reason));
266 
267  if (stop_reason == eStopReasonBreakpoint && BreakpointsExplainStop())
268  return true;
269 
270  // One more quirk here. If this event was from Halt interrupting the target,
271  // then we should not consider ourselves complete. Return true to
272  // acknowledge the stop.
274  LLDB_LOGF(log, "ThreadPlanCallFunction::PlanExplainsStop: The event is an "
275  "Interrupt, returning true.");
276  return true;
277  }
278  // We control breakpoints separately from other "stop reasons." So first,
279  // check the case where we stopped for an internal breakpoint, in that case,
280  // continue on. If it is not an internal breakpoint, consult
281  // m_ignore_breakpoints.
282 
283  if (stop_reason == eStopReasonBreakpoint) {
284  uint64_t break_site_id = m_real_stop_info_sp->GetValue();
285  BreakpointSiteSP bp_site_sp;
286  bp_site_sp = m_process.GetBreakpointSiteList().FindByID(break_site_id);
287  if (bp_site_sp) {
288  uint32_t num_owners = bp_site_sp->GetNumberOfOwners();
289  bool is_internal = true;
290  for (uint32_t i = 0; i < num_owners; i++) {
291  Breakpoint &bp = bp_site_sp->GetOwnerAtIndex(i)->GetBreakpoint();
292  LLDB_LOGF(log,
293  "ThreadPlanCallFunction::PlanExplainsStop: hit "
294  "breakpoint %d while calling function",
295  bp.GetID());
296 
297  if (!bp.IsInternal()) {
298  is_internal = false;
299  break;
300  }
301  }
302  if (is_internal) {
303  LLDB_LOGF(log, "ThreadPlanCallFunction::PlanExplainsStop hit an "
304  "internal breakpoint, not stopping.");
305  return false;
306  }
307  }
308 
309  if (m_ignore_breakpoints) {
310  LLDB_LOGF(log,
311  "ThreadPlanCallFunction::PlanExplainsStop: we are ignoring "
312  "breakpoints, overriding breakpoint stop info ShouldStop, "
313  "returning true");
314  m_real_stop_info_sp->OverrideShouldStop(false);
315  return true;
316  } else {
317  LLDB_LOGF(log, "ThreadPlanCallFunction::PlanExplainsStop: we are not "
318  "ignoring breakpoints, overriding breakpoint stop info "
319  "ShouldStop, returning true");
320  m_real_stop_info_sp->OverrideShouldStop(true);
321  return false;
322  }
323  } else if (!m_unwind_on_error) {
324  // If we don't want to discard this plan, than any stop we don't understand
325  // should be propagated up the stack.
326  return false;
327  } else {
328  // If the subplan is running, any crashes are attributable to us. If we
329  // want to discard the plan, then we say we explain the stop but if we are
330  // going to be discarded, let whoever is above us explain the stop. But
331  // don't discard the plan if the stop would restart itself (for instance if
332  // it is a signal that is set not to stop. Check that here first. We just
333  // say we explain the stop but aren't done and everything will continue on
334  // from there.
335 
336  if (m_real_stop_info_sp &&
337  m_real_stop_info_sp->ShouldStopSynchronous(event_ptr)) {
338  SetPlanComplete(false);
339  return m_subplan_sp ? m_unwind_on_error : false;
340  } else
341  return true;
342  }
343 }
344 
346  // We do some computation in DoPlanExplainsStop that may or may not set the
347  // plan as complete. We need to do that here to make sure our state is
348  // correct.
349  DoPlanExplainsStop(event_ptr);
350 
351  if (IsPlanComplete()) {
352  ReportRegisterState("Function completed. Register state was:");
353  return true;
354  } else {
355  return false;
356  }
357 }
358 
360 
362 
364  //#define SINGLE_STEP_EXPRESSIONS
365 
366  // Now set the thread state to "no reason" so we don't run with whatever
367  // signal was outstanding... Wait till the plan is pushed so we aren't
368  // changing the stop info till we're about to run.
369 
371 
372 #ifndef SINGLE_STEP_EXPRESSIONS
373  Thread &thread = GetThread();
374  m_subplan_sp = std::make_shared<ThreadPlanRunToAddress>(thread, m_start_addr,
376 
377  thread.QueueThreadPlan(m_subplan_sp, false);
378  m_subplan_sp->SetPrivate(true);
379 #endif
380 }
381 
382 bool ThreadPlanCallFunction::WillStop() { return true; }
383 
385  Log *log = GetLog(LLDBLog::Step);
386 
387  if (IsPlanComplete()) {
388  LLDB_LOGF(log, "ThreadPlanCallFunction(%p): Completed call function plan.",
389  static_cast<void *>(this));
390 
392  return true;
393  } else {
394  return false;
395  }
396 }
397 
399  if (m_trap_exceptions) {
403 
408  }
413  }
414  }
415 }
416 
418  if (m_trap_exceptions) {
423  }
424 }
425 
427  StopInfoSP stop_info_sp = GetPrivateStopInfo();
428 
429  if (m_trap_exceptions) {
430  if ((m_cxx_language_runtime &&
432  stop_info_sp)) ||
435  stop_info_sp))) {
436  Log *log = GetLog(LLDBLog::Step);
437  LLDB_LOGF(log, "ThreadPlanCallFunction::BreakpointsExplainStop - Hit an "
438  "exception breakpoint, setting plan complete.");
439 
440  SetPlanComplete(false);
441 
442  // If the user has set the ObjC language breakpoint, it would normally
443  // get priority over our internal catcher breakpoint, but in this case we
444  // can't let that happen, so force the ShouldStop here.
445  stop_info_sp->OverrideShouldStop(true);
446  return true;
447  }
448  }
449 
450  return false;
451 }
452 
454  m_subplan_sp->SetStopOthers(new_value);
455 }
456 
459 }
460 
462  const ABI *abi = m_process.GetABI().get();
463  if (abi && m_return_type.IsValid()) {
464  const bool persistent = false;
466  abi->GetReturnValueObject(GetThread(), m_return_type, persistent);
467  }
468 }
lldb_private::toString
const char * toString(AppleArm64ExceptionClass EC)
Definition: AppleArm64ExceptionClass.h:38
lldb_private::ThreadPlanCallFunction::DidPop
void DidPop() override
Definition: ThreadPlanCallFunction.cpp:213
lldb_private::Log::PutString
void PutString(llvm::StringRef str)
Definition: Log.cpp:134
lldb_private::ThreadPlanCallFunction::m_return_type
CompilerType m_return_type
Definition: ThreadPlanCallFunction.h:148
lldb_private::ThreadPlan::GetThread
Thread & GetThread()
Returns the Thread that is using this thread plan.
Definition: ThreadPlan.cpp:42
lldb_private::ThreadPlanCallFunction::ShouldReportStop
Vote ShouldReportStop(Event *event_ptr) override
Definition: ThreadPlanCallFunction.cpp:238
lldb_private::Log::GetVerbose
bool GetVerbose() const
Definition: Log.cpp:300
lldb_private::Stoppoint::GetID
lldb::break_id_t GetID() const
Definition: Stoppoint.cpp:22
lldb_private::ThreadPlanCallFunction::SetReturnValue
virtual void SetReturnValue()
Definition: ThreadPlanCallFunction.cpp:461
lldb_private::ABI
Definition: ABI.h:27
lldb_private::Event
Definition: Event.h:182
lldb_private::ThreadPlan::IsPlanComplete
bool IsPlanComplete()
Definition: ThreadPlan.cpp:61
lldb_private::RegisterContext::GetRegisterCount
virtual size_t GetRegisterCount()=0
lldb_private::Process::ProcessEventData::GetInterruptedFromEvent
static bool GetInterruptedFromEvent(const Event *event_ptr)
Definition: Process.cpp:4162
lldb_private::RegisterValue
Definition: RegisterValue.h:28
lldb_private::eVoteYes
@ eVoteYes
Definition: lldb-private-enumerations.h:59
lldb_private::ThreadPlanCallFunction::ThreadPlanCallFunction
ThreadPlanCallFunction(Thread &thread, const Address &function, const CompilerType &return_type, llvm::ArrayRef< lldb::addr_t > args, const EvaluateExpressionOptions &options)
lldb_private::RegisterContext::ReadRegister
virtual bool ReadRegister(const RegisterInfo *reg_info, RegisterValue &reg_value)=0
LLDB_LOGF
#define LLDB_LOGF(log,...)
Definition: Log.h:343
lldb_private::ThreadPlan::PlanSucceeded
bool PlanSucceeded()
Definition: ThreadPlan.h:431
lldb_private::Process::GetBreakpointSiteList
BreakpointSiteList & GetBreakpointSiteList()
Definition: Process.cpp:1561
Module.h
lldb_private::ThreadPlanCallFunction::m_trap_exceptions
bool m_trap_exceptions
Definition: ThreadPlanCallFunction.h:123
BreakpointLocation.h
lldb_private::EvaluateExpressionOptions
Definition: Target.h:281
lldb::StopReason
StopReason
Thread stop reasons.
Definition: lldb-enumerations.h:239
lldb_private::ThreadPlanCallFunction::m_cxx_language_runtime
LanguageRuntime * m_cxx_language_runtime
Definition: ThreadPlanCallFunction.h:128
lldb_private::ThreadPlanCallFunction::m_function_addr
Address m_function_addr
Definition: ThreadPlanCallFunction.h:124
lldb_private::eVoteNoOpinion
@ eVoteNoOpinion
Definition: lldb-private-enumerations.h:59
lldb_private::ThreadPlanCallFunction::m_should_clear_cxx_exception_bp
bool m_should_clear_cxx_exception_bp
Definition: ThreadPlanCallFunction.h:143
lldb_private::Stream
Definition: Stream.h:28
lldb::addr_t
uint64_t addr_t
Definition: lldb-types.h:83
lldb_private::Thread::RestoreThreadStateFromCheckpoint
void RestoreThreadStateFromCheckpoint(ThreadStateCheckpoint &saved_state)
Definition: Thread.cpp:526
lldb_private::Thread::RestoreRegisterStateFromCheckpoint
virtual bool RestoreRegisterStateFromCheckpoint(ThreadStateCheckpoint &saved_state)
Definition: Thread.cpp:504
lldb_private::RegisterContext::GetRegisterInfoAtIndex
virtual const RegisterInfo * GetRegisterInfoAtIndex(size_t reg)=0
ABI.h
lldb_private::LanguageRuntime::ClearExceptionBreakpoints
virtual void ClearExceptionBreakpoints()
Definition: LanguageRuntime.h:103
lldb_private::StreamString::GetString
llvm::StringRef GetString() const
Definition: StreamString.cpp:51
lldb_private::ABI::GetRedZoneSize
virtual size_t GetRedZoneSize() const =0
Process.h
lldb_private::ThreadPlanCallFunction::m_subplan_sp
lldb::ThreadPlanSP m_subplan_sp
Definition: ThreadPlanCallFunction.h:127
lldb_private::Thread::CheckpointThreadState
virtual bool CheckpointThreadState(ThreadStateCheckpoint &saved_state)
Definition: Thread.cpp:478
DumpRegisterValue.h
Target.h
lldb_private::LanguageRuntime::SetExceptionBreakpoints
virtual void SetExceptionBreakpoints()
Definition: LanguageRuntime.h:101
lldb_private::Thread::GetProcess
lldb::ProcessSP GetProcess() const
Definition: Thread.h:153
error
static llvm::raw_ostream & error(Stream &strm)
Definition: CommandReturnObject.cpp:17
lldb_private::StreamString::GetSize
size_t GetSize() const
Definition: StreamString.cpp:38
lldb_private::ThreadPlan::GetTarget
Target & GetTarget()
Definition: ThreadPlan.cpp:38
lldb_private::ThreadPlan
Definition: ThreadPlan.h:287
lldb_private::ThreadPlanCallFunction::m_takedown_done
bool m_takedown_done
Definition: ThreadPlanCallFunction.h:140
lldb_private::ThreadPlanCallFunction::m_function_sp
lldb::addr_t m_function_sp
Definition: ThreadPlanCallFunction.h:126
Log.h
lldb_private::ThreadPlan::MischiefManaged
virtual bool MischiefManaged()
Definition: ThreadPlan.cpp:72
lldb_private::Thread
Definition: Thread.h:61
lldb_private::Breakpoint::IsInternal
bool IsInternal() const
Tell whether this breakpoint is an "internal" breakpoint.
Definition: Breakpoint.cpp:259
lldb::eStopReasonNone
@ eStopReasonNone
Definition: lldb-enumerations.h:241
lldb_private::ThreadPlanCallFunction::GetPlanRunState
lldb::StateType GetPlanRunState() override
Definition: ThreadPlanCallFunction.cpp:361
lldb_private::ThreadPlanCallFunction::DoPlanExplainsStop
bool DoPlanExplainsStop(Event *event_ptr) override
Definition: ThreadPlanCallFunction.cpp:245
lldb_private::ThreadPlanCallFunction::ClearBreakpoints
void ClearBreakpoints()
Definition: ThreadPlanCallFunction.cpp:417
lldb_private::LLDBLog::Process
@ Process
lldb_private::ThreadPlanCallFunction::BreakpointsExplainStop
bool BreakpointsExplainStop()
Definition: ThreadPlanCallFunction.cpp:426
lldb_private::StreamString
Definition: StreamString.h:23
lldb_private::Thread::SetStopInfoToNothing
void SetStopInfoToNothing()
Definition: Thread.cpp:468
lldb_private::ThreadPlanCallFunction::MischiefManaged
bool MischiefManaged() override
Definition: ThreadPlanCallFunction.cpp:384
lldb_private::BreakpointSiteList::FindByID
lldb::BreakpointSiteSP FindByID(lldb::break_id_t breakID)
Returns a shared pointer to the breakpoint site with id breakID.
Definition: BreakpointSiteList.cpp:111
lldb_private::ThreadPlanCallFunction::m_real_stop_info_sp
lldb::StopInfoSP m_real_stop_info_sp
Definition: ThreadPlanCallFunction.h:132
lldb_private::ThreadPlanCallFunction::DidPush
void DidPush() override
Definition: ThreadPlanCallFunction.cpp:363
lldb_private::ThreadPlanCallFunction::ReportRegisterState
void ReportRegisterState(const char *message)
Definition: ThreadPlanCallFunction.cpp:146
lldb_private::LanguageRuntime::ExceptionBreakpointsExplainStop
virtual bool ExceptionBreakpointsExplainStop(lldb::StopInfoSP stop_reason)
Definition: LanguageRuntime.h:107
lldb_private::DumpRegisterValue
bool DumpRegisterValue(const RegisterValue &reg_val, Stream *s, const RegisterInfo *reg_info, bool prefix_with_name, bool prefix_with_alt_name, lldb::Format format, uint32_t reg_name_right_align_at=0)
Definition: DumpRegisterValue.cpp:18
ThreadPlanRunToAddress.h
lldb::eLanguageTypeObjC
@ eLanguageTypeObjC
Objective-C.
Definition: lldb-enumerations.h:453
lldb_private::ThreadPlanCallFunction::m_valid
bool m_valid
Definition: ThreadPlanCallFunction.h:118
Thread.h
lldb_private::ThreadPlanCallFunction::m_stop_address
lldb::addr_t m_stop_address
Definition: ThreadPlanCallFunction.h:144
lldb_private::ThreadPlanCallFunction::WillStop
bool WillStop() override
Definition: ThreadPlanCallFunction.cpp:382
Address.h
lldb_private::LLDBLog::Step
@ Step
ThreadPlanCallFunction.h
lldb_private::RegisterContext
Definition: RegisterContext.h:17
lldb_private::CompilerType::IsValid
bool IsValid() const
Definition: CompilerType.h:72
ObjectFile.h
lldb_private::ThreadPlanCallFunction::RestoreThreadState
void RestoreThreadState() override
Definition: ThreadPlanCallFunction.cpp:457
lldb_private::ThreadPlan::SetPlanComplete
void SetPlanComplete(bool success=true)
Definition: ThreadPlan.cpp:66
lldb_private::Status
Definition: Status.h:44
uint32_t
message
message(FATAL_ERROR "invalid libipt include path provided") endif() include_directories($
Definition: Plugins/Trace/intel-pt/CMakeLists.txt:6
lldb_private::ThreadPlanCallFunction::ConstructorSetup
bool ConstructorSetup(Thread &thread, ABI *&abi, lldb::addr_t &start_load_addr, lldb::addr_t &function_load_addr)
Definition: ThreadPlanCallFunction.cpp:34
lldb_private::ThreadPlanCallFunction::StopOthers
bool StopOthers() override
Definition: ThreadPlanCallFunction.cpp:359
lldb_private::Address
Definition: Address.h:59
lldb_private::Stream::EOL
size_t EOL()
Output and End of Line character to the stream.
Definition: Stream.cpp:128
lldb_private::Thread::QueueThreadPlan
Status QueueThreadPlan(lldb::ThreadPlanSP &plan_sp, bool abort_other_plans)
Queues a generic thread plan.
Definition: Thread.cpp:1149
lldb_private::ThreadPlanCallFunction::ShouldStop
bool ShouldStop(Event *event_ptr) override
Definition: ThreadPlanCallFunction.cpp:345
lldb_private::Address::GetLoadAddress
lldb::addr_t GetLoadAddress(Target *target) const
Get the load address.
Definition: Address.cpp:311
lldb_private::ThreadPlanCallFunction::m_unwind_on_error
bool m_unwind_on_error
Definition: ThreadPlanCallFunction.h:120
lldb_private::Process::GetLanguageRuntime
LanguageRuntime * GetLanguageRuntime(lldb::LanguageType language)
Definition: Process.cpp:1508
StopInfo.h
lldb::eStopReasonBreakpoint
@ eStopReasonBreakpoint
Definition: lldb-enumerations.h:243
lldb_private::Vote
Vote
Definition: lldb-private-enumerations.h:59
LLDB_INVALID_ADDRESS
#define LLDB_INVALID_ADDRESS
Definition: lldb-defines.h:74
LLDB_LOG
#define LLDB_LOG(log,...)
The LLDB_LOG* macros defined below are the way to emit log messages.
Definition: Log.h:336
lldb_private::CompilerType
Generic representation of a type in a programming language.
Definition: CompilerType.h:33
lldb_private::Stream::Printf
size_t Printf(const char *format,...) __attribute__((format(printf
Output printf formatted output to the stream.
Definition: Stream.cpp:107
lldb_private::ThreadPlanCallFunction::m_objc_language_runtime
LanguageRuntime * m_objc_language_runtime
Definition: ThreadPlanCallFunction.h:129
lldb_private::ThreadPlanCallFunction::m_return_valobj_sp
lldb::ValueObjectSP m_return_valobj_sp
Definition: ThreadPlanCallFunction.h:137
LanguageRuntime.h
lldb_private
A class that represents a running process on the host machine.
Definition: SBCommandInterpreterRunOptions.h:16
lldb_private::ThreadPlanCallFunction::SetStopOthers
void SetStopOthers(bool new_value) override
Definition: ThreadPlanCallFunction.cpp:453
lldb_private::ThreadPlanCallFunction::m_stop_other_threads
bool m_stop_other_threads
Definition: ThreadPlanCallFunction.h:119
lldb_private::ABI::PrepareTrivialCall
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_private::ThreadPlanCallFunction::~ThreadPlanCallFunction
~ThreadPlanCallFunction() override
Definition: ThreadPlanCallFunction.cpp:142
Breakpoint.h
lldb_private::ThreadPlanCallFunction::m_constructor_errors
StreamString m_constructor_errors
Definition: ThreadPlanCallFunction.h:136
lldb_private::ThreadPlan::m_tid
lldb::tid_t m_tid
Definition: ThreadPlan.h:529
lldb_private::ThreadPlan::ShouldReportStop
virtual Vote ShouldReportStop(Event *event_ptr)
Definition: ThreadPlan.cpp:79
lldb_private::Process::GetABI
const lldb::ABISP & GetABI()
Definition: Process.cpp:1482
lldb_private::ThreadPlanCallFunction::m_start_addr
Address m_start_addr
Definition: ThreadPlanCallFunction.h:125
lldb::StateType
StateType
Process and Thread States.
Definition: lldb-enumerations.h:73
Stream.h
lldb_private::Thread::StopReasonAsString
static std::string StopReasonAsString(lldb::StopReason reason)
Definition: Thread.cpp:1657
lldb_private::Log
Definition: Log.h:115
lldb_private::ThreadPlanCallFunction::GetDescription
void GetDescription(Stream *s, lldb::DescriptionLevel level) override
Print a description of this thread to the stream s.
Definition: ThreadPlanCallFunction.cpp:215
lldb_private::Thread::GetStackFrameAtIndex
virtual lldb::StackFrameSP GetStackFrameAtIndex(uint32_t idx)
Definition: Thread.h:398
lldb_private::ThreadPlanCallFunction::m_ignore_breakpoints
bool m_ignore_breakpoints
Definition: ThreadPlanCallFunction.h:121
lldb_private::ThreadPlanCallFunction::m_should_clear_objc_exception_bp
bool m_should_clear_objc_exception_bp
Definition: ThreadPlanCallFunction.h:142
lldb_private::ThreadPlan::GetPrivateStopInfo
lldb::StopInfoSP GetPrivateStopInfo()
Definition: ThreadPlan.h:515
lldb_private::Thread::GetRegisterContext
virtual lldb::RegisterContextSP GetRegisterContext()=0
lldb_private::GetLog
Log * GetLog(Cat mask)
Retrieve the Log object for the channel associated with the given log enum.
Definition: Log.h:308
lldb_private::ABI::GetReturnValueObject
lldb::ValueObjectSP GetReturnValueObject(Thread &thread, CompilerType &type, bool persistent=true) const
Definition: ABI.cpp:70
lldb_private::ThreadPlan::m_process
Process & m_process
Definition: ThreadPlan.h:528
lldb_private::LanguageRuntime::ExceptionBreakpointsAreSet
virtual bool ExceptionBreakpointsAreSet()
Definition: LanguageRuntime.h:105
lldb_private::ThreadPlanCallFunction::ValidatePlan
bool ValidatePlan(Stream *error) override
Returns whether this plan could be successfully created.
Definition: ThreadPlanCallFunction.cpp:224
lldb
Definition: SBAddress.h:15
lldb::eStateRunning
@ eStateRunning
Process or thread is running and can't be examined.
Definition: lldb-enumerations.h:85
RegisterContext.h
lldb_private::ThreadPlanCallFunction::SetBreakpoints
void SetBreakpoints()
Definition: ThreadPlanCallFunction.cpp:398
LLDBLog.h
lldb::eFormatDefault
@ eFormatDefault
Definition: lldb-enumerations.h:156
lldb::eDescriptionLevelBrief
@ eDescriptionLevelBrief
Definition: lldb-enumerations.h:208
lldb_private::ThreadPlanCallFunction::m_stored_thread_state
Thread::ThreadStateCheckpoint m_stored_thread_state
Definition: ThreadPlanCallFunction.h:130
lldb::DescriptionLevel
DescriptionLevel
Description levels for "void GetDescription(Stream *, DescriptionLevel)" calls.
Definition: lldb-enumerations.h:207
lldb_private::Breakpoint
General Outline: A breakpoint has four main parts, a filter, a resolver, the list of breakpoint locat...
Definition: Breakpoint.h:80
lldb_private::ThreadPlanCallFunction::DoTakedown
virtual void DoTakedown(bool success)
Definition: ThreadPlanCallFunction.cpp:169
lldb_private::Log::PutCString
void PutCString(const char *cstr)
Definition: Log.cpp:133
lldb::eLanguageTypeC_plus_plus
@ eLanguageTypeC_plus_plus
ISO C++:1998.
Definition: lldb-enumerations.h:441