38 const SymbolContext &addr_context,
const char *step_into_target,
40 LazyBool step_out_avoids_code_without_debug_info)
42 "Step Range stepping in", thread, range, addr_context,
49 step_out_avoids_code_without_debug_info);
55 LazyBool step_in_avoids_code_without_debug_info,
56 LazyBool step_out_avoids_code_without_debug_info) {
57 bool avoid_nodebug =
true;
59 switch (step_in_avoids_code_without_debug_info) {
64 avoid_nodebug =
false;
67 avoid_nodebug = thread.GetStepInAvoidsNoDebug();
75 switch (step_out_avoids_code_without_debug_info) {
80 avoid_nodebug =
false;
83 avoid_nodebug = thread.GetStepOutAvoidsNoDebug();
95 auto PrintFailureIfAny = [&]() {
108 bool printed_line_info =
false;
110 s->
Printf(
" through line ");
112 printed_line_info =
true;
116 if (step_into_target && step_into_target[0] !=
'\0')
120 s->
Printf(
" using ranges:");
135 GetTarget().GetArchitecture().GetAddressByteSize());
188 "ShouldStopHere found plan to step out of this frame.");
190 LLDB_LOGF(log,
"ShouldStopHere no plan to step out of this frame.");
194 log,
"Thought I stepped out, but in fact arrived at a trampoline.");
228 LLDB_LOGF(log,
"Found a step through plan: %s",
231 LLDB_LOGF(log,
"No step through plan found.");
246 size_t bytes_to_skip = 0;
247 lldb::addr_t curr_addr = thread.GetRegisterContext()->GetPC();
250 SymbolContext sc = curr_frame->GetSymbolContext(eSymbolContextFunction |
251 eSymbolContextSymbol);
263 if (bytes_to_skip == 0 && sc.
symbol) {
272 if (bytes_to_skip != 0) {
273 func_start_address.
Slide(bytes_to_skip);
275 LLDB_LOGF(log,
"Pushing past prologue ");
278 false, func_start_address,
true,
m_status);
311 bool libraries_say_avoid =
false;
314 size_t num_libraries = libraries_to_avoid.
GetSize();
315 if (num_libraries > 0) {
320 for (
size_t i = 0; i < num_libraries; i++) {
323 libraries_say_avoid =
true;
329 if (libraries_say_avoid)
333 if (avoid_regexp_to_use ==
nullptr)
336 if (avoid_regexp_to_use !=
nullptr) {
338 eSymbolContextFunction | eSymbolContextBlock | eSymbolContextSymbol);
339 if (sc.
symbol !=
nullptr) {
340 const char *frame_function_name =
343 if (frame_function_name) {
344 bool return_value = avoid_regexp_to_use->
Execute(frame_function_name);
347 "Stepping out of function \"%s\" because it matches the "
348 "avoid regexp \"%s\".",
350 avoid_regexp_to_use->
GetText().str().c_str());
361 Status &status,
void *baton) {
362 bool should_stop_here =
true;
369 current_plan, flags, operation, status, baton);
370 if (!should_stop_here)
379 eSymbolContextFunction | eSymbolContextBlock | eSymbolContextSymbol);
380 if (sc.
symbol !=
nullptr) {
384 should_stop_here =
true;
386 const char *target_name =
390 if (function_name ==
nullptr)
391 should_stop_here =
false;
392 else if (strstr(function_name, target_name) ==
nullptr)
393 should_stop_here =
false;
395 if (log && !should_stop_here)
397 "Stepping out of frame %s which did not match step into "
404 if (should_stop_here) {
413 return should_stop_here;
432 bool return_value =
false;
439 StopReason reason = stop_info_sp->GetStopReason();
448 log->
PutCString(
"ThreadPlanStepInRange got asked if it explains the "
449 "stop for some reason other than step.");
450 return_value =
false;
470 bool step_without_resume = thread.DecrementCurrentInlinedDepth();
471 if (step_without_resume) {
474 "ThreadPlanStepInRange::DoWillResume: returning false, "
476 thread.GetCurrentInlinedDepth());
484 return !step_without_resume;
492 uint32_t cur_inline_depth = thread.GetCurrentInlinedDepth();
493 if (cur_inline_depth ==
UINT32_MAX || cur_inline_depth == 0)
#define LLDB_LOGF(log,...)
A section + offset based address range class.
A section + offset based address class.
lldb::addr_t GetLoadAddress(Target *target) const
Get the load address.
bool Slide(int64_t offset)
virtual size_t GetBytesToSkip(Symbol &func, const Address &curr_addr) const
This method is used to get the number of bytes that should be skipped, from function start address,...
const char * AsCString(const char *value_if_empty=nullptr) const
Get the string value as a C string.
const char * GetCString() const
Get the string value as a C string.
const FileSpec & GetFileSpecAtIndex(size_t idx) const
Get file at index.
size_t GetSize() const
Get the number of files in the file list.
static bool Match(const FileSpec &pattern, const FileSpec &file)
Match FileSpec pattern against FileSpec file.
ValueType Clear(ValueType mask=~static_cast< ValueType >(0))
Clear one or more flags.
ValueType Set(ValueType mask)
Set one or more flags by logical OR'ing mask with the current flags.
const Address & GetAddress() const
Return the address of the function (its entry point).
uint32_t GetPrologueByteSize()
Get the size of the prologue instructions for this function.
void PutCString(const char *cstr)
@ ePreferDemangledWithoutArguments
bool Execute(llvm::StringRef string, llvm::SmallVectorImpl< llvm::StringRef > *matches=nullptr) const
Execute a regular expression match using the compiled regular expression that is already in this obje...
llvm::StringRef GetText() const
Access the regular expression text.
This base class provides an interface to stack frames.
const SymbolContext & GetSymbolContext(lldb::SymbolContextItem resolve_scope)
Provide a SymbolContext for this StackFrame's current pc value.
static lldb::StopInfoSP CreateStopReasonToTrace(Thread &thread)
const char * GetData() const
A stream class that can stream formatted output to a file.
llvm::raw_ostream & AsRawOstream()
Returns a raw_ostream that forwards the data to this Stream object.
size_t Printf(const char *format,...) __attribute__((format(printf
Output printf formatted output to the stream.
Defines a symbol context baton that can be handed other debug core functions.
Function * function
The Function for a given query.
ConstString GetFunctionName(Mangled::NamePreference preference=Mangled::ePreferDemangled) const
Find a name of the innermost function for the symbol context.
lldb::ModuleSP module_sp
The Module for a given query.
Symbol * symbol
The Symbol for a given query.
Address GetAddress() const
uint32_t GetPrologueByteSize()
Architecture * GetArchitecturePlugin() const
bool ResolveLoadAddress(lldb::addr_t load_addr, Address &so_addr, uint32_t stop_id=SectionLoadHistory::eStopIDNow, bool allow_section_end=false)
ThreadPlanShouldStopHere(ThreadPlan *owner)
lldb_private::Flags & GetFlags()
static bool DefaultShouldStopHereCallback(ThreadPlan *current_plan, Flags &flags, lldb::FrameComparison operation, Status &status, void *baton)
lldb::ThreadPlanSP CheckShouldStopHereAndQueueStepOut(lldb::FrameComparison operation, Status &status)
bool m_step_past_prologue
static void SetDefaultFlagValue(uint32_t new_value)
bool IsVirtualStep() override
ThreadPlanStepInRange(Thread &thread, const AddressRange &range, const SymbolContext &addr_context, const char *step_into_target, lldb::RunMode stop_others, LazyBool step_in_avoids_code_without_debug_info, LazyBool step_out_avoids_code_without_debug_info)
ConstString m_step_into_target
~ThreadPlanStepInRange() override
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 SetFlagsToDefault() override
void GetDescription(Stream *s, lldb::DescriptionLevel level) override
Print a description of this thread to the stream s.
bool FrameMatchesAvoidCriteria()
lldb::ThreadPlanSP m_sub_plan_sp
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)
void SetAvoidRegexp(const char *name)
static uint32_t s_default_flag_values
bool NextRangeBreakpointExplainsStop(lldb::StopInfoSP stop_info_sp)
void DumpRanges(Stream *s)
SymbolContext m_addr_context
lldb::FrameComparison CompareCurrentFrameToStartFrame()
bool SetNextBranchBreakpoint()
ThreadPlanStepRange(ThreadPlanKind kind, const char *name, Thread &thread, const AddressRange &range, const SymbolContext &addr_context, lldb::RunMode stop_others, bool given_ranges_only=false)
lldb::RunMode m_stop_others
void ClearNextBranchBreakpointExplainedStop()
void ClearNextBranchBreakpoint()
void SetStopInfo(lldb::StopInfoSP stop_reason_sp)
bool IsUsuallyUnexplainedStopReason(lldb::StopReason)
ThreadPlanKind GetKind() const
void SetPlanComplete(bool success=true)
Thread & GetThread()
Returns the Thread that is using this thread plan.
lldb::StopInfoSP GetPrivateStopInfo()
const RegularExpression * GetSymbolsToAvoidRegexp()
The regular expression returned determines symbols that this thread won't stop in during "step-in" op...
virtual lldb::StackFrameSP GetStackFrameAtIndex(uint32_t idx)
A class that represents a running process on the host machine.
Log * GetLog(Cat mask)
Retrieve the Log object for the channel associated with the given log enum.
void DumpAddress(llvm::raw_ostream &s, uint64_t addr, uint32_t addr_size, const char *prefix=nullptr, const char *suffix=nullptr)
Output an address value to this stream.
std::shared_ptr< lldb_private::StackFrame > StackFrameSP
DescriptionLevel
Description levels for "void GetDescription(Stream *, DescriptionLevel)" calls.
@ eDescriptionLevelVerbose
FrameComparison
This is the return value for frame comparisons.
@ eFrameCompareSameParent
StateType
Process and Thread States.
@ eStateStepping
Process or thread is in the process of stepping and can not be examined.
std::shared_ptr< lldb_private::StopInfo > StopInfoSP
StopReason
Thread stop reasons.