Go to the documentation of this file.
29 uint32_t ThreadPlanStepInRange::s_default_flag_values =
30 ThreadPlanShouldStopHere::eStepInAvoidNoDebug;
35 ThreadPlanStepInRange::ThreadPlanStepInRange(
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());
186 "ShouldStopHere found plan to step out of this frame.");
188 LLDB_LOGF(log,
"ShouldStopHere no plan to step out of this frame.");
192 log,
"Thought I stepped out, but in fact arrived at a trampoline.");
226 LLDB_LOGF(log,
"Found a step through plan: %s",
229 LLDB_LOGF(log,
"No step through plan found.");
244 size_t bytes_to_skip = 0;
248 SymbolContext sc = curr_frame->GetSymbolContext(eSymbolContextFunction |
249 eSymbolContextSymbol);
261 if (bytes_to_skip == 0 && sc.
symbol) {
271 if (bytes_to_skip != 0) {
272 func_start_address.
Slide(bytes_to_skip);
274 LLDB_LOGF(log,
"Pushing past prologue ");
277 false, func_start_address,
true,
m_status);
310 bool libraries_say_avoid =
false;
312 FileSpecList libraries_to_avoid(
GetThread().GetLibrariesToAvoid());
313 size_t num_libraries = libraries_to_avoid.GetSize();
314 if (num_libraries > 0) {
319 for (
size_t i = 0; i < num_libraries; i++) {
320 const FileSpec &file_spec(libraries_to_avoid.GetFileSpecAtIndex(i));
322 libraries_say_avoid =
true;
328 if (libraries_say_avoid)
332 if (avoid_regexp_to_use ==
nullptr)
335 if (avoid_regexp_to_use !=
nullptr) {
337 eSymbolContextFunction | eSymbolContextBlock | eSymbolContextSymbol);
338 if (sc.
symbol !=
nullptr) {
339 const char *frame_function_name =
342 if (frame_function_name) {
343 bool return_value = avoid_regexp_to_use->
Execute(frame_function_name);
346 "Stepping out of function \"%s\" because it matches the "
347 "avoid regexp \"%s\".",
349 avoid_regexp_to_use->
GetText().str().c_str());
360 Status &status,
void *baton) {
361 bool should_stop_here =
true;
368 current_plan, flags, operation, status, baton);
369 if (!should_stop_here)
378 eSymbolContextFunction | eSymbolContextBlock | eSymbolContextSymbol);
379 if (sc.
symbol !=
nullptr) {
383 should_stop_here =
true;
385 const char *target_name =
389 if (function_name ==
nullptr)
390 should_stop_here =
false;
391 else if (strstr(function_name, target_name) ==
nullptr)
392 should_stop_here =
false;
394 if (log && !should_stop_here)
396 "Stepping out of frame %s which did not match step into "
403 if (should_stop_here) {
412 return should_stop_here;
431 bool return_value =
false;
438 StopReason reason = stop_info_sp->GetStopReason();
447 log->
PutCString(
"ThreadPlanStepInRange got asked if it explains the "
448 "stop for some reason other than step.");
449 return_value =
false;
467 if (step_without_resume) {
470 "ThreadPlanStepInRange::DoWillResume: returning false, "
480 return !step_without_resume;
Address & GetBaseAddress()
Get accessor for the base address of the range.
uint32_t GetCurrentInlinedDepth()
~ThreadPlanStepInRange() override
bool DoWillResume(lldb::StateType resume_state, bool current_plan) override
Thread & GetThread()
Returns the Thread that is using this thread plan.
FrameComparison
This is the return value for frame comparisons.
void SetAvoidRegexp(const char *name)
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.
uint32_t GetPrologueByteSize()
bool IsValid() const
Check if a line entry object is valid.
const AddressRange & GetAddressRange()
static bool DefaultShouldStopHereCallback(ThreadPlan *current_plan, Flags &flags, lldb::FrameComparison operation, Status &status, void *baton)
SymbolContext m_addr_context
#define LLDB_LOGF(log,...)
ThreadPlanKind GetKind() const
bool SetNextBranchBreakpoint()
ValueType Clear(ValueType mask=~static_cast< ValueType >(0))
Clear one or more flags.
bool DecrementCurrentInlinedDepth()
StopReason
Thread stop reasons.
const char * AsCString(const char *value_if_empty=nullptr) const
Get the string value as a C string.
static lldb::StopInfoSP CreateStopReasonToTrace(Thread &thread)
bool NextRangeBreakpointExplainsStop(lldb::StopInfoSP stop_info_sp)
bool DoPlanExplainsStop(Event *event_ptr) override
bool m_step_past_prologue
void SetStopInfo(lldb::StopInfoSP stop_reason_sp)
Symbol * symbol
The Symbol for a given query.
bool Success() const
Test for success condition.
bool GetStepInAvoidsNoDebug() const
bool FrameMatchesAvoidCriteria()
lldb::ThreadPlanSP m_sub_plan_sp
static void SetDefaultFlagValue(uint32_t new_value)
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.
static bool Match(const FileSpec &pattern, const FileSpec &file)
Match FileSpec pattern against FileSpec file.
@ eFrameCompareSameParent
const char * GetData() const
void GetDescription(Stream *s, lldb::DescriptionLevel level) override
Print a description of this thread to the stream s.
Function * function
The Function for a given query.
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...
ConstString GetFunctionName(Mangled::NamePreference preference=Mangled::ePreferDemangled) const
Find a name of the innermost function for the symbol context.
const RegularExpression * GetSymbolsToAvoidRegexp()
The regular expression returned determines symbols that this thread won't stop in during "step-in" op...
void ClearNextBranchBreakpoint()
bool GetStepOutAvoidsNoDebug() const
bool ResolveLoadAddress(lldb::addr_t load_addr, Address &so_addr, bool allow_section_end=false) const
lldb_private::Flags & GetFlags()
static uint32_t s_default_flag_values
@ eStateStepping
Process or thread is in the process of stepping and can not be examined.
Architecture * GetArchitecturePlugin() const
void SetPlanComplete(bool success=true)
void SetupAvoidNoDebug(LazyBool step_in_avoids_code_without_debug_info, LazyBool step_out_avoids_code_without_debug_info)
std::unique_ptr< RegularExpression > m_avoid_regexp_up
bool IsUsuallyUnexplainedStopReason(lldb::StopReason)
ConstString m_step_into_target
static bool DefaultShouldStopHereCallback(ThreadPlan *current_plan, Flags &flags, lldb::FrameComparison operation, Status &status, void *baton)
lldb::FrameComparison CompareCurrentFrameToStartFrame()
uint32_t GetPrologueByteSize()
Get the size of the prologue instructions for this function.
void DumpRanges(Stream *s)
lldb::addr_t GetLoadAddress(Target *target) const
Get the load address.
llvm::raw_ostream & AsRawOstream()
Returns a raw_ostream that forwards the data to this Stream object.
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.
lldb::ModuleSP module_sp
The Module for a given query.
SectionLoadList & GetSectionLoadList()
const char * GetCString() const
Get the string value as a C string.
size_t Printf(const char *format,...) __attribute__((format(printf
Output printf formatted output to the stream.
lldb::RunMode m_stop_others
A class that represents a running process on the host machine.
@ eDescriptionLevelVerbose
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...
ValueType Set(ValueType mask)
Set one or more flags by logical OR'ing mask with the current flags.
StateType
Process and Thread States.
bool IsVirtualStep() override
virtual lldb::StackFrameSP GetStackFrameAtIndex(uint32_t idx)
llvm::StringRef GetText() const
Access the regular expression text.
LineEntry line_entry
The LineEntry for a given query.
lldb::StopInfoSP GetPrivateStopInfo()
virtual lldb::RegisterContextSP GetRegisterContext()=0
Log * GetLog(Cat mask)
Retrieve the Log object for the channel associated with the given log enum.
bool ShouldStop(Event *event_ptr) override
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,...
lldb::ThreadPlanSP CheckShouldStopHereAndQueueStepOut(lldb::FrameComparison operation, Status &status)
const SymbolContext & GetSymbolContext(lldb::SymbolContextItem resolve_scope)
Provide a SymbolContext for this StackFrame's current pc value.
void SetFlagsToDefault() override
DescriptionLevel
Description levels for "void GetDescription(Stream *, DescriptionLevel)" calls.
const char * AsCString(const char *default_error_str="unknown error") const
Get the error string associated with the current error.
void PutCString(const char *cstr)
Address GetAddress() const