Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-10 08:42:43

0001 //===-- SBThreadPlan.h ------------------------------------------*- C++ -*-===//
0002 //
0003 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0004 // See https://llvm.org/LICENSE.txt for license information.
0005 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0006 //
0007 //===----------------------------------------------------------------------===//
0008 
0009 #ifndef LLDB_API_SBTHREADPLAN_H
0010 #define LLDB_API_SBTHREADPLAN_H
0011 
0012 #include "lldb/API/SBDefines.h"
0013 
0014 #include <cstdio>
0015 
0016 namespace lldb_private {
0017 namespace python {
0018 class SWIGBridge;
0019 }
0020 } // namespace lldb_private
0021 
0022 namespace lldb {
0023 
0024 class LLDB_API SBThreadPlan {
0025 
0026 public:
0027   SBThreadPlan();
0028 
0029   SBThreadPlan(const lldb::SBThreadPlan &threadPlan);
0030 
0031   SBThreadPlan(lldb::SBThread &thread, const char *class_name);
0032 
0033   SBThreadPlan(lldb::SBThread &thread, const char *class_name, 
0034                lldb::SBStructuredData &args_data);
0035 
0036   ~SBThreadPlan();
0037 
0038   explicit operator bool() const;
0039 
0040   bool IsValid() const;
0041 
0042   void Clear();
0043 
0044   lldb::StopReason GetStopReason();
0045 
0046   /// Get the number of words associated with the stop reason.
0047   /// See also GetStopReasonDataAtIndex().
0048   size_t GetStopReasonDataCount();
0049 
0050   /// Get information associated with a stop reason.
0051   ///
0052   /// Breakpoint stop reasons will have data that consists of pairs of
0053   /// breakpoint IDs followed by the breakpoint location IDs (they always come
0054   /// in pairs).
0055   ///
0056   /// Stop Reason              Count Data Type
0057   /// ======================== ===== =========================================
0058   /// eStopReasonNone          0
0059   /// eStopReasonTrace         0
0060   /// eStopReasonBreakpoint    N     duple: {breakpoint id, location id}
0061   /// eStopReasonWatchpoint    1     watchpoint id
0062   /// eStopReasonSignal        1     unix signal number
0063   /// eStopReasonException     N     exception data
0064   /// eStopReasonExec          0
0065   /// eStopReasonFork          1     pid of the child process
0066   /// eStopReasonVFork         1     pid of the child process
0067   /// eStopReasonVForkDone     0
0068   /// eStopReasonPlanComplete  0
0069   uint64_t GetStopReasonDataAtIndex(uint32_t idx);
0070 
0071   SBThread GetThread() const;
0072 
0073   const lldb::SBThreadPlan &operator=(const lldb::SBThreadPlan &rhs);
0074 
0075   bool GetDescription(lldb::SBStream &description) const;
0076 
0077   void SetPlanComplete(bool success);
0078 
0079   bool IsPlanComplete();
0080 
0081   bool IsPlanStale();
0082 
0083   bool IsValid();
0084 
0085   bool GetStopOthers();
0086 
0087   void SetStopOthers(bool stop_others);
0088 
0089   // This section allows an SBThreadPlan to push another of the common types of
0090   // plans...
0091   SBThreadPlan QueueThreadPlanForStepOverRange(SBAddress &start_address,
0092                                                lldb::addr_t range_size);
0093   SBThreadPlan QueueThreadPlanForStepOverRange(SBAddress &start_address,
0094                                                lldb::addr_t range_size,
0095                                                SBError &error);
0096 
0097   SBThreadPlan QueueThreadPlanForStepInRange(SBAddress &start_address,
0098                                              lldb::addr_t range_size);
0099   SBThreadPlan QueueThreadPlanForStepInRange(SBAddress &start_address,
0100                                              lldb::addr_t range_size,
0101                                              SBError &error);
0102 
0103   SBThreadPlan QueueThreadPlanForStepOut(uint32_t frame_idx_to_step_to,
0104                                          bool first_insn = false);
0105   SBThreadPlan QueueThreadPlanForStepOut(uint32_t frame_idx_to_step_to,
0106                                          bool first_insn, SBError &error);
0107 
0108   SBThreadPlan QueueThreadPlanForRunToAddress(SBAddress address);
0109   SBThreadPlan QueueThreadPlanForRunToAddress(SBAddress address,
0110                                               SBError &error);
0111 
0112   SBThreadPlan QueueThreadPlanForStepScripted(const char *script_class_name);
0113   SBThreadPlan QueueThreadPlanForStepScripted(const char *script_class_name,
0114                                               SBError &error);
0115   SBThreadPlan QueueThreadPlanForStepScripted(const char *script_class_name,
0116                                               lldb::SBStructuredData &args_data,
0117                                               SBError &error);
0118 
0119 protected:
0120   friend class lldb_private::python::SWIGBridge;
0121 
0122   SBThreadPlan(const lldb::ThreadPlanSP &lldb_object_sp);
0123 
0124 private:
0125   friend class SBBreakpoint;
0126   friend class SBBreakpointLocation;
0127   friend class SBFrame;
0128   friend class SBProcess;
0129   friend class SBDebugger;
0130   friend class SBValue;
0131   friend class lldb_private::QueueImpl;
0132   friend class SBQueueItem;
0133 
0134   lldb::ThreadPlanSP GetSP() const { return m_opaque_wp.lock(); }
0135   lldb_private::ThreadPlan *get() const { return GetSP().get(); }
0136   void SetThreadPlan(const lldb::ThreadPlanSP &lldb_object_sp);
0137 
0138   lldb::ThreadPlanWP m_opaque_wp;
0139 };
0140 
0141 } // namespace lldb
0142 
0143 #endif // LLDB_API_SBTHREADPLAN_H