LLDB  mainline
AppleThreadPlanStepThroughObjCTrampoline.cpp
Go to the documentation of this file.
1 //===-- AppleThreadPlanStepThroughObjCTrampoline.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 
10 
16 #include "lldb/Target/Process.h"
17 #include "lldb/Target/Thread.h"
20 #include "lldb/Utility/Log.h"
21 
23 
24 #include <memory>
25 
26 using namespace lldb;
27 using namespace lldb_private;
28 
29 // ThreadPlanStepThroughObjCTrampoline constructor
30 AppleThreadPlanStepThroughObjCTrampoline::
31  AppleThreadPlanStepThroughObjCTrampoline(
32  Thread &thread, AppleObjCTrampolineHandler &trampoline_handler,
33  ValueList &input_values, lldb::addr_t isa_addr, lldb::addr_t sel_addr)
34  : ThreadPlan(ThreadPlan::eKindGeneric,
35  "MacOSX Step through ObjC Trampoline", thread, eVoteNoOpinion,
37  m_trampoline_handler(trampoline_handler),
38  m_args_addr(LLDB_INVALID_ADDRESS), m_input_values(input_values),
39  m_isa_addr(isa_addr), m_sel_addr(sel_addr), m_impl_function(nullptr) {}
40 
41 // Destructor
44 
46  // Setting up the memory space for the called function text might require
47  // allocations, i.e. a nested function call. This needs to be done as a
48  // PreResumeAction.
50 }
51 
53  if (!m_func_sp) {
54  DiagnosticManager diagnostics;
55  m_args_addr =
57 
59  return false;
60  }
63  ExecutionContext exc_ctx;
65  options.SetUnwindOnError(true);
66  options.SetIgnoreBreakpoints(true);
67  options.SetStopOthers(false);
70  exc_ctx, m_args_addr, options, diagnostics);
71  m_func_sp->SetOkayToDiscard(true);
73  }
74  return true;
75 }
76 
80  static_cast<AppleThreadPlanStepThroughObjCTrampoline *>(void_myself);
81  return myself->InitializeFunctionCaller();
82 }
83 
85  Stream *s, lldb::DescriptionLevel level) {
86  if (level == lldb::eDescriptionLevelBrief)
87  s->Printf("Step through ObjC trampoline");
88  else {
89  s->Printf("Stepping to implementation of ObjC method - obj: 0x%llx, isa: "
90  "0x%" PRIx64 ", sel: 0x%" PRIx64,
93  }
94 }
95 
97  return true;
98 }
99 
101  Event *event_ptr) {
102  // If we get asked to explain the stop it will be because something went
103  // wrong (like the implementation for selector function crashed... We're
104  // going to figure out what to do about that, so we do explain the stop.
105  return true;
106 }
107 
109  return eStateRunning;
110 }
111 
113  // First stage: we are still handling the "call a function to get the target
114  // of the dispatch"
115  if (m_func_sp) {
116  if (!m_func_sp->IsPlanComplete()) {
117  return false;
118  } else {
119  if (!m_func_sp->PlanSucceeded()) {
120  SetPlanComplete(false);
121  return true;
122  }
123  m_func_sp.reset();
124  }
125  }
126 
127  // Second stage, if all went well with the function calling, then fetch the
128  // target address, and queue up a "run to that address" plan.
129  if (!m_run_to_sp) {
130  Value target_addr_value;
131  ExecutionContext exc_ctx;
134  target_addr_value);
136  lldb::addr_t target_addr = target_addr_value.GetScalar().ULongLong();
137  Address target_so_addr;
138  target_so_addr.SetOpcodeLoadAddress(target_addr, exc_ctx.GetTargetPtr());
140  if (target_addr == 0) {
141  LLDB_LOGF(log, "Got target implementation of 0x0, stopping.");
142  SetPlanComplete();
143  return true;
144  }
145  if (m_trampoline_handler.AddrIsMsgForward(target_addr)) {
146  LLDB_LOGF(log,
147  "Implementation lookup returned msgForward function: 0x%" PRIx64
148  ", stopping.",
149  target_addr);
150 
151  SymbolContext sc = GetThread().GetStackFrameAtIndex(0)->GetSymbolContext(
152  eSymbolContextEverything);
153  Status status;
154  const bool abort_other_plans = false;
155  const bool first_insn = true;
156  const uint32_t frame_idx = 0;
158  abort_other_plans, &sc, first_insn, false, eVoteNoOpinion,
159  eVoteNoOpinion, frame_idx, status);
160  if (m_run_to_sp && status.Success())
161  m_run_to_sp->SetPrivate(true);
162  return false;
163  }
164 
165  LLDB_LOGF(log, "Running to ObjC method implementation: 0x%" PRIx64,
166  target_addr);
167 
168  ObjCLanguageRuntime *objc_runtime =
169  ObjCLanguageRuntime::Get(*GetThread().GetProcess());
170  assert(objc_runtime != nullptr);
171  objc_runtime->AddToMethodCache(m_isa_addr, m_sel_addr, target_addr);
172  LLDB_LOGF(log,
173  "Adding {isa-addr=0x%" PRIx64 ", sel-addr=0x%" PRIx64
174  "} = addr=0x%" PRIx64 " to cache.",
175  m_isa_addr, m_sel_addr, target_addr);
176 
177  // Extract the target address from the value:
178 
179  m_run_to_sp = std::make_shared<ThreadPlanRunToAddress>(
180  GetThread(), target_so_addr, false);
182  return false;
183  } else if (GetThread().IsThreadPlanDone(m_run_to_sp.get())) {
184  // Third stage, work the run to target plan.
185  SetPlanComplete();
186  return true;
187  }
188  return false;
189 }
190 
191 // The base class MischiefManaged does some cleanup - so you have to call it in
192 // your MischiefManaged derived class.
194  return IsPlanComplete();
195 }
196 
198 
199 // Objective-C uses optimized dispatch functions for some common and seldom
200 // overridden methods. For instance
201 // [object respondsToSelector:];
202 // will get compiled to:
203 // objc_opt_respondsToSelector(object);
204 // This checks whether the selector has been overridden, directly calling the
205 // implementation if it hasn't and calling objc_msgSend if it has.
206 //
207 // We need to get into the overridden implementation. We'll do that by
208 // setting a breakpoint on objc_msgSend, and doing a "step out". If we stop
209 // at objc_msgSend, we can step through to the target of the send, and see if
210 // that's a place we want to stop.
211 //
212 // A couple of complexities. The checking code might call some other method,
213 // so we might see objc_msgSend more than once. Also, these optimized dispatch
214 // functions might dispatch more than one message at a time (e.g. alloc followed
215 // by init.) So we can't give up at the first objc_msgSend.
216 // That means among other things that we have to handle the "ShouldStopHere" -
217 // since we can't just return control to the plan that's controlling us on the
218 // first step.
219 
222  Thread &thread, AppleObjCTrampolineHandler &handler,
223  llvm::StringRef dispatch_func_name)
224  : ThreadPlanStepOut(thread, nullptr, true /* first instruction */, false,
226  0 /* Step out of zeroth frame */,
227  eLazyBoolNo /* Our parent plan will decide this
228  when we are done */
229  ,
230  true /* Run to branch for inline step out */,
231  false /* Don't gather the return value */),
232  m_trampoline_handler(handler),
233  m_dispatch_func_name(std::string(dispatch_func_name)),
234  m_at_msg_send(false) {
235  // Set breakpoints on the dispatch functions:
236  auto bkpt_callback = [&] (lldb::addr_t addr,
237  const AppleObjCTrampolineHandler
238  ::DispatchFunction &dispatch) {
239  m_msgSend_bkpts.push_back(GetTarget().CreateBreakpoint(addr,
240  true /* internal */,
241  false /* hard */));
242  m_msgSend_bkpts.back()->SetThreadID(GetThread().GetID());
243  };
244  handler.ForEachDispatchFunction(bkpt_callback);
245 
246  // We'll set the step-out plan in the DidPush so it gets queued in the right
247  // order.
248 
251  else
253  // We only care about step in. Our parent plan will figure out what to
254  // do when we've stepped out again.
256 }
257 
260  for (BreakpointSP bkpt_sp : m_msgSend_bkpts) {
261  GetTarget().RemoveBreakpointByID(bkpt_sp->GetID());
262  }
263 }
264 
266  Stream *s, lldb::DescriptionLevel level) {
267  switch (level) {
269  s->PutCString("Step through ObjC direct dispatch function.");
270  break;
271  default:
272  s->Printf("Step through ObjC direct dispatch '%s' using breakpoints: ",
273  m_dispatch_func_name.c_str());
274  bool first = true;
275  for (auto bkpt_sp : m_msgSend_bkpts) {
276  if (!first) {
277  s->PutCString(", ");
278  }
279  first = false;
280  s->Printf("%d", bkpt_sp->GetID());
281  }
282  (*s) << ".";
283  break;
284  }
285 }
286 
287 bool
290  return true;
291 
292  StopInfoSP stop_info_sp = GetPrivateStopInfo();
293 
294  // Check if the breakpoint is one of ours msgSend dispatch breakpoints.
295 
296  StopReason stop_reason = eStopReasonNone;
297  if (stop_info_sp)
298  stop_reason = stop_info_sp->GetStopReason();
299 
300  // See if this is one of our msgSend breakpoints:
301  if (stop_reason == eStopReasonBreakpoint) {
302  ProcessSP process_sp = GetThread().GetProcess();
303  uint64_t break_site_id = stop_info_sp->GetValue();
304  BreakpointSiteSP site_sp
305  = process_sp->GetBreakpointSiteList().FindByID(break_site_id);
306  // Some other plan might have deleted the site's last owner before this
307  // got to us. In which case, it wasn't our breakpoint...
308  if (!site_sp)
309  return false;
310 
311  for (BreakpointSP break_sp : m_msgSend_bkpts) {
312  if (site_sp->IsBreakpointAtThisSite(break_sp->GetID())) {
313  // If we aren't the only one with a breakpoint on this site, then we
314  // should just stop and return control to the user.
315  if (site_sp->GetNumberOfOwners() > 1) {
316  SetPlanComplete(true);
317  return false;
318  }
319  m_at_msg_send = true;
320  return true;
321  }
322  }
323  }
324 
325  // We're done here. If one of our sub-plans explained the stop, they
326  // would have already answered true to PlanExplainsStop, and if they were
327  // done, we'll get called to figure out what to do in ShouldStop...
328  return false;
329 }
330 
332  ::DoWillResume(lldb::StateType resume_state, bool current_plan) {
333  ThreadPlanStepOut::DoWillResume(resume_state, current_plan);
334  m_at_msg_send = false;
335  return true;
336 }
337 
339  // If step out plan finished, that means we didn't find our way into a method
340  // implementation. Either we went directly to the default implementation,
341  // of the overridden implementation didn't have debug info.
342  // So we should mark ourselves as done.
343  const bool step_out_should_stop = ThreadPlanStepOut::ShouldStop(event_ptr);
344  if (step_out_should_stop) {
345  SetPlanComplete(true);
346  return true;
347  }
348 
349  // If we have a step through plan, then w're in the process of getting
350  // through an ObjC msgSend. If we arrived at the target function, then
351  // check whether we have debug info, and if we do, stop.
353 
354  if (m_objc_step_through_sp && m_objc_step_through_sp->IsPlanComplete()) {
355  // If the plan failed for some reason, we should probably just let the
356  // step over plan get us out of here... We don't need to do anything about
357  // the step through plan, it is done and will get popped when we continue.
358  if (!m_objc_step_through_sp->PlanSucceeded()) {
359  LLDB_LOGF(log, "ObjC Step through plan failed. Stepping out.");
360  }
361  Status error;
363  SetPlanComplete(true);
364  return true;
365  }
366  // If we didn't want to stop at this msgSend, there might be another so
367  // we should just continue on with the step out and see if our breakpoint
368  // triggers again.
369  m_objc_step_through_sp.reset();
370  for (BreakpointSP bkpt_sp : m_msgSend_bkpts) {
371  bkpt_sp->SetEnabled(true);
372  }
373  return false;
374  }
375 
376  // If we hit an msgSend breakpoint, then we should queue the step through
377  // plan:
378 
379  if (m_at_msg_send) {
380  LanguageRuntime *objc_runtime
381  = GetThread().GetProcess()->GetLanguageRuntime(eLanguageTypeObjC);
382  // There's no way we could have gotten here without an ObjC language
383  // runtime.
384  assert(objc_runtime);
386  objc_runtime->GetStepThroughTrampolinePlan(GetThread(), false);
387  // If we failed to find the target for this dispatch, just keep going and
388  // let the step out complete.
389  if (!m_objc_step_through_sp) {
390  LLDB_LOG(log, "Couldn't find target for message dispatch, continuing.");
391  return false;
392  }
393  // Otherwise push the step through plan and continue.
395  for (BreakpointSP bkpt_sp : m_msgSend_bkpts) {
396  bkpt_sp->SetEnabled(false);
397  }
398  return false;
399  }
400  return true;
401 }
402 
404  if (IsPlanComplete())
405  return true;
407 }
lldb_private::AppleThreadPlanStepThroughDirectDispatch::m_at_msg_send
bool m_at_msg_send
Breakpoints on the objc dispatch functions.
Definition: AppleThreadPlanStepThroughObjCTrampoline.h:108
lldb_private::AppleThreadPlanStepThroughDirectDispatch::m_objc_step_through_sp
lldb::ThreadPlanSP m_objc_step_through_sp
Which dispatch function we're stepping through.
Definition: AppleThreadPlanStepThroughObjCTrampoline.h:103
lldb_private::ExecutionContext
Definition: ExecutionContext.h:292
lldb_private::ThreadPlan::GetThread
Thread & GetThread()
Returns the Thread that is using this thread plan.
Definition: ThreadPlan.cpp:41
lldb_private::Event
Definition: Event.h:180
lldb_private::ThreadPlan::IsPlanComplete
bool IsPlanComplete()
Definition: ThreadPlan.cpp:60
FunctionCaller.h
lldb_private::AppleObjCTrampolineHandler::AddrIsMsgForward
bool AddrIsMsgForward(lldb::addr_t addr) const
Definition: AppleObjCTrampolineHandler.h:33
lldb_private::AppleThreadPlanStepThroughObjCTrampoline::DoPlanExplainsStop
bool DoPlanExplainsStop(Event *event_ptr) override
Definition: AppleThreadPlanStepThroughObjCTrampoline.cpp:100
lldb_private::ObjCLanguageRuntime
Definition: ObjCLanguageRuntime.h:34
lldb_private::Value
Definition: Value.h:38
ThreadPlanStepOut.h
lldb_private::AppleThreadPlanStepThroughDirectDispatch::DoPlanExplainsStop
bool DoPlanExplainsStop(Event *event_ptr) override
Definition: AppleThreadPlanStepThroughObjCTrampoline.cpp:288
lldb_private::ObjCLanguageRuntime::Get
static ObjCLanguageRuntime * Get(Process &process)
Definition: ObjCLanguageRuntime.h:213
lldb_private::ValueList::GetValueAtIndex
Value * GetValueAtIndex(size_t idx)
Definition: Value.cpp:679
lldb_private::Thread::QueueThreadPlanForStepOutNoShouldStop
virtual lldb::ThreadPlanSP QueueThreadPlanForStepOutNoShouldStop(bool abort_other_plans, SymbolContext *addr_context, bool first_insn, bool stop_other_threads, Vote report_stop_vote, Vote report_run_vote, uint32_t frame_idx, Status &status, bool continue_to_next_branch=false)
Queue the plan used to step out of the function at the current PC of a thread.
Definition: Thread.cpp:1316
lldb_private::AppleThreadPlanStepThroughDirectDispatch::GetDescription
void GetDescription(Stream *s, lldb::DescriptionLevel level) override
Print a description of this thread to the stream s.
Definition: AppleThreadPlanStepThroughObjCTrampoline.cpp:265
LLDB_LOGF
#define LLDB_LOGF(log,...)
Definition: Log.h:249
lldb_private::ThreadPlanStepOut
Definition: ThreadPlanStepOut.h:18
lldb_private::AppleThreadPlanStepThroughObjCTrampoline::MischiefManaged
bool MischiefManaged() override
Definition: AppleThreadPlanStepThroughObjCTrampoline.cpp:193
lldb_private::Flags::Clear
ValueType Clear(ValueType mask=~static_cast< ValueType >(0))
Clear one or more flags.
Definition: Flags.h:61
lldb_private::LanguageRuntime::GetStepThroughTrampolinePlan
virtual lldb::ThreadPlanSP GetStepThroughTrampolinePlan(Thread &thread, bool stop_others)=0
lldb_private::EvaluateExpressionOptions
Definition: Target.h:259
lldb::StopReason
StopReason
Thread stop reasons.
Definition: lldb-enumerations.h:239
lldb_private::ValueList
Definition: Value.h:157
lldb_private::eVoteNoOpinion
@ eVoteNoOpinion
Definition: lldb-private-enumerations.h:59
lldb_private::Stream
Definition: Stream.h:28
lldb_private::Target::CreateBreakpoint
lldb::BreakpointSP CreateBreakpoint(const FileSpecList *containingModules, const FileSpec &file, uint32_t line_no, uint32_t column, lldb::addr_t offset, LazyBool check_inlines, LazyBool skip_prologue, bool internal, bool request_hardware, LazyBool move_to_nearest_code)
Definition: Target.cpp:328
lldb::addr_t
uint64_t addr_t
Definition: lldb-types.h:83
lldb_private::AppleThreadPlanStepThroughObjCTrampoline::m_func_sp
lldb::ThreadPlanSP m_func_sp
Definition: AppleThreadPlanStepThroughObjCTrampoline.h:66
lldb_private::ThreadPlanStepOut::MischiefManaged
bool MischiefManaged() override
Definition: ThreadPlanStepOut.cpp:417
lldb_private::AppleThreadPlanStepThroughObjCTrampoline::m_impl_function
FunctionCaller * m_impl_function
The plan that runs to the target.
Definition: AppleThreadPlanStepThroughObjCTrampoline.h:70
lldb_private::AppleThreadPlanStepThroughObjCTrampoline::~AppleThreadPlanStepThroughObjCTrampoline
~AppleThreadPlanStepThroughObjCTrampoline() override
lldb_private::AppleThreadPlanStepThroughObjCTrampoline::ValidatePlan
bool ValidatePlan(Stream *error) override
Returns whether this plan could be successfully created.
Definition: AppleThreadPlanStepThroughObjCTrampoline.cpp:96
lldb_private::AppleThreadPlanStepThroughObjCTrampoline::InitializeFunctionCaller
bool InitializeFunctionCaller()
Definition: AppleThreadPlanStepThroughObjCTrampoline.cpp:52
lldb_private::SymbolContext
Definition: SymbolContext.h:33
lldb_private::AppleThreadPlanStepThroughObjCTrampoline::GetDescription
void GetDescription(Stream *s, lldb::DescriptionLevel level) override
Print a description of this thread to the stream s.
Definition: AppleThreadPlanStepThroughObjCTrampoline.cpp:84
lldb_private::ThreadPlanStepOut::ShouldStop
bool ShouldStop(Event *event_ptr) override
Definition: ThreadPlanStepOut.cpp:336
Process.h
lldb_private::AppleThreadPlanStepThroughDirectDispatch::~AppleThreadPlanStepThroughDirectDispatch
~AppleThreadPlanStepThroughDirectDispatch() override
Definition: AppleThreadPlanStepThroughObjCTrampoline.cpp:259
lldb_private::AppleThreadPlanStepThroughObjCTrampoline::m_args_addr
lldb::addr_t m_args_addr
The handler itself.
Definition: AppleThreadPlanStepThroughObjCTrampoline.h:60
lldb_private::FunctionCaller::DeallocateFunctionResults
void DeallocateFunctionResults(ExecutionContext &exe_ctx, lldb::addr_t args_addr)
Deallocate the arguments structure.
Definition: FunctionCaller.cpp:302
lldb_private::Value::GetScalar
const Scalar & GetScalar() const
Definition: Value.h:112
lldb_private::Thread::GetProcess
lldb::ProcessSP GetProcess() const
Definition: Thread.h:152
error
static llvm::raw_ostream & error(Stream &strm)
Definition: CommandReturnObject.cpp:17
lldb_private::Status::Success
bool Success() const
Test for success condition.
Definition: Status.cpp:288
lldb_private::ThreadProperties::GetStepInAvoidsNoDebug
bool GetStepInAvoidsNoDebug() const
Definition: Thread.cpp:130
lldb_private::ThreadPlan::GetTarget
Target & GetTarget()
Definition: ThreadPlan.cpp:37
lldb_private::ThreadPlan
Definition: ThreadPlan.h:282
lldb_private::AppleThreadPlanStepThroughObjCTrampoline::GetPlanRunState
lldb::StateType GetPlanRunState() override
Definition: AppleThreadPlanStepThroughObjCTrampoline.cpp:108
lldb_private::Scalar::ULongLong
unsigned long long ULongLong(unsigned long long fail_value=0) const
Definition: Scalar.cpp:334
Log.h
lldb_private::ThreadPlanShouldStopHere::eStepOutAvoidNoDebug
@ eStepOutAvoidNoDebug
Definition: ThreadPlanShouldStopHere.h:62
lldb_private::Thread
Definition: Thread.h:60
lldb::eStopReasonNone
@ eStopReasonNone
Definition: lldb-enumerations.h:241
AppleThreadPlanStepThroughObjCTrampoline.h
lldb_private::Process::AddPreResumeAction
void AddPreResumeAction(PreResumeActionCallback callback, void *baton)
Definition: Process.cpp:5559
lldb_private::AppleThreadPlanStepThroughObjCTrampoline::m_isa_addr
lldb::addr_t m_isa_addr
Definition: AppleThreadPlanStepThroughObjCTrampoline.h:63
lldb_private::AppleThreadPlanStepThroughObjCTrampoline::WillStop
bool WillStop() override
Definition: AppleThreadPlanStepThroughObjCTrampoline.cpp:197
lldb_private::AppleObjCTrampolineHandler::ForEachDispatchFunction
void ForEachDispatchFunction(std::function< void(lldb::addr_t, const DispatchFunction &)>)
Definition: AppleObjCTrampolineHandler.cpp:878
lldb_private::GetLogIfAllCategoriesSet
Log * GetLogIfAllCategoriesSet(uint32_t mask)
Definition: Logging.cpp:58
lldb_private::LanguageRuntime
Definition: LanguageRuntime.h:60
ThreadPlanRunToAddress.h
lldb_private::AppleThreadPlanStepThroughObjCTrampoline
Definition: AppleThreadPlanStepThroughObjCTrampoline.h:23
lldb::eFrameCompareYounger
@ eFrameCompareYounger
Definition: lldb-enumerations.h:865
lldb::eLanguageTypeObjC
@ eLanguageTypeObjC
Objective-C.
Definition: lldb-enumerations.h:453
string
string(SUBSTRING ${p} 10 -1 pStripped) if($
Definition: Plugins/CMakeLists.txt:40
lldb_private::Address::SetOpcodeLoadAddress
bool SetOpcodeLoadAddress(lldb::addr_t load_addr, Target *target, AddressClass addr_class=AddressClass::eInvalid, bool allow_section_end=false)
Definition: Address.cpp:378
lldb_private::EvaluateExpressionOptions::SetUnwindOnError
void SetUnwindOnError(bool unwind=false)
Definition: Target.h:306
Thread.h
lldb_private::AppleObjCTrampolineHandler
Definition: AppleObjCTrampolineHandler.h:21
lldb_private::ThreadPlanShouldStopHere::GetFlags
lldb_private::Flags & GetFlags()
Definition: ThreadPlanShouldStopHere.h:104
lldb_private::AppleThreadPlanStepThroughDirectDispatch::m_dispatch_func_name
std::string m_dispatch_func_name
Definition: AppleThreadPlanStepThroughObjCTrampoline.h:101
lldb_private::FunctionCaller::FetchFunctionResults
bool FetchFunctionResults(ExecutionContext &exe_ctx, lldb::addr_t args_addr, Value &ret_value)
Get the result of the function from its struct.
Definition: FunctionCaller.cpp:262
lldb_private::UserID::GetID
lldb::user_id_t GetID() const
Get accessor for the user ID.
Definition: UserID.h:47
lldb_private::Thread::CalculateExecutionContext
void CalculateExecutionContext(ExecutionContext &exe_ctx) override
Reconstruct the object's execution context into sc.
Definition: Thread.cpp:1403
UtilityFunction.h
lldb_private::ThreadPlan::PushPlan
void PushPlan(lldb::ThreadPlanSP &thread_plan_sp)
Definition: ThreadPlan.h:495
lldb_private::AppleObjCTrampolineHandler::GetLookupImplementationFunctionCaller
FunctionCaller * GetLookupImplementationFunctionCaller()
Definition: AppleObjCTrampolineHandler.cpp:1190
lldb_private::EvaluateExpressionOptions::SetIgnoreBreakpoints
void SetIgnoreBreakpoints(bool ignore=false)
Definition: Target.h:310
lldb_private::ObjCLanguageRuntime::AddToMethodCache
void AddToMethodCache(lldb::addr_t class_addr, lldb::addr_t sel, lldb::addr_t impl_addr)
Definition: ObjCLanguageRuntime.cpp:62
lldb_private::AppleThreadPlanStepThroughObjCTrampoline::m_run_to_sp
lldb::ThreadPlanSP m_run_to_sp
This is the function call plan.
Definition: AppleThreadPlanStepThroughObjCTrampoline.h:69
lldb_private::ThreadPlan::SetPlanComplete
void SetPlanComplete(bool success=true)
Definition: ThreadPlan.cpp:65
lldb_private::Status
Definition: Status.h:44
lldb_private::AppleThreadPlanStepThroughDirectDispatch::ShouldStop
bool ShouldStop(Event *event_ptr) override
Definition: AppleThreadPlanStepThroughObjCTrampoline.cpp:338
uint32_t
lldb_private::eLazyBoolNo
@ eLazyBoolNo
Definition: lldb-private-enumerations.h:115
lldb_private::Address
Definition: Address.h:59
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::ThreadPlanStepOut::DoWillResume
bool DoWillResume(lldb::StateType resume_state, bool current_plan) override
Definition: ThreadPlanStepOut.cpp:391
lldb_private::ThreadPlanShouldStopHere::eStepInAvoidNoDebug
@ eStepInAvoidNoDebug
Definition: ThreadPlanShouldStopHere.h:61
lldb_private::AppleThreadPlanStepThroughObjCTrampoline::PreResumeInitializeFunctionCaller
static bool PreResumeInitializeFunctionCaller(void *myself)
Definition: AppleThreadPlanStepThroughObjCTrampoline.cpp:78
lldb_private::DiagnosticManager
Definition: DiagnosticManager.h:93
ObjCLanguageRuntime.h
lldb_private::AppleThreadPlanStepThroughObjCTrampoline::ShouldStop
bool ShouldStop(Event *event_ptr) override
Definition: AppleThreadPlanStepThroughObjCTrampoline.cpp:112
lldb_private::AppleThreadPlanStepThroughDirectDispatch::DoWillResume
bool DoWillResume(lldb::StateType resume_state, bool current_plan) override
Definition: AppleThreadPlanStepThroughObjCTrampoline.cpp:332
lldb::eStopReasonBreakpoint
@ eStopReasonBreakpoint
Definition: lldb-enumerations.h:243
lldb_private::Target::RemoveBreakpointByID
bool RemoveBreakpointByID(lldb::break_id_t break_id)
Definition: Target.cpp:931
LLDB_INVALID_ADDRESS
#define LLDB_INVALID_ADDRESS
Definition: lldb-defines.h:86
LLDB_LOG
#define LLDB_LOG(log,...)
The LLDB_LOG* macros defined below are the way to emit log messages.
Definition: Log.h:242
lldb_private::Stream::Printf
size_t Printf(const char *format,...) __attribute__((format(printf
Output printf formatted output to the stream.
Definition: Stream.cpp:107
DiagnosticManager.h
lldb_private
A class that represents a running process on the host machine.
Definition: SBCommandInterpreterRunOptions.h:16
lldb_private::ThreadPlanShouldStopHere::InvokeShouldStopHereCallback
bool InvokeShouldStopHereCallback(lldb::FrameComparison operation, Status &status)
Definition: ThreadPlanShouldStopHere.cpp:38
lldb_private::ThreadPlanStepOut::DoPlanExplainsStop
bool DoPlanExplainsStop(Event *event_ptr) override
Definition: ThreadPlanStepOut.cpp:268
LIBLLDB_LOG_STEP
#define LIBLLDB_LOG_STEP
Definition: Logging.h:21
lldb_private::AppleThreadPlanStepThroughObjCTrampoline::m_sel_addr
lldb::addr_t m_sel_addr
isa_addr and sel_addr are the keys we will use to cache the implementation.
Definition: AppleThreadPlanStepThroughObjCTrampoline.h:65
lldb_private::FunctionCaller::GetThreadPlanToCallFunction
lldb::ThreadPlanSP GetThreadPlanToCallFunction(ExecutionContext &exe_ctx, lldb::addr_t args_addr, const EvaluateExpressionOptions &options, DiagnosticManager &diagnostic_manager)
Get a thread plan to run the function this FunctionCaller was created with.
Definition: FunctionCaller.cpp:228
lldb_private::Flags::Set
ValueType Set(ValueType mask)
Set one or more flags by logical OR'ing mask with the current flags.
Definition: Flags.h:73
lldb_private::AppleObjCTrampolineHandler::SetupDispatchFunction
lldb::addr_t SetupDispatchFunction(Thread &thread, ValueList &dispatch_values)
Definition: AppleObjCTrampolineHandler.cpp:793
lldb_private::AppleThreadPlanStepThroughDirectDispatch::m_msgSend_bkpts
std::vector< lldb::BreakpointSP > m_msgSend_bkpts
When we hit an objc_msgSend, we'll use this plan to get to its target.
Definition: AppleThreadPlanStepThroughObjCTrampoline.h:106
lldb::StateType
StateType
Process and Thread States.
Definition: lldb-enumerations.h:73
lldb_private::Log
Definition: Log.h:49
lldb_private::Stream::PutCString
size_t PutCString(llvm::StringRef cstr)
Output a C string to the stream.
Definition: Stream.cpp:63
lldb_private::AppleThreadPlanStepThroughDirectDispatch::AppleThreadPlanStepThroughDirectDispatch
AppleThreadPlanStepThroughDirectDispatch(Thread &thread, AppleObjCTrampolineHandler &handler, llvm::StringRef dispatch_func_name)
Definition: AppleThreadPlanStepThroughObjCTrampoline.cpp:221
lldb_private::EvaluateExpressionOptions::SetStopOthers
void SetStopOthers(bool stop_others=true)
Definition: Target.h:343
lldb_private::AppleThreadPlanStepThroughObjCTrampoline::DidPush
void DidPush() override
Definition: AppleThreadPlanStepThroughObjCTrampoline.cpp:45
lldb_private::Thread::GetStackFrameAtIndex
virtual lldb::StackFrameSP GetStackFrameAtIndex(uint32_t idx)
Definition: Thread.h:397
lldb_private::ThreadPlan::GetPrivateStopInfo
lldb::StopInfoSP GetPrivateStopInfo()
Definition: ThreadPlan.h:510
lldb_private::ThreadPlan::m_process
Process & m_process
Definition: ThreadPlan.h:523
lldb_private::AppleThreadPlanStepThroughDirectDispatch::MischiefManaged
bool MischiefManaged() override
Definition: AppleThreadPlanStepThroughObjCTrampoline.cpp:403
lldb
Definition: SBAddress.h:15
lldb::eStateRunning
@ eStateRunning
Process or thread is running and can't be examined.
Definition: lldb-enumerations.h:85
lldb_private::ExecutionContext::GetTargetPtr
Target * GetTargetPtr() const
Returns a pointer to the target object.
Definition: ExecutionContext.cpp:200
ExecutionContext.h
lldb_private::AppleThreadPlanStepThroughObjCTrampoline::m_input_values
ValueList m_input_values
Stores the address for our step through function result structure.
Definition: AppleThreadPlanStepThroughObjCTrampoline.h:62
lldb::eDescriptionLevelBrief
@ eDescriptionLevelBrief
Definition: lldb-enumerations.h:208
lldb_private::AppleThreadPlanStepThroughObjCTrampoline::m_trampoline_handler
AppleObjCTrampolineHandler & m_trampoline_handler
Definition: AppleThreadPlanStepThroughObjCTrampoline.h:59
lldb::DescriptionLevel
DescriptionLevel
Description levels for "void GetDescription(Stream *, DescriptionLevel)" calls.
Definition: lldb-enumerations.h:207
AppleObjCTrampolineHandler.h