#include "lldb/Target/StackFrame.h"
#include "lldb/Core/Debugger.h"
#include "lldb/Core/Disassembler.h"
#include "lldb/Core/FormatEntity.h"
#include "lldb/Core/Mangled.h"
#include "lldb/Core/Module.h"
#include "lldb/Core/Value.h"
#include "lldb/Core/ValueObjectConstResult.h"
#include "lldb/Core/ValueObjectMemory.h"
#include "lldb/Core/ValueObjectVariable.h"
#include "lldb/Symbol/CompileUnit.h"
#include "lldb/Symbol/Function.h"
#include "lldb/Symbol/Symbol.h"
#include "lldb/Symbol/SymbolContextScope.h"
#include "lldb/Symbol/SymbolFile.h"
#include "lldb/Symbol/Type.h"
#include "lldb/Symbol/VariableList.h"
#include "lldb/Target/ABI.h"
#include "lldb/Target/ExecutionContext.h"
#include "lldb/Target/Process.h"
#include "lldb/Target/RegisterContext.h"
#include "lldb/Target/StackFrameRecognizer.h"
#include "lldb/Target/Target.h"
#include "lldb/Target/Thread.h"
#include "lldb/Utility/LLDBLog.h"
#include "lldb/Utility/Log.h"
#include "lldb/Utility/RegisterValue.h"
#include "lldb/lldb-enumerations.h"
#include <memory>
usingnamespacelldb;
usingnamespacelldb_private;
#define RESOLVED_FRAME_CODE_ADDR …
#define RESOLVED_FRAME_ID_SYMBOL_SCOPE …
#define GOT_FRAME_BASE …
#define RESOLVED_VARIABLES …
#define RESOLVED_GLOBAL_VARIABLES …
StackFrame::StackFrame(const ThreadSP &thread_sp, user_id_t frame_idx,
user_id_t unwind_frame_index, addr_t cfa,
bool cfa_is_valid, addr_t pc, StackFrame::Kind kind,
bool behaves_like_zeroth_frame,
const SymbolContext *sc_ptr)
: … { … }
StackFrame::StackFrame(const ThreadSP &thread_sp, user_id_t frame_idx,
user_id_t unwind_frame_index,
const RegisterContextSP ®_context_sp, addr_t cfa,
addr_t pc, bool behaves_like_zeroth_frame,
const SymbolContext *sc_ptr)
: … { … }
StackFrame::StackFrame(const ThreadSP &thread_sp, user_id_t frame_idx,
user_id_t unwind_frame_index,
const RegisterContextSP ®_context_sp, addr_t cfa,
const Address &pc_addr, bool behaves_like_zeroth_frame,
const SymbolContext *sc_ptr)
: … { … }
StackFrame::~StackFrame() = default;
StackID &StackFrame::GetStackID() { … }
uint32_t StackFrame::GetFrameIndex() const { … }
void StackFrame::SetSymbolContextScope(SymbolContextScope *symbol_scope) { … }
const Address &StackFrame::GetFrameCodeAddress() { … }
Address StackFrame::GetFrameCodeAddressForSymbolication() { … }
bool StackFrame::ChangePC(addr_t pc) { … }
const char *StackFrame::Disassemble() { … }
Block *StackFrame::GetFrameBlock() { … }
const SymbolContext &
StackFrame::GetSymbolContext(SymbolContextItem resolve_scope) { … }
VariableList *StackFrame::GetVariableList(bool get_file_globals,
Status *error_ptr) { … }
VariableListSP
StackFrame::GetInScopeVariableList(bool get_file_globals,
bool must_have_valid_location) { … }
ValueObjectSP StackFrame::GetValueForVariableExpressionPath(
llvm::StringRef var_expr, DynamicValueType use_dynamic, uint32_t options,
VariableSP &var_sp, Status &error) { … }
bool StackFrame::GetFrameBaseValue(Scalar &frame_base, Status *error_ptr) { … }
DWARFExpressionList *StackFrame::GetFrameBaseExpression(Status *error_ptr) { … }
RegisterContextSP StackFrame::GetRegisterContext() { … }
bool StackFrame::HasDebugInformation() { … }
ValueObjectSP
StackFrame::GetValueObjectForFrameVariable(const VariableSP &variable_sp,
DynamicValueType use_dynamic) { … }
bool StackFrame::IsInlined() { … }
bool StackFrame::IsHistorical() const { … }
bool StackFrame::IsArtificial() const { … }
bool StackFrame::IsHidden() { … }
SourceLanguage StackFrame::GetLanguage() { … }
SourceLanguage StackFrame::GuessLanguage() { … }
namespace {
std::pair<const Instruction::Operand *, int64_t>
GetBaseExplainingValue(const Instruction::Operand &operand,
RegisterContext ®ister_context, lldb::addr_t value) { … }
std::pair<const Instruction::Operand *, int64_t>
GetBaseExplainingDereference(const Instruction::Operand &operand,
RegisterContext ®ister_context,
lldb::addr_t addr) { … }
}
lldb::ValueObjectSP StackFrame::GuessValueForAddress(lldb::addr_t addr) { … }
namespace {
ValueObjectSP GetValueForOffset(StackFrame &frame, ValueObjectSP &parent,
int64_t offset) { … }
ValueObjectSP GetValueForDereferincingOffset(StackFrame &frame,
ValueObjectSP &base,
int64_t offset) { … }
lldb::ValueObjectSP DoGuessValueAt(StackFrame &frame, ConstString reg,
int64_t offset, Disassembler &disassembler,
VariableList &variables, const Address &pc) { … }
}
lldb::ValueObjectSP StackFrame::GuessValueForRegisterAndOffset(ConstString reg,
int64_t offset) { … }
lldb::ValueObjectSP StackFrame::FindVariable(ConstString name) { … }
TargetSP StackFrame::CalculateTarget() { … }
ProcessSP StackFrame::CalculateProcess() { … }
ThreadSP StackFrame::CalculateThread() { … }
StackFrameSP StackFrame::CalculateStackFrame() { … }
void StackFrame::CalculateExecutionContext(ExecutionContext &exe_ctx) { … }
bool StackFrame::DumpUsingFormat(Stream &strm,
const FormatEntity::Entry *format,
llvm::StringRef frame_marker) { … }
void StackFrame::DumpUsingSettingsFormat(Stream *strm, bool show_unique,
const char *frame_marker) { … }
void StackFrame::Dump(Stream *strm, bool show_frame_index,
bool show_fullpaths) { … }
void StackFrame::UpdateCurrentFrameFromPreviousFrame(StackFrame &prev_frame) { … }
void StackFrame::UpdatePreviousFrameFromCurrentFrame(StackFrame &curr_frame) { … }
bool StackFrame::HasCachedData() const { … }
bool StackFrame::GetStatus(Stream &strm, bool show_frame_info, bool show_source,
bool show_unique, const char *frame_marker) { … }
RecognizedStackFrameSP StackFrame::GetRecognizedFrame() { … }