37 Vote report_stop_vote,
Vote report_run_vote, uint32_t frame_idx,
38 LazyBool step_out_avoids_code_without_debug_info,
39 bool continue_to_next_branch,
bool gather_return_value)
45 m_immediate_step_from_function(nullptr),
46 m_calculate_return_value(gather_return_value) {
53 uint32_t return_frame_index = frame_idx + 1;
57 if (!return_frame_sp || !immediate_return_from_sp)
61 while (return_frame_sp->IsArtificial() || return_frame_sp->IsHidden()) {
69 if (!return_frame_sp) {
70 LLDB_LOG(log,
"Can't step out of frame with artificial ancestors");
82 if (immediate_return_from_sp->IsInlined()) {
88 frame_idx - 1,
eLazyBoolNo, continue_to_next_branch);
101 Address return_address(return_frame_sp->GetFrameCodeAddress());
102 if (continue_to_next_branch) {
105 Address return_address_decr_pc = return_address;
106 if (return_address_decr_pc.
GetOffset() > 0)
107 return_address_decr_pc.
Slide(-1);
110 &return_address_sc, lldb::eSymbolContextLineEntry);
112 const bool include_inlined_functions =
false;
114 include_inlined_functions);
117 return_address, range);
127 uint32_t permissions = 0;
129 LLDB_LOGF(log,
"ThreadPlanStepOut(%p): Return address (0x%" PRIx64
130 ") permissions not found.",
static_cast<void *
>(
this),
132 }
else if (!(permissions & ePermissionsExecutable)) {
134 ") did not point to executable memory.",
136 LLDB_LOGF(log,
"ThreadPlanStepOut(%p): %s",
static_cast<void *
>(
this),
144 if (return_bp !=
nullptr) {
152 if (immediate_return_from_sp) {
154 immediate_return_from_sp->GetSymbolContext(eSymbolContextFunction);
163 LazyBool step_out_avoids_code_without_debug_info) {
164 bool avoid_nodebug =
true;
165 switch (step_out_avoids_code_without_debug_info) {
167 avoid_nodebug =
true;
170 avoid_nodebug =
false;
201 s->
Printf(
"Stepping out to inlined frame so we can walk through it.");
203 s->
Printf(
"Stepping out by stepping through inlined function.");
205 s->
Printf(
"Stepping out from ");
218 s->
Printf(
" returning to frame at ");
236 s->
Printf(
"Stepped out past: ");
237 frame_sp->DumpUsingSettingsFormat(s);
251 "Could not create hardware breakpoint for thread plan.");
257 error->PutCString(
"Could not create return address breakpoint.");
259 error->PutCString(
" ");
290 StopReason reason = stop_info_sp->GetStopReason();
325 if (site_sp->GetNumberOfConstituents() == 1)
402 if (return_bp !=
nullptr)
411 if (return_bp !=
nullptr)
429 LLDB_LOGF(log,
"Completed step out plan.");
448 if (!immediate_return_from_sp)
454 immediate_return_from_sp->Dump(&s,
true,
false);
458 Block *from_block = immediate_return_from_sp->GetFrameBlock();
473 std::make_shared<ThreadPlanStepOverRange>(
474 thread, inline_range, inlined_sc, run_mode, avoid_no_debug);
482 if (!step_through_inline_plan_ptr->
ValidatePlan(&errors)) {
484 delete step_through_inline_plan_ptr;
488 for (
size_t i = 1; i < num_ranges; i++) {
490 step_through_inline_plan_ptr->
AddRange(inline_range);
514 if (return_compiler_type) {
518 abi_sp->GetReturnValueObject(
GetThread(), return_compiler_type);
static llvm::raw_ostream & error(Stream &strm)
#define LLDB_LOG(log,...)
The LLDB_LOG* macros defined below are the way to emit log messages.
#define LLDB_LOGF(log,...)
A section + offset based address range class.
lldb::addr_t GetByteSize() const
Get accessor for the byte size of this range.
A section + offset based address class.
lldb::addr_t GetLoadAddress(Target *target) const
Get the load address.
bool SetLoadAddress(lldb::addr_t load_addr, Target *target, bool allow_section_end=false)
Set the address to represent load_addr.
uint32_t CalculateSymbolContext(SymbolContext *sc, lldb::SymbolContextItem resolve_scope=lldb::eSymbolContextEverything) const
Reconstruct a symbol context from an address.
@ DumpStyleResolvedDescription
Display the details about what an address resolves to.
@ DumpStyleLoadAddress
Display as the load address (if resolved).
bool Slide(int64_t offset)
bool Dump(Stream *s, ExecutionContextScope *exe_scope, DumpStyle style, DumpStyle fallback_style=DumpStyleInvalid, uint32_t addr_byte_size=UINT32_MAX, bool all_ranges=false, std::optional< Stream::HighlightSettings > settings=std::nullopt) const
Dump a description of this object to a Stream.
lldb::addr_t GetOffset() const
Get the section relative offset value.
A class that describes a single lexical block.
void CalculateSymbolContext(SymbolContext *sc) override
Reconstruct the object's symbol context into sc.
Block * GetContainingInlinedBlock()
Get the inlined block that contains this block.
bool GetRangeAtIndex(uint32_t range_idx, AddressRange &range)
size_t GetNumRanges() const
General Outline: A breakpoint has four main parts, a filter, a resolver, the list of breakpoint locat...
void SetBreakpointKind(const char *kind)
Set the "kind" description for a breakpoint.
bool HasResolvedLocations() const
Return whether this breakpoint has any resolved locations.
void SetThreadID(lldb::tid_t thread_id)
Set the valid thread to be checked when the breakpoint is hit.
void SetEnabled(bool enable) override
If enable is true, enable the breakpoint, if false disable it.
Generic representation of a type in a programming language.
CompilerType GetFunctionReturnType() const
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.
CompilerType GetCompilerType()
StopPointSiteList< lldb_private::BreakpointSite > & GetBreakpointSiteList()
Address AdvanceAddressToNextBranchInstruction(Address default_stop_addr, AddressRange range_bounds)
Find the next branch instruction to set a breakpoint on.
virtual bool GetLoadAddressPermissions(lldb::addr_t load_addr, uint32_t &permissions)
Attempt to get the attributes for a region of memory in the process.
const lldb::ABISP & GetABI()
Target & GetTarget()
Get the target object pointer for this module.
StopPointSiteSP FindByID(typename StopPointSite::SiteID site_id)
Returns a shared pointer to the site with id site_id.
lldb::break_id_t GetID() const
const char * GetData() const
llvm::StringRef GetString() const
A stream class that can stream formatted output to a file.
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.
lldb::TargetSP target_sp
The Target for a given query.
LineEntry line_entry
The LineEntry for a given query.
lldb::BreakpointSP GetBreakpointByID(lldb::break_id_t break_id)
bool RemoveBreakpointByID(lldb::break_id_t break_id)
lldb::BreakpointSP CreateBreakpoint(const FileSpecList *containingModules, const FileSpec &file, uint32_t line_no, uint32_t column, lldb::addr_t offset, LazyBool check_inlines, LazyBool skip_prologue, bool internal, bool request_hardware, LazyBool move_to_nearest_code)
lldb_private::Flags m_flags
virtual lldb::ThreadPlanSP QueueStepOutFromHerePlan(Flags &flags, lldb::FrameComparison operation, Status &status)
lldb_private::Flags & GetFlags()
void SetShouldStopHereCallbacks(const ThreadPlanShouldStopHereCallbacks *callbacks, void *baton)
bool InvokeShouldStopHereCallback(lldb::FrameComparison operation, Status &status)
void GetDescription(Stream *s, lldb::DescriptionLevel level) override
Print a description of this thread to the stream s.
lldb::ValueObjectSP m_return_valobj_sp
~ThreadPlanStepOut() override
std::vector< lldb::StackFrameSP > m_stepped_past_frames
lldb::break_id_t m_return_bp_id
bool IsPlanStale() override
bool QueueInlinedStepPlan(bool queue_now)
lldb::addr_t m_return_addr
void CalculateReturnValue()
Function * m_immediate_step_from_function
lldb::StateType GetPlanRunState() override
lldb::ThreadPlanSP m_step_out_further_plan_sp
bool m_calculate_return_value
bool DoWillResume(lldb::StateType resume_state, bool current_plan) override
void SetupAvoidNoDebug(LazyBool step_out_avoids_code_without_debug_info)
ThreadPlanStepOut(Thread &thread, SymbolContext *addr_context, bool first_insn, bool stop_others, Vote report_stop_vote, Vote report_run_vote, uint32_t frame_idx, LazyBool step_out_avoids_code_without_debug_info, bool continue_to_next_branch=false, bool gather_return_value=true)
bool ValidatePlan(Stream *error) override
Returns whether this plan could be successfully created.
bool DoPlanExplainsStop(Event *event_ptr) override
bool MischiefManaged() override
lldb::ThreadPlanSP m_step_through_inline_plan_sp
bool ShouldStop(Event *event_ptr) override
static uint32_t s_default_flag_values
StreamString m_constructor_errors
void SetFlagsToDefault() override
StackID m_immediate_step_from_id
lldb::addr_t m_step_from_insn
bool StopOthers() override
lldb::ThreadPlanSP m_step_out_to_inline_plan_sp
bool ValidatePlan(Stream *error) override
Returns whether this plan could be successfully created.
void AddRange(const AddressRange &new_range)
bool IsUsuallyUnexplainedStopReason(lldb::StopReason)
void SetPlanComplete(bool success=true)
Thread & GetThread()
Returns the Thread that is using this thread plan.
void SetOkayToDiscard(bool value)
virtual bool MischiefManaged()
bool m_could_not_resolve_hw_bp
lldb::StopInfoSP GetPrivateStopInfo()
bool GetStepOutAvoidsNoDebug() const
virtual lldb::StackFrameSP GetStackFrameAtIndex(uint32_t idx)
Status QueueThreadPlan(lldb::ThreadPlanSP &plan_sp, bool abort_other_plans)
Queues a generic thread plan.
virtual lldb::RegisterContextSP GetRegisterContext()=0
#define LLDB_INVALID_BREAK_ID
#define LLDB_INVALID_ADDRESS
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.
std::shared_ptr< lldb_private::ABI > ABISP
std::shared_ptr< lldb_private::StackFrame > StackFrameSP
std::shared_ptr< lldb_private::BreakpointSite > BreakpointSiteSP
DescriptionLevel
Description levels for "void GetDescription(Stream *, DescriptionLevel)" calls.
@ eDescriptionLevelVerbose
StateType
Process and Thread States.
@ eStateRunning
Process or thread is running and can't be examined.
std::shared_ptr< lldb_private::StopInfo > StopInfoSP
StopReason
Thread stop reasons.
AddressRange GetSameLineContiguousAddressRange(bool include_inlined_functions) const
Give the range for this LineEntry + any additional LineEntries for this same source line that are con...
bool IsValid() const
Check if a line entry object is valid.