Back to home page

EIC code displayed by LXR

 
 

    


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

0001 //===-- ThreadPlanStepInRange.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_TARGET_THREADPLANSTEPINRANGE_H
0010 #define LLDB_TARGET_THREADPLANSTEPINRANGE_H
0011 
0012 #include "lldb/Core/AddressRange.h"
0013 #include "lldb/Target/StackID.h"
0014 #include "lldb/Target/Thread.h"
0015 #include "lldb/Target/ThreadPlanShouldStopHere.h"
0016 #include "lldb/Target/ThreadPlanStepRange.h"
0017 
0018 namespace lldb_private {
0019 
0020 class ThreadPlanStepInRange : public ThreadPlanStepRange,
0021                               public ThreadPlanShouldStopHere {
0022 public:
0023   ThreadPlanStepInRange(Thread &thread, const AddressRange &range,
0024                         const SymbolContext &addr_context,
0025                         const char *step_into_target, lldb::RunMode stop_others,
0026                         LazyBool step_in_avoids_code_without_debug_info,
0027                         LazyBool step_out_avoids_code_without_debug_info);
0028 
0029   ~ThreadPlanStepInRange() override;
0030 
0031   void GetDescription(Stream *s, lldb::DescriptionLevel level) override;
0032 
0033   bool ShouldStop(Event *event_ptr) override;
0034 
0035   void SetAvoidRegexp(const char *name);
0036 
0037   static void SetDefaultFlagValue(uint32_t new_value);
0038 
0039   bool IsVirtualStep() override;
0040 
0041   // Plans that are implementing parts of a step in might need to follow the
0042   // behavior of this plan w.r.t. StepThrough.  They can get that from here.
0043   static uint32_t GetDefaultFlagsValue() {
0044     return s_default_flag_values;
0045   }
0046 
0047 protected:
0048   static bool DefaultShouldStopHereCallback(ThreadPlan *current_plan,
0049                                             Flags &flags,
0050                                             lldb::FrameComparison operation,
0051                                             Status &status, void *baton);
0052 
0053   bool DoWillResume(lldb::StateType resume_state, bool current_plan) override;
0054 
0055   bool DoPlanExplainsStop(Event *event_ptr) override;
0056 
0057   void SetFlagsToDefault() override {
0058     GetFlags().Set(ThreadPlanStepInRange::s_default_flag_values);
0059   }
0060 
0061   void SetCallbacks() {
0062     ThreadPlanShouldStopHere::ThreadPlanShouldStopHereCallbacks callbacks(
0063         ThreadPlanStepInRange::DefaultShouldStopHereCallback, nullptr);
0064     SetShouldStopHereCallbacks(&callbacks, nullptr);
0065   }
0066 
0067   bool FrameMatchesAvoidCriteria();
0068 
0069 private:
0070   void SetupAvoidNoDebug(LazyBool step_in_avoids_code_without_debug_info,
0071                          LazyBool step_out_avoids_code_without_debug_info);
0072   // Need an appropriate marker for the current stack so we can tell step out
0073   // from step in.
0074 
0075   static uint32_t s_default_flag_values; // These are the default flag values
0076                                          // for the ThreadPlanStepThrough.
0077   lldb::ThreadPlanSP m_sub_plan_sp;      // Keep track of the last plan we were
0078                                     // running.  If it fails, we should stop.
0079   std::unique_ptr<RegularExpression> m_avoid_regexp_up;
0080   bool m_step_past_prologue; // FIXME: For now hard-coded to true, we could put
0081                              // a switch in for this if there's
0082                              // demand for that.
0083   LazyBool m_virtual_step;   // true if we've just done a "virtual step", i.e.
0084                              // just moved the inline stack depth.
0085   ConstString m_step_into_target;
0086   ThreadPlanStepInRange(const ThreadPlanStepInRange &) = delete;
0087   const ThreadPlanStepInRange &
0088   operator=(const ThreadPlanStepInRange &) = delete;
0089 };
0090 
0091 } // namespace lldb_private
0092 
0093 #endif // LLDB_TARGET_THREADPLANSTEPINRANGE_H