LLDB mainline
ThreadPlanStepInRange.h
Go to the documentation of this file.
1//===-- ThreadPlanStepInRange.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_THREADPLANSTEPINRANGE_H
10#define LLDB_TARGET_THREADPLANSTEPINRANGE_H
11
13#include "lldb/Target/StackID.h"
14#include "lldb/Target/Thread.h"
17
18namespace lldb_private {
19
22public:
23 ThreadPlanStepInRange(Thread &thread, const AddressRange &range,
24 const SymbolContext &addr_context,
25 const char *step_into_target, lldb::RunMode stop_others,
26 LazyBool step_in_avoids_code_without_debug_info,
27 LazyBool step_out_avoids_code_without_debug_info);
28
30
31 void GetDescription(Stream *s, lldb::DescriptionLevel level) override;
32
33 bool ShouldStop(Event *event_ptr) override;
34
35 void SetAvoidRegexp(const char *name);
36
37 static void SetDefaultFlagValue(uint32_t new_value);
38
39 bool IsVirtualStep() override;
40
41 // Plans that are implementing parts of a step in might need to follow the
42 // behavior of this plan w.r.t. StepThrough. They can get that from here.
43 static uint32_t GetDefaultFlagsValue() {
45 }
46
47protected:
48 static bool DefaultShouldStopHereCallback(ThreadPlan *current_plan,
49 Flags &flags,
50 lldb::FrameComparison operation,
51 Status &status, void *baton);
52
53 bool DoWillResume(lldb::StateType resume_state, bool current_plan) override;
54
55 bool DoPlanExplainsStop(Event *event_ptr) override;
56
57 void SetFlagsToDefault() override {
59 }
60
61 void SetCallbacks() {
64 SetShouldStopHereCallbacks(&callbacks, nullptr);
65 }
66
68
69private:
70 void SetupAvoidNoDebug(LazyBool step_in_avoids_code_without_debug_info,
71 LazyBool step_out_avoids_code_without_debug_info);
72 // Need an appropriate marker for the current stack so we can tell step out
73 // from step in.
74
75 static uint32_t s_default_flag_values; // These are the default flag values
76 // for the ThreadPlanStepThrough.
77 lldb::ThreadPlanSP m_sub_plan_sp; // Keep track of the last plan we were
78 // running. If it fails, we should stop.
79 std::unique_ptr<RegularExpression> m_avoid_regexp_up;
80 bool m_step_past_prologue; // FIXME: For now hard-coded to true, we could put
81 // a switch in for this if there's
82 // demand for that.
83 LazyBool m_virtual_step; // true if we've just done a "virtual step", i.e.
84 // just moved the inline stack depth.
89};
90
91} // namespace lldb_private
92
93#endif // LLDB_TARGET_THREADPLANSTEPINRANGE_H
A section + offset based address range class.
Definition: AddressRange.h:25
A uniqued constant string class.
Definition: ConstString.h:40
A class to manage flags.
Definition: Flags.h:22
ValueType Set(ValueType mask)
Set one or more flags by logical OR'ing mask with the current flags.
Definition: Flags.h:73
An error handling class.
Definition: Status.h:115
A stream class that can stream formatted output to a file.
Definition: Stream.h:28
Defines a symbol context baton that can be handed other debug core functions.
Definition: SymbolContext.h:34
void SetShouldStopHereCallbacks(const ThreadPlanShouldStopHereCallbacks *callbacks, void *baton)
const ThreadPlanStepInRange & operator=(const ThreadPlanStepInRange &)=delete
static void SetDefaultFlagValue(uint32_t new_value)
bool DoPlanExplainsStop(Event *event_ptr) override
bool DoWillResume(lldb::StateType resume_state, bool current_plan) override
void SetupAvoidNoDebug(LazyBool step_in_avoids_code_without_debug_info, LazyBool step_out_avoids_code_without_debug_info)
void GetDescription(Stream *s, lldb::DescriptionLevel level) override
Print a description of this thread to the stream s.
ThreadPlanStepInRange(const ThreadPlanStepInRange &)=delete
bool ShouldStop(Event *event_ptr) override
std::unique_ptr< RegularExpression > m_avoid_regexp_up
static bool DefaultShouldStopHereCallback(ThreadPlan *current_plan, Flags &flags, lldb::FrameComparison operation, Status &status, void *baton)
A class that represents a running process on the host machine.
std::shared_ptr< lldb_private::ThreadPlan > ThreadPlanSP
Definition: lldb-forward.h:453
DescriptionLevel
Description levels for "void GetDescription(Stream *, DescriptionLevel)" calls.
FrameComparison
This is the return value for frame comparisons.
StateType
Process and Thread States.
RunMode
Thread Run Modes.