37 const SymbolContext &addr_context,
const char *step_into_target,
39 LazyBool step_out_avoids_code_without_debug_info)
41 "Step Range stepping in", thread, range, addr_context,
44 m_virtual_step(false), m_step_into_target(step_into_target) {
48 step_out_avoids_code_without_debug_info);
54 LazyBool step_in_avoids_code_without_debug_info,
55 LazyBool step_out_avoids_code_without_debug_info) {
56 bool avoid_nodebug =
true;
58 switch (step_in_avoids_code_without_debug_info) {
63 avoid_nodebug =
false;
74 switch (step_out_avoids_code_without_debug_info) {
79 avoid_nodebug =
false;
94 auto PrintFailureIfAny = [&]() {
107 bool printed_line_info =
false;
109 s->
Printf(
" through line ");
111 printed_line_info =
true;
115 if (step_into_target && step_into_target[0] !=
'\0')
119 s->
Printf(
" using ranges:");
134 GetTarget().GetArchitecture().GetAddressByteSize());
187 "ShouldStopHere found plan to step out of this frame.");
189 LLDB_LOGF(log,
"ShouldStopHere no plan to step out of this frame.");
193 log,
"Thought I stepped out, but in fact arrived at a trampoline.");
227 LLDB_LOGF(log,
"Found a step through plan: %s",
230 LLDB_LOGF(log,
"No step through plan found.");
245 size_t bytes_to_skip = 0;
249 SymbolContext sc = curr_frame->GetSymbolContext(eSymbolContextFunction |
250 eSymbolContextSymbol);
262 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;
468 if (step_without_resume) {
471 "ThreadPlanStepInRange::DoWillResume: returning false, "
481 return !step_without_resume;
#define LLDB_LOGF(log,...)
A section + offset based address range class.
Address & GetBaseAddress()
Get accessor for the base address of the range.
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 AddressRange & GetAddressRange()
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.
bool ResolveLoadAddress(lldb::addr_t load_addr, Address &so_addr, bool allow_section_end=false) const
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.
const char * AsCString(const char *default_error_str="unknown error") const
Get the error string associated with the current error.
bool Success() const
Test for success condition.
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.
LineEntry line_entry
The LineEntry for a given query.
Address GetAddress() const
uint32_t GetPrologueByteSize()
SectionLoadList & GetSectionLoadList()
Architecture * GetArchitecturePlugin() const
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()
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()
bool GetStepInAvoidsNoDebug() const
const RegularExpression * GetSymbolsToAvoidRegexp()
The regular expression returned determines symbols that this thread won't stop in during "step-in" op...
bool GetStepOutAvoidsNoDebug() const
bool DecrementCurrentInlinedDepth()
virtual lldb::StackFrameSP GetStackFrameAtIndex(uint32_t idx)
virtual lldb::RegisterContextSP GetRegisterContext()=0
virtual lldb::ThreadPlanSP QueueThreadPlanForRunToAddress(bool abort_other_plans, Address &target_addr, bool stop_other_threads, Status &status)
Gets the plan used to continue from the current PC.
virtual lldb::ThreadPlanSP QueueThreadPlanForStepThrough(StackID &return_stack_id, bool abort_other_plans, bool stop_other_threads, Status &status)
Gets the plan used to step through the code that steps from a function call site at the current PC in...
uint32_t GetCurrentInlinedDepth()
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.
bool IsValid() const
Check if a line entry object is valid.
bool DumpStopContext(Stream *s, bool show_fullpaths) const
Dumps information specific to a process that stops at this line entry to the supplied stream s.