LLDB  mainline
Thread.h
Go to the documentation of this file.
1 //===-- Thread.h ------------------------------------------------*- C++ -*-===//
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 
9 #ifndef LLDB_TARGET_THREAD_H
10 #define LLDB_TARGET_THREAD_H
11 
12 #include <memory>
13 #include <mutex>
14 #include <string>
15 #include <vector>
16 
23 #include "lldb/Utility/Event.h"
26 #include "lldb/Utility/UserID.h"
27 #include "lldb/lldb-private.h"
28 
29 #define LLDB_THREAD_MAX_STOP_EXC_DATA 8
30 
31 namespace lldb_private {
32 
33 class ThreadPlanStack;
34 
35 class ThreadProperties : public Properties {
36 public:
37  ThreadProperties(bool is_global);
38 
39  ~ThreadProperties() override;
40 
41  /// The regular expression returned determines symbols that this
42  /// thread won't stop in during "step-in" operations.
43  ///
44  /// \return
45  /// A pointer to a regular expression to compare against symbols,
46  /// or nullptr if all symbols are allowed.
47  ///
49 
50  FileSpecList GetLibrariesToAvoid() const;
51 
52  bool GetTraceEnabledState() const;
53 
54  bool GetStepInAvoidsNoDebug() const;
55 
56  bool GetStepOutAvoidsNoDebug() const;
57 
58  uint64_t GetMaxBacktraceDepth() const;
59 };
60 
61 class Thread : public std::enable_shared_from_this<Thread>,
62  public ThreadProperties,
63  public UserID,
64  public ExecutionContextScope,
65  public Broadcaster {
66 public:
67  /// Broadcaster event bits definitions.
68  enum {
74  };
75 
77 
78  ConstString &GetBroadcasterClass() const override {
80  }
81 
82  class ThreadEventData : public EventData {
83  public:
84  ThreadEventData(const lldb::ThreadSP thread_sp);
85 
86  ThreadEventData(const lldb::ThreadSP thread_sp, const StackID &stack_id);
87 
89 
90  ~ThreadEventData() override;
91 
93 
94  ConstString GetFlavor() const override {
96  }
97 
98  void Dump(Stream *s) const override;
99 
100  static const ThreadEventData *GetEventDataFromEvent(const Event *event_ptr);
101 
102  static lldb::ThreadSP GetThreadFromEvent(const Event *event_ptr);
103 
104  static StackID GetStackIDFromEvent(const Event *event_ptr);
105 
106  static lldb::StackFrameSP GetStackFrameFromEvent(const Event *event_ptr);
107 
108  lldb::ThreadSP GetThread() const { return m_thread_sp; }
109 
110  StackID GetStackID() const { return m_stack_id; }
111 
112  private:
113  lldb::ThreadSP m_thread_sp;
115 
116  ThreadEventData(const ThreadEventData &) = delete;
117  const ThreadEventData &operator=(const ThreadEventData &) = delete;
118  };
119 
121  uint32_t orig_stop_id; // Dunno if I need this yet but it is an interesting
122  // bit of data.
123  lldb::StopInfoSP stop_info_sp; // You have to restore the stop info or you
124  // might continue with the wrong signals.
126  lldb::RegisterCheckpointSP
127  register_backup_sp; // You need to restore the registers, of course...
130  };
131 
132  /// Constructor
133  ///
134  /// \param [in] use_invalid_index_id
135  /// Optional parameter, defaults to false. The only subclass that
136  /// is likely to set use_invalid_index_id == true is the HistoryThread
137  /// class. In that case, the Thread we are constructing represents
138  /// a thread from earlier in the program execution. We may have the
139  /// tid of the original thread that they represent but we don't want
140  /// to reuse the IndexID of that thread, or create a new one. If a
141  /// client wants to know the original thread's IndexID, they should use
142  /// Thread::GetExtendedBacktraceOriginatingIndexID().
143  Thread(Process &process, lldb::tid_t tid, bool use_invalid_index_id = false);
144 
145  ~Thread() override;
146 
147  static void SettingsInitialize();
148 
149  static void SettingsTerminate();
150 
152 
153  lldb::ProcessSP GetProcess() const { return m_process_wp.lock(); }
154 
155  int GetResumeSignal() const { return m_resume_signal; }
156 
157  void SetResumeSignal(int signal) { m_resume_signal = signal; }
158 
159  lldb::StateType GetState() const;
160 
161  void SetState(lldb::StateType state);
162 
163  /// Sets the USER resume state for this thread. If you set a thread to
164  /// suspended with
165  /// this API, it won't take part in any of the arbitration for ShouldResume,
166  /// and will stay
167  /// suspended even when other threads do get to run.
168  ///
169  /// N.B. This is not the state that is used internally by thread plans to
170  /// implement
171  /// staying on one thread while stepping over a breakpoint, etc. The is the
172  /// TemporaryResume state, and if you are implementing some bit of strategy in
173  /// the stepping
174  /// machinery you should be using that state and not the user resume state.
175  ///
176  /// If you are just preparing all threads to run, you should not override the
177  /// threads that are
178  /// marked as suspended by the debugger. In that case, pass override_suspend
179  /// = false. If you want
180  /// to force the thread to run (e.g. the "thread continue" command, or are
181  /// resetting the state
182  /// (e.g. in SBThread::Resume()), then pass true to override_suspend.
183  void SetResumeState(lldb::StateType state, bool override_suspend = false) {
184  if (m_resume_state == lldb::eStateSuspended && !override_suspend)
185  return;
186  m_resume_state = state;
187  }
188 
189  /// Gets the USER resume state for this thread. This is not the same as what
190  /// this thread is going to do for any particular step, however if this thread
191  /// returns eStateSuspended, then the process control logic will never allow
192  /// this
193  /// thread to run.
194  ///
195  /// \return
196  /// The User resume state for this thread.
198 
199  // This function is called on all the threads before "ShouldResume" and
200  // "WillResume" in case a thread needs to change its state before the
201  // ThreadList polls all the threads to figure out which ones actually will
202  // get to run and how.
203  void SetupForResume();
204 
205  // Do not override this function, it is for thread plan logic only
206  bool ShouldResume(lldb::StateType resume_state);
207 
208  // Override this to do platform specific tasks before resume.
209  virtual void WillResume(lldb::StateType resume_state) {}
210 
211  // This clears generic thread state after a resume. If you subclass this, be
212  // sure to call it.
213  virtual void DidResume();
214 
215  // This notifies the thread when a private stop occurs.
216  virtual void DidStop();
217 
218  virtual void RefreshStateAfterStop() = 0;
219 
221 
223 
225 
226  void WillStop();
227 
228  bool ShouldStop(Event *event_ptr);
229 
230  Vote ShouldReportStop(Event *event_ptr);
231 
232  Vote ShouldReportRun(Event *event_ptr);
233 
234  void Flush();
235 
236  // Return whether this thread matches the specification in ThreadSpec. This
237  // is a virtual method because at some point we may extend the thread spec
238  // with a platform specific dictionary of attributes, which then only the
239  // platform specific Thread implementation would know how to match. For now,
240  // this just calls through to the ThreadSpec's ThreadPassesBasicTests method.
241  virtual bool MatchesSpec(const ThreadSpec *spec);
242 
243  // Get the current public stop info, calculating it if necessary.
244  lldb::StopInfoSP GetStopInfo();
245 
247 
248  bool StopInfoIsUpToDate() const;
249 
250  // This sets the stop reason to a "blank" stop reason, so you can call
251  // functions on the thread without having the called function run with
252  // whatever stop reason you stopped with.
253  void SetStopInfoToNothing();
254 
256 
258 
260 
261  virtual const char *GetInfo() { return nullptr; }
262 
263  /// Retrieve a dictionary of information about this thread
264  ///
265  /// On Mac OS X systems there may be voucher information.
266  /// The top level dictionary returned will have an "activity" key and the
267  /// value of the activity is a dictionary. Keys in that dictionary will
268  /// be "name" and "id", among others.
269  /// There may also be "trace_messages" (an array) with each entry in that
270  /// array
271  /// being a dictionary (keys include "message" with the text of the trace
272  /// message).
277  }
278  return m_extended_info;
279  }
280 
281  virtual const char *GetName() { return nullptr; }
282 
283  virtual void SetName(const char *name) {}
284 
285  /// Whether this thread can be associated with a libdispatch queue
286  ///
287  /// The Thread may know if it is associated with a libdispatch queue,
288  /// it may know definitively that it is NOT associated with a libdispatch
289  /// queue, or it may be unknown whether it is associated with a libdispatch
290  /// queue.
291  ///
292  /// \return
293  /// eLazyBoolNo if this thread is definitely not associated with a
294  /// libdispatch queue (e.g. on a non-Darwin system where GCD aka
295  /// libdispatch is not available).
296  ///
297  /// eLazyBoolYes this thread is associated with a libdispatch queue.
298  ///
299  /// eLazyBoolCalculate this thread may be associated with a libdispatch
300  /// queue but the thread doesn't know one way or the other.
302  return eLazyBoolNo;
303  }
304 
306  lldb_private::LazyBool associated_with_libdispatch_queue) {}
307 
308  /// Retrieve the Queue ID for the queue currently using this Thread
309  ///
310  /// If this Thread is doing work on behalf of a libdispatch/GCD queue,
311  /// retrieve the QueueID.
312  ///
313  /// This is a unique identifier for the libdispatch/GCD queue in a
314  /// process. Often starting at 1 for the initial system-created
315  /// queues and incrementing, a QueueID will not be reused for a
316  /// different queue during the lifetime of a process.
317  ///
318  /// \return
319  /// A QueueID if the Thread subclass implements this, else
320  /// LLDB_INVALID_QUEUE_ID.
322 
323  virtual void SetQueueID(lldb::queue_id_t new_val) {}
324 
325  /// Retrieve the Queue name for the queue currently using this Thread
326  ///
327  /// If this Thread is doing work on behalf of a libdispatch/GCD queue,
328  /// retrieve the Queue name.
329  ///
330  /// \return
331  /// The Queue name, if the Thread subclass implements this, else
332  /// nullptr.
333  virtual const char *GetQueueName() { return nullptr; }
334 
335  virtual void SetQueueName(const char *name) {}
336 
337  /// Retrieve the Queue kind for the queue currently using this Thread
338  ///
339  /// If this Thread is doing work on behalf of a libdispatch/GCD queue,
340  /// retrieve the Queue kind - either eQueueKindSerial or
341  /// eQueueKindConcurrent, indicating that this queue processes work
342  /// items serially or concurrently.
343  ///
344  /// \return
345  /// The Queue kind, if the Thread subclass implements this, else
346  /// eQueueKindUnknown.
348 
349  virtual void SetQueueKind(lldb::QueueKind kind) {}
350 
351  /// Retrieve the Queue for this thread, if any.
352  ///
353  /// \return
354  /// A QueueSP for the queue that is currently associated with this
355  /// thread.
356  /// An empty shared pointer indicates that this thread is not
357  /// associated with a queue, or libdispatch queues are not
358  /// supported on this target.
359  virtual lldb::QueueSP GetQueue() { return lldb::QueueSP(); }
360 
361  /// Retrieve the address of the libdispatch_queue_t struct for queue
362  /// currently using this Thread
363  ///
364  /// If this Thread is doing work on behalf of a libdispatch/GCD queue,
365  /// retrieve the address of the libdispatch_queue_t structure describing
366  /// the queue.
367  ///
368  /// This address may be reused for different queues later in the Process
369  /// lifetime and should not be used to identify a queue uniquely. Use
370  /// the GetQueueID() call for that.
371  ///
372  /// \return
373  /// The Queue's libdispatch_queue_t address if the Thread subclass
374  /// implements this, else LLDB_INVALID_ADDRESS.
376  return LLDB_INVALID_ADDRESS;
377  }
378 
379  virtual void SetQueueLibdispatchQueueAddress(lldb::addr_t dispatch_queue_t) {}
380 
381  /// Whether this Thread already has all the Queue information cached or not
382  ///
383  /// A Thread may be associated with a libdispatch work Queue at a given
384  /// public stop event. If so, the thread can satisify requests like
385  /// GetQueueLibdispatchQueueAddress, GetQueueKind, GetQueueName, and
386  /// GetQueueID
387  /// either from information from the remote debug stub when it is initially
388  /// created, or it can query the SystemRuntime for that information.
389  ///
390  /// This method allows the SystemRuntime to discover if a thread has this
391  /// information already, instead of calling the thread to get the information
392  /// and having the thread call the SystemRuntime again.
393  virtual bool ThreadHasQueueInformation() const { return false; }
394 
396  return GetStackFrameList()->GetNumFrames();
397  }
398 
399  virtual lldb::StackFrameSP GetStackFrameAtIndex(uint32_t idx) {
400  return GetStackFrameList()->GetFrameAtIndex(idx);
401  }
402 
403  virtual lldb::StackFrameSP
405 
407  return GetStackFrameList()->DecrementCurrentInlinedDepth();
408  }
409 
411  return GetStackFrameList()->GetCurrentInlinedDepth();
412  }
413 
415  lldb::ValueObjectSP return_value_sp,
416  bool broadcast = false);
417 
418  Status ReturnFromFrame(lldb::StackFrameSP frame_sp,
419  lldb::ValueObjectSP return_value_sp,
420  bool broadcast = false);
421 
422  Status JumpToLine(const FileSpec &file, uint32_t line,
423  bool can_leave_function, std::string *warnings = nullptr);
424 
425  virtual lldb::StackFrameSP GetFrameWithStackID(const StackID &stack_id) {
426  if (stack_id.IsValid())
427  return GetStackFrameList()->GetFrameWithStackID(stack_id);
428  return lldb::StackFrameSP();
429  }
430 
432  return GetStackFrameList()->GetSelectedFrameIndex();
433  }
434 
435  lldb::StackFrameSP GetSelectedFrame();
436 
438  bool broadcast = false);
439 
440  bool SetSelectedFrameByIndex(uint32_t frame_idx, bool broadcast = false);
441 
443  Stream &output_stream);
444 
446  GetStackFrameList()->SetDefaultFileAndLineToSelectedFrame();
447  }
448 
449  virtual lldb::RegisterContextSP GetRegisterContext() = 0;
450 
451  virtual lldb::RegisterContextSP
453 
454  virtual void ClearStackFrames();
455 
456  virtual bool SetBackingThread(const lldb::ThreadSP &thread_sp) {
457  return false;
458  }
459 
460  virtual lldb::ThreadSP GetBackingThread() const { return lldb::ThreadSP(); }
461 
462  virtual void ClearBackingThread() {
463  // Subclasses can use this function if a thread is actually backed by
464  // another thread. This is currently used for the OperatingSystem plug-ins
465  // where they might have a thread that is in memory, yet its registers are
466  // available through the lldb_private::Thread subclass for the current
467  // lldb_private::Process class. Since each time the process stops the
468  // backing threads for memory threads can change, we need a way to clear
469  // the backing thread for all memory threads each time we stop.
470  }
471 
472  /// Dump \a count instructions of the thread's \a Trace starting at the \a
473  /// start_position position in reverse order.
474  ///
475  /// The instructions are indexed in reverse order, which means that the \a
476  /// start_position 0 represents the last instruction of the trace
477  /// chronologically.
478  ///
479  /// \param[in] s
480  /// The stream object where the instructions are printed.
481  ///
482  /// \param[in] count
483  /// The number of instructions to print.
484  ///
485  /// \param[in] start_position
486  /// The position of the first instruction to print.
487  void DumpTraceInstructions(Stream &s, size_t count,
488  size_t start_position = 0) const;
489 
490  // If stop_format is true, this will be the form used when we print stop
491  // info. If false, it will be the form we use for thread list and co.
492  void DumpUsingSettingsFormat(Stream &strm, uint32_t frame_idx,
493  bool stop_format);
494 
496  bool print_json_thread, bool print_json_stopinfo);
497 
498  /// Default implementation for stepping into.
499  ///
500  /// This function is designed to be used by commands where the
501  /// process is publicly stopped.
502  ///
503  /// \param[in] source_step
504  /// If true and the frame has debug info, then do a source level
505  /// step in, else do a single instruction step in.
506  ///
507  /// \param[in] step_in_avoids_code_without_debug_info
508  /// If \a true, then avoid stepping into code that doesn't have
509  /// debug info, else step into any code regardless of whether it
510  /// has debug info.
511  ///
512  /// \param[in] step_out_avoids_code_without_debug_info
513  /// If \a true, then if you step out to code with no debug info, keep
514  /// stepping out till you get to code with debug info.
515  ///
516  /// \return
517  /// An error that describes anything that went wrong
518  virtual Status
519  StepIn(bool source_step,
520  LazyBool step_in_avoids_code_without_debug_info = eLazyBoolCalculate,
521  LazyBool step_out_avoids_code_without_debug_info = eLazyBoolCalculate);
522 
523  /// Default implementation for stepping over.
524  ///
525  /// This function is designed to be used by commands where the
526  /// process is publicly stopped.
527  ///
528  /// \param[in] source_step
529  /// If true and the frame has debug info, then do a source level
530  /// step over, else do a single instruction step over.
531  ///
532  /// \return
533  /// An error that describes anything that went wrong
534  virtual Status StepOver(
535  bool source_step,
536  LazyBool step_out_avoids_code_without_debug_info = eLazyBoolCalculate);
537 
538  /// Default implementation for stepping out.
539  ///
540  /// This function is designed to be used by commands where the
541  /// process is publicly stopped.
542  ///
543  /// \param[in] frame_idx
544  /// The frame index to step out of.
545  ///
546  /// \return
547  /// An error that describes anything that went wrong
548  virtual Status StepOut(uint32_t frame_idx = 0);
549 
550  /// Retrieves the per-thread data area.
551  /// Most OSs maintain a per-thread pointer (e.g. the FS register on
552  /// x64), which we return the value of here.
553  ///
554  /// \return
555  /// LLDB_INVALID_ADDRESS if not supported, otherwise the thread
556  /// pointer value.
557  virtual lldb::addr_t GetThreadPointer();
558 
559  /// Retrieves the per-module TLS block for a thread.
560  ///
561  /// \param[in] module
562  /// The module to query TLS data for.
563  ///
564  /// \param[in] tls_file_addr
565  /// The thread local address in module
566  /// \return
567  /// If the thread has TLS data allocated for the
568  /// module, the address of the TLS block. Otherwise
569  /// LLDB_INVALID_ADDRESS is returned.
570  virtual lldb::addr_t GetThreadLocalData(const lldb::ModuleSP module,
571  lldb::addr_t tls_file_addr);
572 
573  /// Check whether this thread is safe to run functions
574  ///
575  /// The SystemRuntime may know of certain thread states (functions in
576  /// process of execution, for instance) which can make it unsafe for
577  /// functions to be called.
578  ///
579  /// \return
580  /// True if it is safe to call functions on this thread.
581  /// False if function calls should be avoided on this thread.
582  virtual bool SafeToCallFunctions();
583 
584  // Thread Plan Providers:
585  // This section provides the basic thread plans that the Process control
586  // machinery uses to run the target. ThreadPlan.h provides more details on
587  // how this mechanism works. The thread provides accessors to a set of plans
588  // that perform basic operations. The idea is that particular Platform
589  // plugins can override these methods to provide the implementation of these
590  // basic operations appropriate to their environment.
591  //
592  // NB: All the QueueThreadPlanXXX providers return Shared Pointers to
593  // Thread plans. This is useful so that you can modify the plans after
594  // creation in ways specific to that plan type. Also, it is often necessary
595  // for ThreadPlans that utilize other ThreadPlans to implement their task to
596  // keep a shared pointer to the sub-plan. But besides that, the shared
597  // pointers should only be held onto by entities who live no longer than the
598  // thread containing the ThreadPlan.
599  // FIXME: If this becomes a problem, we can make a version that just returns a
600  // pointer,
601  // which it is clearly unsafe to hold onto, and a shared pointer version, and
602  // only allow ThreadPlan and Co. to use the latter. That is made more
603  // annoying to do because there's no elegant way to friend a method to all
604  // sub-classes of a given class.
605  //
606 
607  /// Queues the base plan for a thread.
608  /// The version returned by Process does some things that are useful,
609  /// like handle breakpoints and signals, so if you return a plugin specific
610  /// one you probably want to call through to the Process one for anything
611  /// your plugin doesn't explicitly handle.
612  ///
613  /// \param[in] abort_other_plans
614  /// \b true if we discard the currently queued plans and replace them with
615  /// this one.
616  /// Otherwise this plan will go on the end of the plan stack.
617  ///
618  /// \return
619  /// A shared pointer to the newly queued thread plan, or nullptr if the
620  /// plan could not be queued.
621  lldb::ThreadPlanSP QueueBasePlan(bool abort_other_plans);
622 
623  /// Queues the plan used to step one instruction from the current PC of \a
624  /// thread.
625  ///
626  /// \param[in] step_over
627  /// \b true if we step over calls to functions, false if we step in.
628  ///
629  /// \param[in] abort_other_plans
630  /// \b true if we discard the currently queued plans and replace them with
631  /// this one.
632  /// Otherwise this plan will go on the end of the plan stack.
633  ///
634  /// \param[in] stop_other_threads
635  /// \b true if we will stop other threads while we single step this one.
636  ///
637  /// \param[out] status
638  /// A status with an error if queuing failed.
639  ///
640  /// \return
641  /// A shared pointer to the newly queued thread plan, or nullptr if the
642  /// plan could not be queued.
643  virtual lldb::ThreadPlanSP QueueThreadPlanForStepSingleInstruction(
644  bool step_over, bool abort_other_plans, bool stop_other_threads,
645  Status &status);
646 
647  /// Queues the plan used to step through an address range, stepping over
648  /// function calls.
649  ///
650  /// \param[in] abort_other_plans
651  /// \b true if we discard the currently queued plans and replace them with
652  /// this one.
653  /// Otherwise this plan will go on the end of the plan stack.
654  ///
655  /// \param[in] type
656  /// Type of step to do, only eStepTypeInto and eStepTypeOver are supported
657  /// by this plan.
658  ///
659  /// \param[in] range
660  /// The address range to step through.
661  ///
662  /// \param[in] addr_context
663  /// When dealing with stepping through inlined functions the current PC is
664  /// not enough information to know
665  /// what "step" means. For instance a series of nested inline functions
666  /// might start at the same address.
667  // The \a addr_context provides the current symbol context the step
668  /// is supposed to be out of.
669  // FIXME: Currently unused.
670  ///
671  /// \param[in] stop_other_threads
672  /// \b true if we will stop other threads while we single step this one.
673  ///
674  /// \param[out] status
675  /// A status with an error if queuing failed.
676  ///
677  /// \param[in] step_out_avoids_code_without_debug_info
678  /// If eLazyBoolYes, if the step over steps out it will continue to step
679  /// out till it comes to a frame with debug info.
680  /// If eLazyBoolCalculate, we will consult the default set in the thread.
681  ///
682  /// \return
683  /// A shared pointer to the newly queued thread plan, or nullptr if the
684  /// plan could not be queued.
685  virtual lldb::ThreadPlanSP QueueThreadPlanForStepOverRange(
686  bool abort_other_plans, const AddressRange &range,
687  const SymbolContext &addr_context, lldb::RunMode stop_other_threads,
688  Status &status,
689  LazyBool step_out_avoids_code_without_debug_info = eLazyBoolCalculate);
690 
691  // Helper function that takes a LineEntry to step, insted of an AddressRange.
692  // This may combine multiple LineEntries of the same source line number to
693  // step over a longer address range in a single operation.
694  virtual lldb::ThreadPlanSP QueueThreadPlanForStepOverRange(
695  bool abort_other_plans, const LineEntry &line_entry,
696  const SymbolContext &addr_context, lldb::RunMode stop_other_threads,
697  Status &status,
698  LazyBool step_out_avoids_code_without_debug_info = eLazyBoolCalculate);
699 
700  /// Queues the plan used to step through an address range, stepping into
701  /// functions.
702  ///
703  /// \param[in] abort_other_plans
704  /// \b true if we discard the currently queued plans and replace them with
705  /// this one.
706  /// Otherwise this plan will go on the end of the plan stack.
707  ///
708  /// \param[in] type
709  /// Type of step to do, only eStepTypeInto and eStepTypeOver are supported
710  /// by this plan.
711  ///
712  /// \param[in] range
713  /// The address range to step through.
714  ///
715  /// \param[in] addr_context
716  /// When dealing with stepping through inlined functions the current PC is
717  /// not enough information to know
718  /// what "step" means. For instance a series of nested inline functions
719  /// might start at the same address.
720  // The \a addr_context provides the current symbol context the step
721  /// is supposed to be out of.
722  // FIXME: Currently unused.
723  ///
724  /// \param[in] step_in_target
725  /// Name if function we are trying to step into. We will step out if we
726  /// don't land in that function.
727  ///
728  /// \param[in] stop_other_threads
729  /// \b true if we will stop other threads while we single step this one.
730  ///
731  /// \param[out] status
732  /// A status with an error if queuing failed.
733  ///
734  /// \param[in] step_in_avoids_code_without_debug_info
735  /// If eLazyBoolYes we will step out if we step into code with no debug
736  /// info.
737  /// If eLazyBoolCalculate we will consult the default set in the thread.
738  ///
739  /// \param[in] step_out_avoids_code_without_debug_info
740  /// If eLazyBoolYes, if the step over steps out it will continue to step
741  /// out till it comes to a frame with debug info.
742  /// If eLazyBoolCalculate, it will consult the default set in the thread.
743  ///
744  /// \return
745  /// A shared pointer to the newly queued thread plan, or nullptr if the
746  /// plan could not be queued.
747  virtual lldb::ThreadPlanSP QueueThreadPlanForStepInRange(
748  bool abort_other_plans, const AddressRange &range,
749  const SymbolContext &addr_context, const char *step_in_target,
750  lldb::RunMode stop_other_threads, Status &status,
751  LazyBool step_in_avoids_code_without_debug_info = eLazyBoolCalculate,
752  LazyBool step_out_avoids_code_without_debug_info = eLazyBoolCalculate);
753 
754  // Helper function that takes a LineEntry to step, insted of an AddressRange.
755  // This may combine multiple LineEntries of the same source line number to
756  // step over a longer address range in a single operation.
757  virtual lldb::ThreadPlanSP QueueThreadPlanForStepInRange(
758  bool abort_other_plans, const LineEntry &line_entry,
759  const SymbolContext &addr_context, const char *step_in_target,
760  lldb::RunMode stop_other_threads, Status &status,
761  LazyBool step_in_avoids_code_without_debug_info = eLazyBoolCalculate,
762  LazyBool step_out_avoids_code_without_debug_info = eLazyBoolCalculate);
763 
764  /// Queue the plan used to step out of the function at the current PC of
765  /// \a thread.
766  ///
767  /// \param[in] abort_other_plans
768  /// \b true if we discard the currently queued plans and replace them with
769  /// this one.
770  /// Otherwise this plan will go on the end of the plan stack.
771  ///
772  /// \param[in] addr_context
773  /// When dealing with stepping through inlined functions the current PC is
774  /// not enough information to know
775  /// what "step" means. For instance a series of nested inline functions
776  /// might start at the same address.
777  // The \a addr_context provides the current symbol context the step
778  /// is supposed to be out of.
779  // FIXME: Currently unused.
780  ///
781  /// \param[in] first_insn
782  /// \b true if this is the first instruction of a function.
783  ///
784  /// \param[in] stop_other_threads
785  /// \b true if we will stop other threads while we single step this one.
786  ///
787  /// \param[in] report_stop_vote
788  /// See standard meanings for the stop & run votes in ThreadPlan.h.
789  ///
790  /// \param[in] report_run_vote
791  /// See standard meanings for the stop & run votes in ThreadPlan.h.
792  ///
793  /// \param[out] status
794  /// A status with an error if queuing failed.
795  ///
796  /// \param[in] step_out_avoids_code_without_debug_info
797  /// If eLazyBoolYes, if the step over steps out it will continue to step
798  /// out till it comes to a frame with debug info.
799  /// If eLazyBoolCalculate, it will consult the default set in the thread.
800  ///
801  /// \return
802  /// A shared pointer to the newly queued thread plan, or nullptr if the
803  /// plan could not be queued.
804  virtual lldb::ThreadPlanSP QueueThreadPlanForStepOut(
805  bool abort_other_plans, SymbolContext *addr_context, bool first_insn,
806  bool stop_other_threads, Vote report_stop_vote, Vote report_run_vote,
807  uint32_t frame_idx, Status &status,
808  LazyBool step_out_avoids_code_without_debug_info = eLazyBoolCalculate);
809 
810  /// Queue the plan used to step out of the function at the current PC of
811  /// a thread. This version does not consult the should stop here callback,
812  /// and should only
813  /// be used by other thread plans when they need to retain control of the step
814  /// out.
815  ///
816  /// \param[in] abort_other_plans
817  /// \b true if we discard the currently queued plans and replace them with
818  /// this one.
819  /// Otherwise this plan will go on the end of the plan stack.
820  ///
821  /// \param[in] addr_context
822  /// When dealing with stepping through inlined functions the current PC is
823  /// not enough information to know
824  /// what "step" means. For instance a series of nested inline functions
825  /// might start at the same address.
826  // The \a addr_context provides the current symbol context the step
827  /// is supposed to be out of.
828  // FIXME: Currently unused.
829  ///
830  /// \param[in] first_insn
831  /// \b true if this is the first instruction of a function.
832  ///
833  /// \param[in] stop_other_threads
834  /// \b true if we will stop other threads while we single step this one.
835  ///
836  /// \param[in] report_stop_vote
837  /// See standard meanings for the stop & run votes in ThreadPlan.h.
838  ///
839  /// \param[in] report_run_vote
840  /// See standard meanings for the stop & run votes in ThreadPlan.h.
841  ///
842  /// \param[in] frame_idx
843  /// The frame index.
844  ///
845  /// \param[out] status
846  /// A status with an error if queuing failed.
847  ///
848  /// \param[in] continue_to_next_branch
849  /// Normally this will enqueue a plan that will put a breakpoint on the
850  /// return address and continue
851  /// to there. If continue_to_next_branch is true, this is an operation not
852  /// involving the user --
853  /// e.g. stepping "next" in a source line and we instruction stepped into
854  /// another function --
855  /// so instead of putting a breakpoint on the return address, advance the
856  /// breakpoint to the
857  /// end of the source line that is doing the call, or until the next flow
858  /// control instruction.
859  /// If the return value from the function call is to be retrieved /
860  /// displayed to the user, you must stop
861  /// on the return address. The return value may be stored in volatile
862  /// registers which are overwritten
863  /// before the next branch instruction.
864  ///
865  /// \return
866  /// A shared pointer to the newly queued thread plan, or nullptr if the
867  /// plan could not be queued.
868  virtual lldb::ThreadPlanSP QueueThreadPlanForStepOutNoShouldStop(
869  bool abort_other_plans, SymbolContext *addr_context, bool first_insn,
870  bool stop_other_threads, Vote report_stop_vote, Vote report_run_vote,
871  uint32_t frame_idx, Status &status, bool continue_to_next_branch = false);
872 
873  /// Gets the plan used to step through the code that steps from a function
874  /// call site at the current PC into the actual function call.
875  ///
876  /// \param[in] return_stack_id
877  /// The stack id that we will return to (by setting backstop breakpoints on
878  /// the return
879  /// address to that frame) if we fail to step through.
880  ///
881  /// \param[in] abort_other_plans
882  /// \b true if we discard the currently queued plans and replace them with
883  /// this one.
884  /// Otherwise this plan will go on the end of the plan stack.
885  ///
886  /// \param[in] stop_other_threads
887  /// \b true if we will stop other threads while we single step this one.
888  ///
889  /// \param[out] status
890  /// A status with an error if queuing failed.
891  ///
892  /// \return
893  /// A shared pointer to the newly queued thread plan, or nullptr if the
894  /// plan could not be queued.
895  virtual lldb::ThreadPlanSP
896  QueueThreadPlanForStepThrough(StackID &return_stack_id,
897  bool abort_other_plans, bool stop_other_threads,
898  Status &status);
899 
900  /// Gets the plan used to continue from the current PC.
901  /// This is a simple plan, mostly useful as a backstop when you are continuing
902  /// for some particular purpose.
903  ///
904  /// \param[in] abort_other_plans
905  /// \b true if we discard the currently queued plans and replace them with
906  /// this one.
907  /// Otherwise this plan will go on the end of the plan stack.
908  ///
909  /// \param[in] target_addr
910  /// The address to which we're running.
911  ///
912  /// \param[in] stop_other_threads
913  /// \b true if we will stop other threads while we single step this one.
914  ///
915  /// \param[out] status
916  /// A status with an error if queuing failed.
917  ///
918  /// \return
919  /// A shared pointer to the newly queued thread plan, or nullptr if the
920  /// plan could not be queued.
921  virtual lldb::ThreadPlanSP
922  QueueThreadPlanForRunToAddress(bool abort_other_plans, Address &target_addr,
923  bool stop_other_threads, Status &status);
924 
925  virtual lldb::ThreadPlanSP QueueThreadPlanForStepUntil(
926  bool abort_other_plans, lldb::addr_t *address_list, size_t num_addresses,
927  bool stop_others, uint32_t frame_idx, Status &status);
928 
929  virtual lldb::ThreadPlanSP
930  QueueThreadPlanForStepScripted(bool abort_other_plans, const char *class_name,
931  StructuredData::ObjectSP extra_args_sp,
932  bool stop_other_threads, Status &status);
933 
934  // Thread Plan accessors:
935 
936  /// Format the thread plan information for auto completion.
937  ///
938  /// \param[in] request
939  /// The reference to the completion handler.
940  void AutoCompleteThreadPlans(CompletionRequest &request) const;
941 
942  /// Gets the plan which will execute next on the plan stack.
943  ///
944  /// \return
945  /// A pointer to the next executed plan.
946  ThreadPlan *GetCurrentPlan() const;
947 
948  /// Unwinds the thread stack for the innermost expression plan currently
949  /// on the thread plan stack.
950  ///
951  /// \return
952  /// An error if the thread plan could not be unwound.
953 
955 
956  /// Gets the outer-most plan that was popped off the plan stack in the
957  /// most recent stop. Useful for printing the stop reason accurately.
958  ///
959  /// \return
960  /// A pointer to the last completed plan.
961  lldb::ThreadPlanSP GetCompletedPlan() const;
962 
963  /// Gets the outer-most return value from the completed plans
964  ///
965  /// \return
966  /// A ValueObjectSP, either empty if there is no return value,
967  /// or containing the return value.
968  lldb::ValueObjectSP GetReturnValueObject() const;
969 
970  /// Gets the outer-most expression variable from the completed plans
971  ///
972  /// \return
973  /// A ExpressionVariableSP, either empty if there is no
974  /// plan completed an expression during the current stop
975  /// or the expression variable that was made for the completed expression.
976  lldb::ExpressionVariableSP GetExpressionVariable() const;
977 
978  /// Checks whether the given plan is in the completed plans for this
979  /// stop.
980  ///
981  /// \param[in] plan
982  /// Pointer to the plan you're checking.
983  ///
984  /// \return
985  /// Returns true if the input plan is in the completed plan stack,
986  /// false otherwise.
987  bool IsThreadPlanDone(ThreadPlan *plan) const;
988 
989  /// Checks whether the given plan is in the discarded plans for this
990  /// stop.
991  ///
992  /// \param[in] plan
993  /// Pointer to the plan you're checking.
994  ///
995  /// \return
996  /// Returns true if the input plan is in the discarded plan stack,
997  /// false otherwise.
998  bool WasThreadPlanDiscarded(ThreadPlan *plan) const;
999 
1000  /// Check if we have completed plan to override breakpoint stop reason
1001  ///
1002  /// \return
1003  /// Returns true if completed plan stack is not empty
1004  /// false otherwise.
1005  bool CompletedPlanOverridesBreakpoint() const;
1006 
1007  /// Queues a generic thread plan.
1008  ///
1009  /// \param[in] plan_sp
1010  /// The plan to queue.
1011  ///
1012  /// \param[in] abort_other_plans
1013  /// \b true if we discard the currently queued plans and replace them with
1014  /// this one.
1015  /// Otherwise this plan will go on the end of the plan stack.
1016  ///
1017  /// \return
1018  /// A pointer to the last completed plan.
1019  Status QueueThreadPlan(lldb::ThreadPlanSP &plan_sp, bool abort_other_plans);
1020 
1021  /// Discards the plans queued on the plan stack of the current thread. This
1022  /// is
1023  /// arbitrated by the "Controlling" ThreadPlans, using the "OkayToDiscard"
1024  /// call.
1025  // But if \a force is true, all thread plans are discarded.
1026  void DiscardThreadPlans(bool force);
1027 
1028  /// Discards the plans queued on the plan stack of the current thread up to
1029  /// and
1030  /// including up_to_plan_sp.
1031  //
1032  // \param[in] up_to_plan_sp
1033  // Discard all plans up to and including this one.
1034  void DiscardThreadPlansUpToPlan(lldb::ThreadPlanSP &up_to_plan_sp);
1035 
1036  void DiscardThreadPlansUpToPlan(ThreadPlan *up_to_plan_ptr);
1037 
1038  /// Discards the plans queued on the plan stack of the current thread up to
1039  /// and
1040  /// including the plan in that matches \a thread_index counting only
1041  /// the non-Private plans.
1042  ///
1043  /// \param[in] thread_index
1044  /// Discard all plans up to and including this user plan given by this
1045  /// index.
1046  ///
1047  /// \return
1048  /// \b true if there was a thread plan with that user index, \b false
1049  /// otherwise.
1050  bool DiscardUserThreadPlansUpToIndex(uint32_t thread_index);
1051 
1052  virtual bool CheckpointThreadState(ThreadStateCheckpoint &saved_state);
1053 
1054  virtual bool
1055  RestoreRegisterStateFromCheckpoint(ThreadStateCheckpoint &saved_state);
1056 
1057  void RestoreThreadStateFromCheckpoint(ThreadStateCheckpoint &saved_state);
1058 
1059  // Get the thread index ID. The index ID that is guaranteed to not be re-used
1060  // by a process. They start at 1 and increase with each new thread. This
1061  // allows easy command line access by a unique ID that is easier to type than
1062  // the actual system thread ID.
1063  uint32_t GetIndexID() const;
1064 
1065  // Get the originating thread's index ID.
1066  // In the case of an "extended" thread -- a thread which represents the stack
1067  // that enqueued/spawned work that is currently executing -- we need to
1068  // provide the IndexID of the thread that actually did this work. We don't
1069  // want to just masquerade as that thread's IndexID by using it in our own
1070  // IndexID because that way leads to madness - but the driver program which
1071  // is iterating over extended threads may ask for the OriginatingThreadID to
1072  // display that information to the user.
1073  // Normal threads will return the same thing as GetIndexID();
1075  return GetIndexID();
1076  }
1077 
1078  // The API ID is often the same as the Thread::GetID(), but not in all cases.
1079  // Thread::GetID() is the user visible thread ID that clients would want to
1080  // see. The API thread ID is the thread ID that is used when sending data
1081  // to/from the debugging protocol.
1082  virtual lldb::user_id_t GetProtocolID() const { return GetID(); }
1083 
1084  // lldb::ExecutionContextScope pure virtual functions
1085  lldb::TargetSP CalculateTarget() override;
1086 
1087  lldb::ProcessSP CalculateProcess() override;
1088 
1089  lldb::ThreadSP CalculateThread() override;
1090 
1091  lldb::StackFrameSP CalculateStackFrame() override;
1092 
1093  void CalculateExecutionContext(ExecutionContext &exe_ctx) override;
1094 
1095  lldb::StackFrameSP
1096  GetStackFrameSPForStackFramePtr(StackFrame *stack_frame_ptr);
1097 
1098  size_t GetStatus(Stream &strm, uint32_t start_frame, uint32_t num_frames,
1099  uint32_t num_frames_with_source, bool stop_format,
1100  bool only_stacks = false);
1101 
1102  size_t GetStackFrameStatus(Stream &strm, uint32_t first_frame,
1103  uint32_t num_frames, bool show_frame_info,
1104  uint32_t num_frames_with_source);
1105 
1106  // We need a way to verify that even though we have a thread in a shared
1107  // pointer that the object itself is still valid. Currently this won't be the
1108  // case if DestroyThread() was called. DestroyThread is called when a thread
1109  // has been removed from the Process' thread list.
1110  bool IsValid() const { return !m_destroy_called; }
1111 
1112  // Sets and returns a valid stop info based on the process stop ID and the
1113  // current thread plan. If the thread stop ID does not match the process'
1114  // stop ID, the private stop reason is not set and an invalid StopInfoSP may
1115  // be returned.
1116  //
1117  // NOTE: This function must be called before the current thread plan is
1118  // moved to the completed plan stack (in Thread::ShouldStop()).
1119  //
1120  // NOTE: If subclasses override this function, ensure they do not overwrite
1121  // the m_actual_stop_info if it is valid. The stop info may be a
1122  // "checkpointed and restored" stop info, so if it is still around it is
1123  // right even if you have not calculated this yourself, or if it disagrees
1124  // with what you might have calculated.
1125  virtual lldb::StopInfoSP GetPrivateStopInfo(bool calculate = true);
1126 
1127  // Calculate the stop info that will be shown to lldb clients. For instance,
1128  // a "step out" is implemented by running to a breakpoint on the function
1129  // return PC, so the process plugin initially sets the stop info to a
1130  // StopInfoBreakpoint. But once we've run the ShouldStop machinery, we
1131  // discover that there's a completed ThreadPlanStepOut, and that's really
1132  // the StopInfo we want to show. That will happen naturally the next
1133  // time GetStopInfo is called, but if you want to force the replacement,
1134  // you can call this.
1135 
1136  void CalculatePublicStopInfo();
1137 
1138  // Ask the thread subclass to set its stop info.
1139  //
1140  // Thread subclasses should call Thread::SetStopInfo(...) with the reason the
1141  // thread stopped.
1142  //
1143  // \return
1144  // True if Thread::SetStopInfo(...) was called, false otherwise.
1145  virtual bool CalculateStopInfo() = 0;
1146 
1147  // Gets the temporary resume state for a thread.
1148  //
1149  // This value gets set in each thread by complex debugger logic in
1150  // Thread::ShouldResume() and an appropriate thread resume state will get set
1151  // in each thread every time the process is resumed prior to calling
1152  // Process::DoResume(). The lldb_private::Process subclass should adhere to
1153  // the thread resume state request which will be one of:
1154  //
1155  // eStateRunning - thread will resume when process is resumed
1156  // eStateStepping - thread should step 1 instruction and stop when process
1157  // is resumed
1158  // eStateSuspended - thread should not execute any instructions when
1159  // process is resumed
1161  return m_temporary_resume_state;
1162  }
1163 
1164  void SetStopInfo(const lldb::StopInfoSP &stop_info_sp);
1165 
1166  void ResetStopInfo();
1167 
1168  void SetShouldReportStop(Vote vote);
1169 
1170  void SetShouldRunBeforePublicStop(bool newval) {
1172  }
1173 
1176  }
1177 
1178  /// Sets the extended backtrace token for this thread
1179  ///
1180  /// Some Thread subclasses may maintain a token to help with providing
1181  /// an extended backtrace. The SystemRuntime plugin will set/request this.
1182  ///
1183  /// \param [in] token The extended backtrace token.
1184  virtual void SetExtendedBacktraceToken(uint64_t token) {}
1185 
1186  /// Gets the extended backtrace token for this thread
1187  ///
1188  /// Some Thread subclasses may maintain a token to help with providing
1189  /// an extended backtrace. The SystemRuntime plugin will set/request this.
1190  ///
1191  /// \return
1192  /// The token needed by the SystemRuntime to create an extended backtrace.
1193  /// LLDB_INVALID_ADDRESS is returned if no token is available.
1194  virtual uint64_t GetExtendedBacktraceToken() { return LLDB_INVALID_ADDRESS; }
1195 
1196  lldb::ValueObjectSP GetCurrentException();
1197 
1198  lldb::ThreadSP GetCurrentExceptionBacktrace();
1199 
1200  lldb::ValueObjectSP GetSiginfoValue();
1201 
1202 protected:
1203  friend class ThreadPlan;
1204  friend class ThreadList;
1205  friend class ThreadEventData;
1206  friend class StackFrameList;
1207  friend class StackFrame;
1208  friend class OperatingSystem;
1209 
1210  // This is necessary to make sure thread assets get destroyed while the
1211  // thread is still in good shape to call virtual thread methods. This must
1212  // be called by classes that derive from Thread in their destructor.
1213  virtual void DestroyThread();
1214 
1215  ThreadPlanStack &GetPlans() const;
1216 
1217  void PushPlan(lldb::ThreadPlanSP plan_sp);
1218 
1219  void PopPlan();
1220 
1221  void DiscardPlan();
1222 
1223  ThreadPlan *GetPreviousPlan(ThreadPlan *plan) const;
1224 
1225  virtual Unwind &GetUnwinder();
1226 
1227  // Check to see whether the thread is still at the last breakpoint hit that
1228  // stopped it.
1229  virtual bool IsStillAtLastBreakpointHit();
1230 
1231  // Some threads are threads that are made up by OperatingSystem plugins that
1232  // are threads that exist and are context switched out into memory. The
1233  // OperatingSystem plug-in need a ways to know if a thread is "real" or made
1234  // up.
1235  virtual bool IsOperatingSystemPluginThread() const { return false; }
1236 
1237  // Subclasses that have a way to get an extended info dictionary for this
1238  // thread should fill
1240  return StructuredData::ObjectSP();
1241  }
1242 
1243  lldb::StackFrameListSP GetStackFrameList();
1244 
1246  m_temporary_resume_state = new_state;
1247  }
1248 
1250 
1251  virtual llvm::Expected<std::unique_ptr<llvm::MemoryBuffer>>
1252  GetSiginfo(size_t max_size) const {
1253  return llvm::make_error<UnimplementedError>();
1254  }
1255 
1256  // Classes that inherit from Process can see and modify these
1257  lldb::ProcessWP m_process_wp; ///< The process that owns this thread.
1258  lldb::StopInfoSP m_stop_info_sp; ///< The private stop reason for this thread
1259  uint32_t m_stop_info_stop_id; // This is the stop id for which the StopInfo is
1260  // valid. Can use this so you know that
1261  // the thread's m_stop_info_sp is current and you don't have to fetch it
1262  // again
1263  uint32_t m_stop_info_override_stop_id; // The stop ID containing the last time
1264  // the stop info was checked against
1265  // the stop info override
1266  bool m_should_run_before_public_stop; // If this thread has "stop others"
1267  // private work to do, then it will
1268  // set this.
1269  const uint32_t m_index_id; ///< A unique 1 based index assigned to each thread
1270  /// for easy UI/command line access.
1271  lldb::RegisterContextSP m_reg_context_sp; ///< The register context for this
1272  ///thread's current register state.
1273  lldb::StateType m_state; ///< The state of our process.
1274  mutable std::recursive_mutex
1275  m_state_mutex; ///< Multithreaded protection for m_state.
1276  mutable std::recursive_mutex
1277  m_frame_mutex; ///< Multithreaded protection for m_state.
1278  lldb::StackFrameListSP m_curr_frames_sp; ///< The stack frames that get lazily
1279  ///populated after a thread stops.
1280  lldb::StackFrameListSP m_prev_frames_sp; ///< The previous stack frames from
1281  ///the last time this thread stopped.
1282  int m_resume_signal; ///< The signal that should be used when continuing this
1283  ///thread.
1284  lldb::StateType m_resume_state; ///< This state is used to force a thread to
1285  ///be suspended from outside the ThreadPlan
1286  ///logic.
1287  lldb::StateType m_temporary_resume_state; ///< This state records what the
1288  ///thread was told to do by the
1289  ///thread plan logic for the current
1290  ///resume.
1291  /// It gets set in Thread::ShouldResume.
1292  std::unique_ptr<lldb_private::Unwind> m_unwinder_up;
1293  bool m_destroy_called; // This is used internally to make sure derived Thread
1294  // classes call DestroyThread.
1296  mutable std::unique_ptr<ThreadPlanStack> m_null_plan_stack_up;
1297 
1298 private:
1299  bool m_extended_info_fetched; // Have we tried to retrieve the m_extended_info
1300  // for this thread?
1301  StructuredData::ObjectSP m_extended_info; // The extended info for this thread
1302 
1303  void BroadcastSelectedFrameChange(StackID &new_frame_id);
1304 
1305  Thread(const Thread &) = delete;
1306  const Thread &operator=(const Thread &) = delete;
1307 };
1308 
1309 } // namespace lldb_private
1310 
1311 #endif // LLDB_TARGET_THREAD_H
lldb_private::Thread::m_temporary_resume_state
lldb::StateType m_temporary_resume_state
This state records what the thread was told to do by the thread plan logic for the current resume.
Definition: Thread.h:1287
lldb_private::ThreadProperties
Definition: Thread.h:35
lldb_private::Thread::GetStackFrameSPForStackFramePtr
lldb::StackFrameSP GetStackFrameSPForStackFramePtr(StackFrame *stack_frame_ptr)
Definition: Thread.cpp:1675
lldb_private::Thread::DiscardThreadPlans
void DiscardThreadPlans(bool force)
Discards the plans queued on the plan stack of the current thread.
Definition: Thread.cpp:1226
lldb_private::Thread::eBroadcastBitThreadResumed
@ eBroadcastBitThreadResumed
Definition: Thread.h:71
lldb_private::Thread::ThreadHasQueueInformation
virtual bool ThreadHasQueueInformation() const
Whether this Thread already has all the Queue information cached or not.
Definition: Thread.h:393
lldb_private::Thread::m_state_mutex
std::recursive_mutex m_state_mutex
Multithreaded protection for m_state.
Definition: Thread.h:1275
lldb_private::ExecutionContext
Definition: ExecutionContext.h:292
lldb_private::Thread::DidResume
virtual void DidResume()
Definition: Thread.cpp:736
lldb_private::Thread::GetPrivateStopInfo
virtual lldb::StopInfoSP GetPrivateStopInfo(bool calculate=true)
Definition: Thread.cpp:373
lldb_private::Thread::GetCurrentInlinedDepth
uint32_t GetCurrentInlinedDepth()
Definition: Thread.h:410
lldb_private::Thread::GetStackFrameStatus
size_t GetStackFrameStatus(Stream &strm, uint32_t first_frame, uint32_t num_frames, bool show_frame_info, uint32_t num_frames_with_source)
Definition: Thread.cpp:1870
lldb_private::Thread::StopInfoIsUpToDate
bool StopInfoIsUpToDate() const
Definition: Thread.cpp:430
lldb_private::RegularExpression
Definition: RegularExpression.h:18
lldb_private::Thread::SetResumeState
void SetResumeState(lldb::StateType state, bool override_suspend=false)
Sets the USER resume state for this thread.
Definition: Thread.h:183
lldb_private::Thread::AutoCompleteThreadPlans
void AutoCompleteThreadPlans(CompletionRequest &request) const
Format the thread plan information for auto completion.
Definition: Thread.cpp:1123
lldb_private::Thread::ThreadStateCheckpoint::stop_info_sp
lldb::StopInfoSP stop_info_sp
Definition: Thread.h:123
lldb_private::ThreadProperties::GetTraceEnabledState
bool GetTraceEnabledState() const
Definition: Thread.cpp:126
lldb_private::Thread::GetResumeSignal
int GetResumeSignal() const
Definition: Thread.h:155
lldb_private::Thread::ThreadStateCheckpoint::orig_stop_id
uint32_t orig_stop_id
Definition: Thread.h:121
lldb_private::Thread::GetIndexID
uint32_t GetIndexID() const
Definition: Thread.cpp:1403
lldb_private::Event
Definition: Event.h:182
lldb_private::Thread::GetDescription
bool GetDescription(Stream &s, lldb::DescriptionLevel level, bool print_json_thread, bool print_json_stopinfo)
Definition: Thread.cpp:1782
lldb_private::Thread::GetFrameWithStackID
virtual lldb::StackFrameSP GetFrameWithStackID(const StackID &stack_id)
Definition: Thread.h:425
lldb_private::Thread::SetupForResume
void SetupForResume()
Definition: Thread.cpp:629
lldb_private::Thread::Flush
void Flush()
Definition: Thread.cpp:1883
lldb_private::Thread::m_resume_signal
int m_resume_signal
The signal that should be used when continuing this thread.
Definition: Thread.h:1282
StructuredData.h
lldb_private::Thread::ThreadStateCheckpoint::register_backup_sp
lldb::RegisterCheckpointSP register_backup_sp
Definition: Thread.h:127
lldb_private::Thread::GetUnwinder
virtual Unwind & GetUnwinder()
Definition: Thread.cpp:1877
lldb_private::Thread::GetSiginfo
virtual llvm::Expected< std::unique_ptr< llvm::MemoryBuffer > > GetSiginfo(size_t max_size) const
Definition: Thread.h:1252
lldb_private::Thread::ClearStackFrames
virtual void ClearStackFrames()
Definition: Thread.cpp:1433
lldb_private::Thread::QueueThreadPlanForStepOverRange
virtual lldb::ThreadPlanSP QueueThreadPlanForStepOverRange(bool abort_other_plans, const AddressRange &range, const SymbolContext &addr_context, lldb::RunMode stop_other_threads, Status &status, LazyBool step_out_avoids_code_without_debug_info=eLazyBoolCalculate)
Queues the plan used to step through an address range, stepping over function calls.
Definition: Thread.cpp:1268
lldb_private::Thread::ThreadEventData::GetStackIDFromEvent
static StackID GetStackIDFromEvent(const Event *event_ptr)
Definition: Thread.cpp:189
lldb_private::Thread::GetQueueLibdispatchQueueAddress
virtual lldb::addr_t GetQueueLibdispatchQueueAddress()
Retrieve the address of the libdispatch_queue_t struct for queue currently using this Thread.
Definition: Thread.h:375
lldb_private::Thread::JumpToLine
Status JumpToLine(const FileSpec &file, uint32_t line, bool can_leave_function, std::string *warnings=nullptr)
Definition: Thread.cpp:1559
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:1338
lldb_private::Thread::ClearBackingThread
virtual void ClearBackingThread()
Definition: Thread.h:462
lldb_private::UserID
Definition: UserID.h:31
lldb_private::Thread::GetExtendedBacktraceToken
virtual uint64_t GetExtendedBacktraceToken()
Gets the extended backtrace token for this thread.
Definition: Thread.h:1194
lldb_private::Thread::GetQueueID
virtual lldb::queue_id_t GetQueueID()
Retrieve the Queue ID for the queue currently using this Thread.
Definition: Thread.h:321
lldb_private::Thread::QueueThreadPlanForStepOut
virtual lldb::ThreadPlanSP QueueThreadPlanForStepOut(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, LazyBool step_out_avoids_code_without_debug_info=eLazyBoolCalculate)
Queue the plan used to step out of the function at the current PC of thread.
Definition: Thread.cpp:1325
lldb_private::Process
Definition: Process.h:338
lldb_private::Thread::GetSelectedFrameIndex
uint32_t GetSelectedFrameIndex()
Definition: Thread.h:431
lldb_private::EventData
Definition: Event.h:36
lldb_private::Thread::CalculateTarget
lldb::TargetSP CalculateTarget() override
Definition: Thread.cpp:1405
lldb_private::Thread::ResetStopInfo
void ResetStopInfo()
Definition: Thread.cpp:439
lldb_private::Thread::operator=
const Thread & operator=(const Thread &)=delete
lldb_private::Thread::GetStopDescription
std::string GetStopDescription()
Definition: Thread.cpp:558
lldb_private::Thread::m_destroy_called
bool m_destroy_called
Definition: Thread.h:1293
lldb_private::Thread::DecrementCurrentInlinedDepth
bool DecrementCurrentInlinedDepth()
Definition: Thread.h:406
lldb_private::Thread::UnwindInnermostExpression
Status UnwindInnermostExpression()
Unwinds the thread stack for the innermost expression plan currently on the thread plan stack.
Definition: Thread.cpp:1242
lldb_private::Thread::DiscardUserThreadPlansUpToIndex
bool DiscardUserThreadPlansUpToIndex(uint32_t thread_index)
Discards the plans queued on the plan stack of the current thread up to and including the plan in tha...
Definition: Thread.cpp:1201
lldb::StopReason
StopReason
Thread stop reasons.
Definition: lldb-enumerations.h:239
lldb_private::Thread::GetPreviousPlan
ThreadPlan * GetPreviousPlan(ThreadPlan *plan) const
Definition: Thread.cpp:1167
lldb_private::Thread::SelectMostRelevantFrame
void SelectMostRelevantFrame()
Definition: Thread.cpp:590
lldb_private::Thread::GetPlans
ThreadPlanStack & GetPlans() const
Definition: Thread.cpp:1074
lldb_private::Thread::ThreadEventData::Dump
void Dump(Stream *s) const override
Definition: Thread.cpp:168
lldb_private::Thread::GetCurrentPlan
ThreadPlan * GetCurrentPlan() const
Gets the plan which will execute next on the plan stack.
Definition: Thread.cpp:1139
lldb_private::Thread::m_null_plan_stack_up
std::unique_ptr< ThreadPlanStack > m_null_plan_stack_up
Definition: Thread.h:1296
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:536
lldb_private::Thread::RestoreRegisterStateFromCheckpoint
virtual bool RestoreRegisterStateFromCheckpoint(ThreadStateCheckpoint &saved_state)
Definition: Thread.cpp:514
lldb_private::Thread::ReturnFromFrameWithIndex
Status ReturnFromFrameWithIndex(uint32_t frame_idx, lldb::ValueObjectSP return_value_sp, bool broadcast=false)
Definition: Thread.cpp:1455
lldb_private::Thread::CompletedPlanOverridesBreakpoint
bool CompletedPlanOverridesBreakpoint() const
Check if we have completed plan to override breakpoint stop reason.
Definition: Thread.cpp:1163
lldb_private::LazyBool
LazyBool
Definition: lldb-private-enumerations.h:115
lldb_private::Thread::SetDefaultFileAndLineToSelectedFrame
void SetDefaultFileAndLineToSelectedFrame()
Definition: Thread.h:445
lldb_private::Thread::GetStopReason
lldb::StopReason GetStopReason()
Definition: Thread.cpp:423
lldb_private::Thread::m_curr_frames_sp
lldb::StackFrameListSP m_curr_frames_sp
The stack frames that get lazily populated after a thread stops.
Definition: Thread.h:1278
lldb_private::Thread::SetName
virtual void SetName(const char *name)
Definition: Thread.h:283
lldb_private::SymbolContext
Definition: SymbolContext.h:33
CompletionRequest.h
lldb_private::Thread::SetQueueLibdispatchQueueAddress
virtual void SetQueueLibdispatchQueueAddress(lldb::addr_t dispatch_queue_t)
Definition: Thread.h:379
lldb_private::Thread::ShouldStop
bool ShouldStop(Event *event_ptr)
Definition: Thread.cpp:744
lldb_private::Thread::GetProtocolID
virtual lldb::user_id_t GetProtocolID() const
Definition: Thread.h:1082
lldb_private::Thread::GetResumeState
lldb::StateType GetResumeState() const
Gets the USER resume state for this thread.
Definition: Thread.h:197
lldb_private::Thread::SafeToCallFunctions
virtual bool SafeToCallFunctions()
Check whether this thread is safe to run functions.
Definition: Thread.cpp:1663
lldb_private::Thread::RunModeAsString
static std::string RunModeAsString(lldb::RunMode mode)
Definition: Thread.cpp:1716
lldb_private::Thread::GetQueue
virtual lldb::QueueSP GetQueue()
Retrieve the Queue for this thread, if any.
Definition: Thread.h:359
lldb_private::Thread::FrameSelectedCallback
void FrameSelectedCallback(lldb_private::StackFrame *frame)
Definition: Thread.cpp:321
lldb_private::Thread::GetState
lldb::StateType GetState() const
Definition: Thread.cpp:547
lldb_private::Thread::ThreadEventData::~ThreadEventData
~ThreadEventData() override
lldb_private::Thread::eBroadcastBitStackChanged
@ eBroadcastBitStackChanged
Definition: Thread.h:69
lldb_private::Thread::GetCompletedPlan
lldb::ThreadPlanSP GetCompletedPlan() const
Gets the outer-most plan that was popped off the plan stack in the most recent stop.
Definition: Thread.cpp:1143
Broadcaster.h
lldb_private::Thread::GetName
virtual const char * GetName()
Definition: Thread.h:281
lldb_private::Thread::CheckpointThreadState
virtual bool CheckpointThreadState(ThreadStateCheckpoint &saved_state)
Definition: Thread.cpp:488
lldb_private::Thread::IsThreadPlanDone
bool IsThreadPlanDone(ThreadPlan *plan) const
Checks whether the given plan is in the completed plans for this stop.
Definition: Thread.cpp:1155
lldb_private::Thread::CalculateStopInfo
virtual bool CalculateStopInfo()=0
lldb_private::Thread::BroadcastSelectedFrameChange
void BroadcastSelectedFrameChange(StackID &new_frame_id)
Definition: Thread.cpp:260
lldb_private::Thread::SettingsTerminate
static void SettingsTerminate()
Definition: Thread.cpp:1647
lldb_private::Thread::DiscardPlan
void DiscardPlan()
Definition: Thread.cpp:1114
lldb_private::Properties
Definition: UserSettingsController.h:33
lldb::queue_id_t
uint64_t queue_id_t
Definition: lldb-types.h:91
lldb_private::StackFrameList
Definition: StackFrameList.h:22
lldb_private::Thread::GetProcess
lldb::ProcessSP GetProcess() const
Definition: Thread.h:153
lldb_private::Thread::SetTemporaryResumeState
void SetTemporaryResumeState(lldb::StateType new_state)
Definition: Thread.h:1245
lldb_private::Thread::ThreadEventData::GetThreadFromEvent
static lldb::ThreadSP GetThreadFromEvent(const Event *event_ptr)
Definition: Thread.cpp:181
lldb_private::FileSpec
Definition: FileSpec.h:55
lldb_private::Thread::StepIn
virtual Status StepIn(bool source_step, LazyBool step_in_avoids_code_without_debug_info=eLazyBoolCalculate, LazyBool step_out_avoids_code_without_debug_info=eLazyBoolCalculate)
Default implementation for stepping into.
Definition: Thread.cpp:1909
lldb_private::Thread::ThreadEventData
Definition: Thread.h:82
lldb_private::Thread::DestroyThread
virtual void DestroyThread()
Definition: Thread.cpp:250
lldb_private::ThreadProperties::GetStepInAvoidsNoDebug
bool GetStepInAvoidsNoDebug() const
Definition: Thread.cpp:132
lldb_private::Thread::CalculateProcess
lldb::ProcessSP CalculateProcess() override
Definition: Thread.cpp:1413
lldb_private::ThreadPlan
Definition: ThreadPlan.h:287
lldb_private::Thread::GetBroadcasterClass
ConstString & GetBroadcasterClass() const override
This needs to be filled in if you are going to register the broadcaster with the broadcaster manager ...
Definition: Thread.h:78
lldb_private::Thread::m_state
lldb::StateType m_state
The state of our process.
Definition: Thread.h:1273
lldb_private::Thread::ReturnFromFrame
Status ReturnFromFrame(lldb::StackFrameSP frame_sp, lldb::ValueObjectSP return_value_sp, bool broadcast=false)
Definition: Thread.cpp:1470
lldb_private::Thread::ThreadEventData::GetStackFrameFromEvent
static lldb::StackFrameSP GetStackFrameFromEvent(const Event *event_ptr)
Definition: Thread.cpp:198
lldb_private::Thread::eBroadcastBitThreadSuspended
@ eBroadcastBitThreadSuspended
Definition: Thread.h:70
lldb_private::ExecutionContextScope
Definition: ExecutionContextScope.h:32
lldb_private::ThreadProperties::ThreadProperties
ThreadProperties(bool is_global)
Definition: Thread.cpp:100
lldb_private::Thread::RefreshStateAfterStop
virtual void RefreshStateAfterStop()=0
UnimplementedError.h
lldb_private::Thread
Definition: Thread.h:61
lldb_private::Thread::CreateRegisterContextForFrame
virtual lldb::RegisterContextSP CreateRegisterContextForFrame(StackFrame *frame)=0
lldb_private::Thread::FetchThreadExtendedInfo
virtual lldb_private::StructuredData::ObjectSP FetchThreadExtendedInfo()
Definition: Thread.h:1239
lldb_private::Thread::ShouldRunBeforePublicStop
bool ShouldRunBeforePublicStop()
Definition: Thread.h:1174
lldb_private::Thread::SetQueueKind
virtual void SetQueueKind(lldb::QueueKind kind)
Definition: Thread.h:349
StackFrameList.h
lldb_private::StructuredData::ObjectSP
std::shared_ptr< Object > ObjectSP
Definition: StructuredData.h:59
lldb_private::Thread::GetExpressionVariable
lldb::ExpressionVariableSP GetExpressionVariable() const
Gets the outer-most expression variable from the completed plans.
Definition: Thread.cpp:1151
lldb_private::Thread::SetAssociatedWithLibdispatchQueue
virtual void SetAssociatedWithLibdispatchQueue(lldb_private::LazyBool associated_with_libdispatch_queue)
Definition: Thread.h:305
lldb_private::ThreadList
Definition: ThreadList.h:26
lldb_private::Thread::ThreadEventData::GetFlavorString
static ConstString GetFlavorString()
Definition: Thread.cpp:152
lldb_private::ConstString
Definition: ConstString.h:39
lldb_private::Thread::m_prev_frames_sp
lldb::StackFrameListSP m_prev_frames_sp
The previous stack frames from the last time this thread stopped.
Definition: Thread.h:1280
lldb_private::Thread::GetTemporaryResumeState
lldb::StateType GetTemporaryResumeState() const
Definition: Thread.h:1160
lldb_private::Thread::QueueThreadPlanForStepThrough
virtual lldb::ThreadPlanSP QueueThreadPlanForStepThrough(StackID &return_stack_id, bool abort_other_plans, bool stop_other_threads, Status &status)
Gets the plan used to step through the code that steps from a function call site at the current PC in...
Definition: Thread.cpp:1357
lldb::eQueueKindUnknown
@ eQueueKindUnknown
Definition: lldb-enumerations.h:961
lldb_private::Thread::StepOut
virtual Status StepOut(uint32_t frame_idx=0)
Default implementation for stepping out.
Definition: Thread.cpp:1978
lldb_private::Thread::SetStopInfo
void SetStopInfo(const lldb::StopInfoSP &stop_info_sp)
Definition: Thread.cpp:445
lldb_private::Thread::SetStopInfoToNothing
void SetStopInfoToNothing()
Definition: Thread.cpp:478
lldb_private::AddressRange
Definition: AddressRange.h:25
lldb_private::Thread::QueueThreadPlanForStepInRange
virtual lldb::ThreadPlanSP QueueThreadPlanForStepInRange(bool abort_other_plans, const AddressRange &range, const SymbolContext &addr_context, const char *step_in_target, lldb::RunMode stop_other_threads, Status &status, LazyBool step_in_avoids_code_without_debug_info=eLazyBoolCalculate, LazyBool step_out_avoids_code_without_debug_info=eLazyBoolCalculate)
Queues the plan used to step through an address range, stepping into functions.
Definition: Thread.cpp:1295
lldb_private::Thread::GetBackingThread
virtual lldb::ThreadSP GetBackingThread() const
Definition: Thread.h:460
lldb_private::OperatingSystem
Definition: OperatingSystem.h:27
lldb_private::Thread::GetCurrentExceptionBacktrace
lldb::ThreadSP GetCurrentExceptionBacktrace()
Definition: Thread.cpp:2018
lldb_private::Thread::GetStackFrameCount
virtual uint32_t GetStackFrameCount()
Definition: Thread.h:395
lldb_private::ThreadProperties::GetSymbolsToAvoidRegexp
const RegularExpression * GetSymbolsToAvoidRegexp()
The regular expression returned determines symbols that this thread won't stop in during "step-in" op...
Definition: Thread.cpp:112
lldb_private::Thread::DumpTraceInstructions
void DumpTraceInstructions(Stream &s, size_t count, size_t start_position=0) const
Dump count instructions of the thread's Trace starting at the start_position position in reverse orde...
lldb_private::Thread::m_stop_info_override_stop_id
uint32_t m_stop_info_override_stop_id
Definition: Thread.h:1263
lldb_private::Thread::GetCurrentException
lldb::ValueObjectSP GetCurrentException()
Definition: Thread.cpp:2002
lldb_private::Thread::ShouldReportStop
Vote ShouldReportStop(Event *event_ptr)
Definition: Thread.cpp:978
lldb_private::Thread::GetExtendedInfo
StructuredData::ObjectSP GetExtendedInfo()
Retrieve a dictionary of information about this thread.
Definition: Thread.h:273
lldb_private::ThreadProperties::GetMaxBacktraceDepth
uint64_t GetMaxBacktraceDepth() const
Definition: Thread.cpp:144
lldb_private::Thread::CalculatePublicStopInfo
void CalculatePublicStopInfo()
Definition: Thread.cpp:368
lldb_private::Thread::ShouldResume
bool ShouldResume(lldb::StateType resume_state)
Definition: Thread.cpp:674
lldb_private::Thread::SetState
void SetState(lldb::StateType state)
Definition: Thread.cpp:553
string
string(SUBSTRING ${p} 10 -1 pStripped) if($
Definition: Plugins/CMakeLists.txt:40
lldb_private::Thread::ThreadStateCheckpoint::current_inlined_pc
lldb::addr_t current_inlined_pc
Definition: Thread.h:129
lldb_private::Thread::m_unwinder_up
std::unique_ptr< lldb_private::Unwind > m_unwinder_up
It gets set in Thread::ShouldResume.
Definition: Thread.h:1292
lldb_private::Thread::WillResume
virtual void WillResume(lldb::StateType resume_state)
Definition: Thread.h:209
lldb_private::Thread::SetSelectedFrame
uint32_t SetSelectedFrame(lldb_private::StackFrame *frame, bool broadcast=false)
Definition: Thread.cpp:274
LLDB_INVALID_QUEUE_ID
#define LLDB_INVALID_QUEUE_ID
Definition: lldb-defines.h:88
lldb_private::Thread::ThreadEventData::GetFlavor
ConstString GetFlavor() const override
Definition: Thread.h:94
lldb_private::ThreadProperties::GetStepOutAvoidsNoDebug
bool GetStepOutAvoidsNoDebug() const
Definition: Thread.cpp:138
lldb_private::Thread::ThreadStateCheckpoint::current_inlined_depth
uint32_t current_inlined_depth
Definition: Thread.h:128
lldb_private::Thread::m_stop_info_stop_id
uint32_t m_stop_info_stop_id
Definition: Thread.h:1259
lldb_private::Thread::m_should_run_before_public_stop
bool m_should_run_before_public_stop
Definition: Thread.h:1266
lldb_private::Thread::GetThreadPointer
virtual lldb::addr_t GetThreadPointer()
Retrieves the per-thread data area.
Definition: Thread.cpp:1649
lldb_private::ThreadSpec
Definition: ThreadSpec.h:33
lldb_private::Thread::SetSelectedFrameByIndexNoisily
bool SetSelectedFrameByIndexNoisily(uint32_t frame_idx, Stream &output_stream)
Definition: Thread.cpp:295
Event.h
UserID.h
lldb_private::Thread::GetFrameWithConcreteFrameIndex
virtual lldb::StackFrameSP GetFrameWithConcreteFrameIndex(uint32_t unwind_idx)
Definition: Thread.cpp:1451
lldb::RunMode
RunMode
Thread Run Modes.
Definition: lldb-enumerations.h:135
lldb_private::UserID::GetID
lldb::user_id_t GetID() const
Get accessor for the user ID.
Definition: UserID.h:47
lldb_private::Thread::ThreadEventData::GetThread
lldb::ThreadSP GetThread() const
Definition: Thread.h:108
lldb_private::Thread::CalculateExecutionContext
void CalculateExecutionContext(ExecutionContext &exe_ctx) override
Reconstruct the object's execution context into sc.
Definition: Thread.cpp:1419
lldb-private.h
lldb_private::Thread::ThreadEventData::m_stack_id
StackID m_stack_id
Definition: Thread.h:114
lldb_private::Thread::m_stop_info_sp
lldb::StopInfoSP m_stop_info_sp
The private stop reason for this thread.
Definition: Thread.h:1258
lldb_private::Thread::SettingsInitialize
static void SettingsInitialize()
Definition: Thread.cpp:1645
lldb_private::Thread::GetAssociatedWithLibdispatchQueue
virtual lldb_private::LazyBool GetAssociatedWithLibdispatchQueue()
Whether this thread can be associated with a libdispatch queue.
Definition: Thread.h:301
lldb_private::Thread::QueueBasePlan
lldb::ThreadPlanSP QueueBasePlan(bool abort_other_plans)
Queues the base plan for a thread.
Definition: Thread.cpp:1253
lldb_private::Thread::CalculateThread
lldb::ThreadSP CalculateThread() override
Definition: Thread.cpp:1415
lldb_private::Thread::GetStatus
size_t GetStatus(Stream &strm, uint32_t start_frame, uint32_t num_frames, uint32_t num_frames_with_source, bool stop_format, bool only_stacks=false)
Definition: Thread.cpp:1729
lldb_private::Thread::GetInfo
virtual const char * GetInfo()
Definition: Thread.h:261
lldb_private::Thread::IsStillAtLastBreakpointHit
virtual bool IsStillAtLastBreakpointHit()
Definition: Thread.cpp:1888
lldb_private::Thread::DiscardThreadPlansUpToPlan
void DiscardThreadPlansUpToPlan(lldb::ThreadPlanSP &up_to_plan_sp)
Discards the plans queued on the plan stack of the current thread up to and including up_to_plan_sp.
Definition: Thread.cpp:1213
lldb::eStateSuspended
@ eStateSuspended
Process or thread is in a suspended state as far as the debugger is concerned while other processes o...
Definition: lldb-enumerations.h:91
lldb_private::Thread::GetStopInfo
lldb::StopInfoSP GetStopInfo()
Definition: Thread.cpp:335
lldb_private::Thread::ShouldReportRun
Vote ShouldReportRun(Event *event_ptr)
Definition: Thread.cpp:1039
lldb_private::Thread::PopPlan
void PopPlan()
Definition: Thread.cpp:1105
lldb_private::Thread::GetStackFrameList
lldb::StackFrameListSP GetStackFrameList()
Definition: Thread.cpp:1423
lldb_private::Status
Definition: Status.h:44
lldb_private::Thread::m_process_wp
lldb::ProcessWP m_process_wp
The process that owns this thread.
Definition: Thread.h:1257
lldb_private::Thread::SetShouldRunBeforePublicStop
void SetShouldRunBeforePublicStop(bool newval)
Definition: Thread.h:1170
lldb_private::Thread::m_reg_context_sp
lldb::RegisterContextSP m_reg_context_sp
The register context for this thread's current register state.
Definition: Thread.h:1271
lldb_private::Thread::m_frame_mutex
std::recursive_mutex m_frame_mutex
Multithreaded protection for m_state.
Definition: Thread.h:1277
lldb_private::Thread::PushPlan
void PushPlan(lldb::ThreadPlanSP plan_sp)
Definition: Thread.cpp:1090
uint32_t
lldb_private::eLazyBoolNo
@ eLazyBoolNo
Definition: lldb-private-enumerations.h:115
lldb_private::Thread::~Thread
~Thread() override
Definition: Thread.cpp:241
UserSettingsController.h
lldb_private::Thread::eBroadcastBitThreadSelected
@ eBroadcastBitThreadSelected
Definition: Thread.h:73
RegisterCheckpoint.h
lldb_private::Thread::GetStaticBroadcasterClass
static ConstString & GetStaticBroadcasterClass()
Definition: Thread.cpp:213
lldb_private::Address
Definition: Address.h:59
lldb_private::Thread::DidStop
virtual void DidStop()
Definition: Thread.cpp:742
lldb_private::Thread::QueueThreadPlan
Status QueueThreadPlan(lldb::ThreadPlanSP &plan_sp, bool abort_other_plans)
Queues a generic thread plan.
Definition: Thread.cpp:1171
lldb_private::Thread::ThreadEventData::GetStackID
StackID GetStackID() const
Definition: Thread.h:110
ExecutionContextScope.h
lldb_private::Thread::IsOperatingSystemPluginThread
virtual bool IsOperatingSystemPluginThread() const
Definition: Thread.h:1235
lldb_private::Thread::GetReturnValueObject
lldb::ValueObjectSP GetReturnValueObject() const
Gets the outer-most return value from the completed plans.
Definition: Thread.cpp:1147
lldb_private::Thread::QueueThreadPlanForRunToAddress
virtual lldb::ThreadPlanSP QueueThreadPlanForRunToAddress(bool abort_other_plans, Address &target_addr, bool stop_other_threads, Status &status)
Gets the plan used to continue from the current PC.
Definition: Thread.cpp:1370
lldb_private::Thread::QueueThreadPlanForStepUntil
virtual lldb::ThreadPlanSP QueueThreadPlanForStepUntil(bool abort_other_plans, lldb::addr_t *address_list, size_t num_addresses, bool stop_others, uint32_t frame_idx, Status &status)
Definition: Thread.cpp:1381
lldb_private::Thread::GetSelectedFrame
lldb::StackFrameSP GetSelectedFrame()
Definition: Thread.cpp:266
lldb_private::ThreadProperties::~ThreadProperties
~ThreadProperties() override
lldb_private::Vote
Vote
Definition: lldb-private-enumerations.h:59
lldb_private::Thread::ThreadStateCheckpoint
Definition: Thread.h:120
LLDB_INVALID_ADDRESS
#define LLDB_INVALID_ADDRESS
Definition: lldb-defines.h:74
lldb_private::Thread::MatchesSpec
virtual bool MatchesSpec(const ThreadSpec *spec)
Definition: Thread.cpp:1070
lldb_private::Thread::WasThreadPlanDiscarded
bool WasThreadPlanDiscarded(ThreadPlan *plan) const
Checks whether the given plan is in the discarded plans for this stop.
Definition: Thread.cpp:1159
lldb_private::Thread::GetThreadLocalData
virtual lldb::addr_t GetThreadLocalData(const lldb::ModuleSP module, lldb::addr_t tls_file_addr)
Retrieves the per-module TLS block for a thread.
Definition: Thread.cpp:1651
lldb_private::ThreadPlanStack
Definition: ThreadPlanStack.h:31
lldb::user_id_t
uint64_t user_id_t
Definition: lldb-types.h:84
lldb_private::Thread::m_override_should_notify
LazyBool m_override_should_notify
Definition: Thread.h:1295
lldb_private
A class that represents a running process on the host machine.
Definition: SBCommandInterpreterRunOptions.h:16
lldb_private::eLazyBoolCalculate
@ eLazyBoolCalculate
Definition: lldb-private-enumerations.h:115
lldb_private::Thread::Thread
Thread(Process &process, lldb::tid_t tid, bool use_invalid_index_id=false)
Constructor.
Definition: Thread.cpp:218
lldb_private::Thread::eBroadcastBitSelectedFrameChanged
@ eBroadcastBitSelectedFrameChanged
Definition: Thread.h:72
lldb_private::Thread::ThreadStoppedForAReason
bool ThreadStoppedForAReason()
Definition: Thread.cpp:486
lldb_private::Thread::IsValid
bool IsValid() const
Definition: Thread.h:1110
lldb_private::StackID::IsValid
bool IsValid() const
Definition: StackID.h:47
lldb_private::Thread::ThreadEventData::m_thread_sp
lldb::ThreadSP m_thread_sp
Definition: Thread.h:113
lldb_private::Thread::ThreadStateCheckpoint::m_completed_plan_checkpoint
size_t m_completed_plan_checkpoint
Definition: Thread.h:125
lldb_private::Thread::GetQueueKind
virtual lldb::QueueKind GetQueueKind()
Retrieve the Queue kind for the queue currently using this Thread.
Definition: Thread.h:347
lldb_private::Thread::QueueThreadPlanForStepScripted
virtual lldb::ThreadPlanSP QueueThreadPlanForStepScripted(bool abort_other_plans, const char *class_name, StructuredData::ObjectSP extra_args_sp, bool stop_other_threads, Status &status)
Definition: Thread.cpp:1391
lldb_private::StackID
Definition: StackID.h:17
lldb_private::Thread::GetSiginfoValue
lldb::ValueObjectSP GetSiginfoValue()
Definition: Thread.cpp:2033
lldb_private::Thread::SetQueueID
virtual void SetQueueID(lldb::queue_id_t new_val)
Definition: Thread.h:323
lldb_private::Thread::SetBackingThread
virtual bool SetBackingThread(const lldb::ThreadSP &thread_sp)
Definition: Thread.h:456
lldb::StateType
StateType
Process and Thread States.
Definition: lldb-enumerations.h:73
lldb_private::Thread::StopReasonAsString
static std::string StopReasonAsString(lldb::StopReason reason)
Definition: Thread.cpp:1679
lldb_private::Thread::WillStop
void WillStop()
Definition: Thread.cpp:615
lldb_private::Thread::m_resume_state
lldb::StateType m_resume_state
This state is used to force a thread to be suspended from outside the ThreadPlan logic.
Definition: Thread.h:1284
lldb_private::Thread::GetStackFrameAtIndex
virtual lldb::StackFrameSP GetStackFrameAtIndex(uint32_t idx)
Definition: Thread.h:399
lldb_private::Thread::QueueThreadPlanForStepSingleInstruction
virtual lldb::ThreadPlanSP QueueThreadPlanForStepSingleInstruction(bool step_over, bool abort_other_plans, bool stop_other_threads, Status &status)
Queues the plan used to step one instruction from the current PC of thread.
Definition: Thread.cpp:1259
lldb_private::Thread::ThreadEventData::operator=
const ThreadEventData & operator=(const ThreadEventData &)=delete
lldb_private::Thread::GetRegisterContext
virtual lldb::RegisterContextSP GetRegisterContext()=0
lldb_private::Broadcaster
Definition: Broadcaster.h:242
lldb_private::StackFrame
Definition: StackFrame.h:40
lldb_private::Unwind
Definition: Unwind.h:18
lldb_private::Thread::SetResumeSignal
void SetResumeSignal(int signal)
Definition: Thread.h:157
lldb_private::Thread::StepOver
virtual Status StepOver(bool source_step, LazyBool step_out_avoids_code_without_debug_info=eLazyBoolCalculate)
Default implementation for stepping over.
Definition: Thread.cpp:1945
lldb_private::Thread::ThreadEventData::ThreadEventData
ThreadEventData()
Definition: Thread.cpp:164
lldb::QueueKind
QueueKind
Queue type.
Definition: lldb-enumerations.h:960
lldb_private::Thread::m_extended_info_fetched
bool m_extended_info_fetched
Definition: Thread.h:1299
lldb_private::Thread::m_index_id
const uint32_t m_index_id
A unique 1 based index assigned to each thread for easy UI/command line access.
Definition: Thread.h:1269
lldb_private::LineEntry
Definition: LineEntry.h:20
lldb_private::Thread::SetExtendedBacktraceToken
virtual void SetExtendedBacktraceToken(uint64_t token)
Sets the extended backtrace token for this thread.
Definition: Thread.h:1184
lldb_private::Thread::SetQueueName
virtual void SetQueueName(const char *name)
Definition: Thread.h:335
lldb_private::Thread::DumpUsingSettingsFormat
void DumpUsingSettingsFormat(Stream &strm, uint32_t frame_idx, bool stop_format)
Definition: Thread.cpp:1616
lldb_private::Thread::m_extended_info
StructuredData::ObjectSP m_extended_info
Definition: Thread.h:1301
lldb::DescriptionLevel
DescriptionLevel
Description levels for "void GetDescription(Stream *, DescriptionLevel)" calls.
Definition: lldb-enumerations.h:207
lldb_private::Thread::CalculateStackFrame
lldb::StackFrameSP CalculateStackFrame() override
Definition: Thread.cpp:1417
lldb_private::Thread::GetStopDescriptionRaw
std::string GetStopDescriptionRaw()
Definition: Thread.cpp:578
lldb_private::Thread::GetQueueName
virtual const char * GetQueueName()
Retrieve the Queue name for the queue currently using this Thread.
Definition: Thread.h:333
lldb_private::CompletionRequest
Definition: CompletionRequest.h:100
lldb_private::Thread::GetExtendedBacktraceOriginatingIndexID
virtual uint32_t GetExtendedBacktraceOriginatingIndexID()
Definition: Thread.h:1074
lldb::tid_t
uint64_t tid_t
Definition: lldb-types.h:86
lldb_private::Thread::SetSelectedFrameByIndex
bool SetSelectedFrameByIndex(uint32_t frame_idx, bool broadcast=false)
Definition: Thread.cpp:283
lldb_private::Thread::ThreadEventData::GetEventDataFromEvent
static const ThreadEventData * GetEventDataFromEvent(const Event *event_ptr)
Definition: Thread.cpp:171
lldb_private::Thread::SetShouldReportStop
void SetShouldReportStop(Vote vote)
Definition: Thread.cpp:467
lldb_private::ThreadProperties::GetLibrariesToAvoid
FileSpecList GetLibrariesToAvoid() const
Definition: Thread.cpp:117
lldb_private::Thread::GetGlobalProperties
static ThreadProperties & GetGlobalProperties()
Definition: Thread.cpp:60