1254721Semaste//===-- ThreadPlanStepInRange.h ---------------------------------*- C++ -*-===// 2254721Semaste// 3353358Sdim// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4353358Sdim// See https://llvm.org/LICENSE.txt for license information. 5353358Sdim// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6254721Semaste// 7254721Semaste//===----------------------------------------------------------------------===// 8254721Semaste 9254721Semaste#ifndef liblldb_ThreadPlanStepInRange_h_ 10254721Semaste#define liblldb_ThreadPlanStepInRange_h_ 11254721Semaste 12254721Semaste#include "lldb/Core/AddressRange.h" 13254721Semaste#include "lldb/Target/StackID.h" 14254721Semaste#include "lldb/Target/Thread.h" 15314564Sdim#include "lldb/Target/ThreadPlanShouldStopHere.h" 16254721Semaste#include "lldb/Target/ThreadPlanStepRange.h" 17254721Semaste 18254721Semastenamespace lldb_private { 19254721Semaste 20314564Sdimclass ThreadPlanStepInRange : public ThreadPlanStepRange, 21314564Sdim public ThreadPlanShouldStopHere { 22254721Semastepublic: 23314564Sdim ThreadPlanStepInRange(Thread &thread, const AddressRange &range, 24314564Sdim const SymbolContext &addr_context, 25314564Sdim lldb::RunMode stop_others, 26314564Sdim LazyBool step_in_avoids_code_without_debug_info, 27314564Sdim LazyBool step_out_avoids_code_without_debug_info); 28254721Semaste 29314564Sdim ThreadPlanStepInRange(Thread &thread, const AddressRange &range, 30314564Sdim const SymbolContext &addr_context, 31314564Sdim const char *step_into_function_name, 32314564Sdim lldb::RunMode stop_others, 33314564Sdim LazyBool step_in_avoids_code_without_debug_info, 34314564Sdim LazyBool step_out_avoids_code_without_debug_info); 35254721Semaste 36314564Sdim ~ThreadPlanStepInRange() override; 37254721Semaste 38314564Sdim void GetDescription(Stream *s, lldb::DescriptionLevel level) override; 39254721Semaste 40314564Sdim bool ShouldStop(Event *event_ptr) override; 41254721Semaste 42314564Sdim void SetAvoidRegexp(const char *name); 43314564Sdim 44314564Sdim void SetStepInTarget(const char *target) { 45314564Sdim m_step_into_target.SetCString(target); 46314564Sdim } 47314564Sdim 48314564Sdim static void SetDefaultFlagValue(uint32_t new_value); 49314564Sdim 50314564Sdim bool IsVirtualStep() override; 51314564Sdim 52254721Semasteprotected: 53314564Sdim static bool DefaultShouldStopHereCallback(ThreadPlan *current_plan, 54314564Sdim Flags &flags, 55314564Sdim lldb::FrameComparison operation, 56344779Sdim Status &status, void *baton); 57276479Sdim 58314564Sdim bool DoWillResume(lldb::StateType resume_state, bool current_plan) override; 59254721Semaste 60314564Sdim bool DoPlanExplainsStop(Event *event_ptr) override; 61254721Semaste 62314564Sdim void SetFlagsToDefault() override { 63314564Sdim GetFlags().Set(ThreadPlanStepInRange::s_default_flag_values); 64314564Sdim } 65254721Semaste 66314564Sdim void SetCallbacks() { 67314564Sdim ThreadPlanShouldStopHere::ThreadPlanShouldStopHereCallbacks callbacks( 68314564Sdim ThreadPlanStepInRange::DefaultShouldStopHereCallback, nullptr); 69314564Sdim SetShouldStopHereCallbacks(&callbacks, nullptr); 70314564Sdim } 71314564Sdim 72314564Sdim bool FrameMatchesAvoidCriteria(); 73314564Sdim 74254721Semasteprivate: 75314564Sdim friend lldb::ThreadPlanSP Thread::QueueThreadPlanForStepOverRange( 76314564Sdim bool abort_other_plans, const AddressRange &range, 77314564Sdim const SymbolContext &addr_context, lldb::RunMode stop_others, 78344779Sdim Status &status, LazyBool avoid_code_without_debug_info); 79314564Sdim friend lldb::ThreadPlanSP Thread::QueueThreadPlanForStepInRange( 80314564Sdim bool abort_other_plans, const AddressRange &range, 81314564Sdim const SymbolContext &addr_context, const char *step_in_target, 82344779Sdim lldb::RunMode stop_others, Status &status, 83314564Sdim LazyBool step_in_avoids_code_without_debug_info, 84314564Sdim LazyBool step_out_avoids_code_without_debug_info); 85254721Semaste 86314564Sdim void SetupAvoidNoDebug(LazyBool step_in_avoids_code_without_debug_info, 87314564Sdim LazyBool step_out_avoids_code_without_debug_info); 88314564Sdim // Need an appropriate marker for the current stack so we can tell step out 89314564Sdim // from step in. 90254721Semaste 91314564Sdim static uint32_t s_default_flag_values; // These are the default flag values 92314564Sdim // for the ThreadPlanStepThrough. 93314564Sdim lldb::ThreadPlanSP m_sub_plan_sp; // Keep track of the last plan we were 94314564Sdim // running. If it fails, we should stop. 95353358Sdim std::unique_ptr<RegularExpression> m_avoid_regexp_up; 96314564Sdim bool m_step_past_prologue; // FIXME: For now hard-coded to true, we could put 97314564Sdim // a switch in for this if there's 98314564Sdim // demand for that. 99314564Sdim bool m_virtual_step; // true if we've just done a "virtual step", i.e. just 100314564Sdim // moved the inline stack depth. 101314564Sdim ConstString m_step_into_target; 102314564Sdim DISALLOW_COPY_AND_ASSIGN(ThreadPlanStepInRange); 103254721Semaste}; 104254721Semaste 105254721Semaste} // namespace lldb_private 106254721Semaste 107296417Sdim#endif // liblldb_ThreadPlanStepInRange_h_ 108