LLDB mainline
|
A class that describes a function. More...
#include "lldb/Symbol/Function.h"
Public Member Functions | |
Function (CompileUnit *comp_unit, lldb::user_id_t func_uid, lldb::user_id_t func_type_uid, const Mangled &mangled, Type *func_type, const AddressRange &range) | |
Construct with a compile unit, function UID, function type UID, optional mangled name, function type, and a section offset based address range. | |
~Function () override | |
Destructor. | |
void | CalculateSymbolContext (SymbolContext *sc) override |
Reconstruct the object's symbol context into sc. | |
lldb::ModuleSP | CalculateSymbolContextModule () override |
CompileUnit * | CalculateSymbolContextCompileUnit () override |
Function * | CalculateSymbolContextFunction () override |
const AddressRange & | GetAddressRange () |
lldb::LanguageType | GetLanguage () const |
void | GetStartLineSourceInfo (FileSpec &source_file, uint32_t &line_no) |
Find the file and line number of the source location of the start of the function. | |
void | GetEndLineSourceInfo (FileSpec &source_file, uint32_t &line_no) |
Find the file and line number of the source location of the end of the function. | |
llvm::ArrayRef< std::unique_ptr< CallEdge > > | GetCallEdges () |
Get the outgoing call edges from this function, sorted by their return PC addresses (in increasing order). | |
llvm::ArrayRef< std::unique_ptr< CallEdge > > | GetTailCallingEdges () |
Get the outgoing tail-calling edges from this function. | |
CallEdge * | GetCallEdgeForReturnAddress (lldb::addr_t return_pc, Target &target) |
Get the outgoing call edge from this function which has the given return address return_pc , or return nullptr. | |
Block & | GetBlock (bool can_create) |
Get accessor for the block list. | |
CompileUnit * | GetCompileUnit () |
Get accessor for the compile unit that owns this function. | |
const CompileUnit * | GetCompileUnit () const |
Get const accessor for the compile unit that owns this function. | |
void | GetDescription (Stream *s, lldb::DescriptionLevel level, Target *target) |
DWARFExpressionList & | GetFrameBaseExpression () |
Get accessor for the frame base location. | |
const DWARFExpressionList & | GetFrameBaseExpression () const |
Get const accessor for the frame base location. | |
ConstString | GetName () const |
ConstString | GetNameNoArguments () const |
ConstString | GetDisplayName () const |
const Mangled & | GetMangled () const |
CompilerDeclContext | GetDeclContext () |
Get the DeclContext for this function, if available. | |
std::vector< CompilerContext > | GetCompilerContext () |
Get the CompilerContext for this function, if available. | |
Type * | GetType () |
Get accessor for the type that describes the function return value type, and parameter types. | |
const Type * | GetType () const |
Get const accessor for the type that describes the function return value type, and parameter types. | |
CompilerType | GetCompilerType () |
uint32_t | GetPrologueByteSize () |
Get the size of the prologue instructions for this function. | |
void | Dump (Stream *s, bool show_context) const |
Dump a description of this object to a Stream. | |
void | DumpSymbolContext (Stream *s) override |
Dump the object's symbol context to the stream s. | |
size_t | MemorySize () const |
Get the memory cost of this object. | |
bool | GetIsOptimized () |
Get whether compiler optimizations were enabled for this function. | |
bool | IsTopLevelFunction () |
Get whether this function represents a 'top-level' function. | |
lldb::DisassemblerSP | GetInstructions (const ExecutionContext &exe_ctx, const char *flavor, bool force_live_memory=false) |
bool | GetDisassembly (const ExecutionContext &exe_ctx, const char *flavor, Stream &strm, bool force_live_memory=false) |
Public Member Functions inherited from lldb_private::UserID | |
UserID (lldb::user_id_t uid=LLDB_INVALID_UID) | |
Construct with optional user ID. | |
~UserID ()=default | |
Destructor. | |
void | Clear () |
Clears the object state. | |
lldb::user_id_t | GetID () const |
Get accessor for the user ID. | |
void | SetID (lldb::user_id_t uid) |
Set accessor for the user ID. | |
Public Member Functions inherited from lldb_private::SymbolContextScope | |
virtual | ~SymbolContextScope ()=default |
virtual void | CalculateSymbolContext (SymbolContext *sc)=0 |
Reconstruct the object's symbol context into sc. | |
virtual lldb::ModuleSP | CalculateSymbolContextModule () |
virtual CompileUnit * | CalculateSymbolContextCompileUnit () |
virtual Function * | CalculateSymbolContextFunction () |
virtual Block * | CalculateSymbolContextBlock () |
virtual Symbol * | CalculateSymbolContextSymbol () |
virtual void | DumpSymbolContext (Stream *s)=0 |
Dump the object's symbol context to the stream s. | |
Protected Types | |
enum | { flagsCalculatedPrologueSize = (1 << 0) } |
Protected Attributes | |
CompileUnit * | m_comp_unit |
The compile unit that owns this function. | |
lldb::user_id_t | m_type_uid |
The user ID of for the prototype Type for this function. | |
Type * | m_type |
The function prototype type for this function that includes the function info (FunctionInfo), return type and parameters. | |
Mangled | m_mangled |
The mangled function name if any. | |
Block | m_block |
All lexical blocks contained in this function. | |
AddressRange | m_range |
The function address range that covers the widest range needed to contain all blocks. | |
DWARFExpressionList | m_frame_base |
The frame base expression for variables that are relative to the frame pointer. | |
Flags | m_flags |
uint32_t | m_prologue_byte_size |
Compute the prologue size once and cache it. | |
std::mutex | m_call_edges_lock |
Exclusive lock that controls read/write access to m_call_edges and m_call_edges_resolved. | |
bool | m_call_edges_resolved = false |
Whether call site info has been parsed. | |
std::vector< std::unique_ptr< CallEdge > > | m_call_edges |
Outgoing call edges. | |
Protected Attributes inherited from lldb_private::UserID | |
lldb::user_id_t | m_uid |
The user ID that uniquely identifies an object. | |
Private Member Functions | |
Function (const Function &)=delete | |
const Function & | operator= (const Function &)=delete |
A class that describes a function.
Functions belong to CompileUnit objects (Function::m_comp_unit), have unique user IDs (Function::UserID), know how to reconstruct their symbol context (Function::SymbolContextScope), have a specific function type (Function::m_type_uid), have a simple method name (FunctionInfo::m_name), be declared at a specific location (FunctionInfo::m_declaration), possibly have mangled names (Function::m_mangled), an optional return type (Function::m_type), and contains lexical blocks (Function::m_blocks).
The function information is split into a few pieces:
The abstract information is found in the function type (Type) that describes a function information, return type and parameter types.
The concrete information is the address range information and specific locations for an instance of this function.
Definition at line 399 of file Function.h.
|
protected |
Enumerator | |
---|---|
flagsCalculatedPrologueSize | Whether we already tried to calculate the prologue size. |
Definition at line 630 of file Function.h.
Function::Function | ( | CompileUnit * | comp_unit, |
lldb::user_id_t | func_uid, | ||
lldb::user_id_t | func_type_uid, | ||
const Mangled & | mangled, | ||
Type * | func_type, | ||
const AddressRange & | range | ||
) |
Construct with a compile unit, function UID, function type UID, optional mangled name, function type, and a section offset based address range.
[in] | comp_unit | The compile unit to which this function belongs. |
[in] | func_uid | The UID for this function. This value is provided by the SymbolFile plug-in and can be any value that allows the plug-in to quickly find and parse more detailed information when and if more information is needed. |
[in] | func_type_uid | The type UID for the function Type to allow for lazy type parsing from the debug information. |
[in] | mangled | The optional mangled name for this function. If empty, there is no mangled information. |
[in] | func_type | The optional function type. If NULL, the function type will be parsed on demand when accessed using the Function::GetType() function by asking the SymbolFile plug-in to get the type for func_type_uid. |
[in] | range | The section offset based address for this function. |
Definition at line 258 of file Function.cpp.
References m_block, and lldb_private::Block::SetParentScope().
|
overridedefault |
Destructor.
|
privatedelete |
|
overridevirtual |
Reconstruct the object's symbol context into sc.
The object should fill in as much of the SymbolContext as it can so function calls that require a symbol context can be made for the given object.
[out] | sc | A symbol context object pointer that gets filled in. |
Implements lldb_private::SymbolContextScope.
Definition at line 438 of file Function.cpp.
References lldb_private::CompileUnit::CalculateSymbolContext(), lldb_private::SymbolContext::function, and m_comp_unit.
Referenced by GetType(), and lldb_private::StackFrameList::SynthesizeTailCallFrames().
|
overridevirtual |
Reimplemented from lldb_private::SymbolContextScope.
Definition at line 451 of file Function.cpp.
References GetCompileUnit().
|
overridevirtual |
Reimplemented from lldb_private::SymbolContextScope.
Definition at line 455 of file Function.cpp.
|
overridevirtual |
Reimplemented from lldb_private::SymbolContextScope.
Definition at line 443 of file Function.cpp.
References lldb_private::AddressRange::GetBaseAddress(), GetCompileUnit(), lldb_private::ModuleChild::GetModule(), lldb_private::Address::GetSection(), and m_range.
Referenced by GetBlock(), GetCompilerContext(), GetDeclContext(), and lldb_private::plugin::dwarf::SymbolFileDWARF::GetFunction().
void Function::Dump | ( | Stream * | s, |
bool | show_context | ||
) | const |
Dump a description of this object to a Stream.
Dump a description of the contents of this object to the supplied stream s.
[in] | s | The stream to which to dump the object description. |
[in] | show_context | If true, variables will dump their symbol context information. |
Definition at line 419 of file Function.cpp.
References lldb_private::Block::BlockInfoHasBeenParsed(), lldb_private::Mangled::Dump(), lldb_private::Block::Dump(), lldb_private::Stream::EOL(), lldb_private::AddressRange::GetBaseAddress(), lldb_private::Address::GetFileAddress(), lldb_private::Stream::Indent(), LLDB_INVALID_UID, m_block, m_mangled, m_range, m_type, m_type_uid, and lldb_private::Stream::Printf().
|
overridevirtual |
Dump the object's symbol context to the stream s.
The object should dump its symbol context to the stream s. This function is widely used in the DumpDebug and verbose output for lldb objects.
[in] | s | The stream to which to dump the object's symbol context. |
Implements lldb_private::SymbolContextScope.
Definition at line 491 of file Function.cpp.
References lldb_private::CompileUnit::DumpSymbolContext(), lldb_private::UserID::GetID(), m_comp_unit, and lldb_private::Stream::Printf().
Referenced by lldb_private::ClangExpressionDeclMap::AddOneFunction(), and lldb_private::Block::DumpSymbolContext().
|
inline |
Definition at line 447 of file Function.h.
References m_range.
Referenced by lldb_private::BreakpointResolver::AddLocation(), lldb_private::ClangExpressionDeclMap::AddOneFunction(), lldb_private::Block::AddRange(), lldb_private::DynamicLoaderDarwin::AlwaysRelyOnEHUnwindInfo(), DynamicLoaderPOSIXDYLD::AlwaysRelyOnEHUnwindInfo(), lldb_private::npdb::SymbolFileNativePDB::CreateBlock(), lldb_private::npdb::SymbolFileNativePDB::CreateLocalVariable(), lldb_private::Disassembler::Disassemble(), CommandObjectThreadUntil::DoExecute(), lldb_private::SymbolContext::Dump(), DumpAddressOffsetFromFunction(), lldb_private::Variable::DumpLocations(), lldb_private::SymbolContext::DumpStopContext(), lldb_private::Module::FindFunctions(), lldb_private::SearchFilter::FunctionPasses(), lldb_private::SymbolContext::GetAddressRange(), lldb_private::ArchitectureMips::GetBreakableLoadAddress(), lldb_private::CommandObjectDisassemble::GetCurrentFunctionRanges(), lldb::SBBlock::GetDescription(), lldb_private::Block::GetDescription(), GetDescription(), lldb::SBFunction::GetEndAddress(), GetEndLineSourceInfo(), lldb_private::StackFrame::GetFrameBaseValue(), lldb_private::SymbolContext::GetFunctionStartLineEntry(), GetInstructions(), lldb::SBFunction::GetInstructions(), lldb_private::CallEdge::GetLoadAddress(), GetPrologueByteSize(), lldb_private::Block::GetRangeAtIndex(), lldb_private::Block::GetRangeContainingAddress(), lldb_private::Block::GetRangeIndexContainingAddress(), lldb::SBFunction::GetRanges(), lldb_private::Block::GetRanges(), lldb::SBFunction::GetStartAddress(), lldb_private::Block::GetStartAddress(), GetStartLineSourceInfo(), lldb_private::StackFrame::GuessValueForRegisterAndOffset(), lldb_private::ThreadPlanStepRange::InSymbol(), lldb_private::Variable::LocationIsValidForAddress(), lldb_private::Variable::LocationIsValidForFrame(), lldb_private::DWARFExpressionList::MatchesOperand(), lldb_private::breakpad::SymbolFileBreakpad::ParseBlocksRecursive(), RemoveFunctionsWithModuleNotEqualTo(), lldb_private::plugin::dwarf::SymbolFileDWARF::ResolveFunction(), lldb_private::ThreadPlanStepInRange::ShouldStop(), lldb::SBThread::StepOverUntil(), and lldb_private::ValueObjectVariable::UpdateValue().
Block & Function::GetBlock | ( | bool | can_create | ) |
Get accessor for the block list.
Definition at line 371 of file Function.cpp.
References lldb_private::Block::BlockInfoHasBeenParsed(), CalculateSymbolContextModule(), GetName(), lldb_private::FileSpec::GetPath(), lldb_private::CompileUnit::GetPrimaryFile(), m_block, m_comp_unit, lldb_private::Debugger::ReportError(), and lldb_private::Block::SetBlockInfoHasBeenParsed().
Referenced by lldb_private::FormatEntity::Format(), lldb::SBFunction::GetArgumentName(), lldb::SBFunction::GetBlock(), GetCallEdges(), lldb_private::StackFrameList::GetFrameAtIndex(), lldb_private::StackFrame::GetFrameBlock(), lldb_private::SymbolContext::GetFunctionBlock(), lldb_private::CPlusPlusLanguage::GetFunctionDisplayName(), InferPromiseType(), lldb_private::breakpad::SymbolFileBreakpad::ParseBlocksRecursive(), lldb_private::plugin::dwarf::SymbolFileDWARF::ParseBlocksRecursive(), SymbolFilePDB::ParseBlocksRecursive(), lldb_private::plugin::dwarf::SymbolFileDWARF::ParseVariableDIE(), SymbolFilePDB::ParseVariableForPDBData(), SymbolFilePDB::ParseVariables(), SymbolFilePDB::ParseVariablesForContext(), lldb_private::plugin::dwarf::SymbolFileDWARF::ParseVariablesForContext(), lldb_private::plugin::dwarf::SymbolFileDWARF::ParseVariablesInFunctionContextRecursive(), lldb_private::plugin::dwarf::SymbolFileDWARF::ResolveFunction(), lldb_private::plugin::dwarf::SymbolFileDWARF::ResolveFunctionAndBlock(), and DWARFASTParserClang::UpdateSymbolContextScopeForType().
CallEdge * Function::GetCallEdgeForReturnAddress | ( | lldb::addr_t | return_pc, |
Target & | target | ||
) |
Get the outgoing call edge from this function which has the given return address return_pc
, or return nullptr.
Note that this will not return a tail-calling edge.
Definition at line 356 of file Function.cpp.
References GetCallEdges().
Referenced by Evaluate_DW_OP_entry_value(), and FindInterveningFrames().
llvm::ArrayRef< std::unique_ptr< CallEdge > > Function::GetCallEdges | ( | ) |
Get the outgoing call edges from this function, sorted by their return PC addresses (in increasing order).
Definition at line 319 of file Function.cpp.
References GetBlock(), GetDisplayName(), lldb_private::UserID::GetID(), lldb_private::GetLog(), lldb_private::Block::GetSymbolFile(), LLDB_LOG, m_call_edges, m_call_edges_lock, m_call_edges_resolved, lldb_private::SymbolFile::ParseCallEdgesInFunction(), and lldb_private::Step.
Referenced by FindInterveningFrames(), GetCallEdgeForReturnAddress(), and GetTailCallingEdges().
std::vector< CompilerContext > Function::GetCompilerContext | ( | ) |
Get the CompilerContext for this function, if available.
Definition at line 532 of file Function.cpp.
References CalculateSymbolContextModule(), and lldb_private::UserID::GetID().
Referenced by GetDescription().
CompilerType Function::GetCompilerType | ( | ) |
Definition at line 560 of file Function.cpp.
References lldb_private::Type::GetFullCompilerType(), and GetType().
Referenced by lldb_private::ThreadPlanStepOut::CalculateReturnValue(), lldb_private::ClangFunctionCaller::CompileFunction(), lldb_private::Thread::ReturnFromFrame(), and ValueObjectVTableChild::UpdateValue().
CompileUnit * Function::GetCompileUnit | ( | ) |
Get accessor for the compile unit that owns this function.
Definition at line 386 of file Function.cpp.
References m_comp_unit.
Referenced by lldb_private::ClangExpressionDeclMap::AddOneFunction(), CalculateSymbolContextCompileUnit(), CalculateSymbolContextModule(), lldb::SBFunction::GetIsOptimized(), lldb::SBFunction::GetLanguage(), lldb_private::breakpad::SymbolFileBreakpad::ParseBlocksRecursive(), lldb_private::plugin::dwarf::SymbolFileDWARF::ParseBlocksRecursive(), and lldb_private::plugin::dwarf::SymbolFileDWARFDebugMap::ParseBlocksRecursive().
const CompileUnit * Function::GetCompileUnit | ( | ) | const |
Get const accessor for the compile unit that owns this function.
Definition at line 388 of file Function.cpp.
References m_comp_unit.
CompilerDeclContext Function::GetDeclContext | ( | ) |
Get the DeclContext for this function, if available.
Definition at line 525 of file Function.cpp.
References CalculateSymbolContextModule(), and lldb_private::UserID::GetID().
Referenced by lldb_private::ClangExpressionDeclMap::AddOneFunction(), and lldb_private::ClangExpressionDeclMap::SearchFunctionsInSymbolContexts().
void Function::GetDescription | ( | Stream * | s, |
lldb::DescriptionLevel | level, | ||
Target * | target | ||
) |
Definition at line 390 of file Function.cpp.
References lldb_private::Stream::AsRawOstream(), lldb_private::AddressRange::Dump(), lldb_private::Address::DumpStyleFileAddress, lldb_private::Address::DumpStyleLoadAddress, lldb_private::Address::DumpStyleModuleWithFileAddress, lldb::eDescriptionLevelVerbose, GetAddressRange(), GetCompilerContext(), lldb_private::Mangled::GetMangledName(), GetName(), and m_mangled.
Referenced by lldb_private::SymbolContext::GetDescription().
bool Function::GetDisassembly | ( | const ExecutionContext & | exe_ctx, |
const char * | flavor, | ||
Stream & | strm, | ||
bool | force_live_memory = false |
||
) |
Definition at line 469 of file Function.cpp.
References GetInstructions().
ConstString Function::GetDisplayName | ( | ) | const |
Definition at line 521 of file Function.cpp.
References lldb_private::Mangled::GetDisplayDemangledName(), and m_mangled.
Referenced by lldb_private::SymbolContext::DumpStopContext(), FindInterveningFrames(), GetCallEdges(), lldb::SBFrame::GetDisplayFunctionName(), and lldb_private::StackFrameList::SynthesizeTailCallFrames().
void Function::GetEndLineSourceInfo | ( | FileSpec & | source_file, |
uint32_t & | line_no | ||
) |
Find the file and line number of the source location of the end of the function.
[out] | source_file | The source file. |
[out] | line_no | The line number. |
Definition at line 298 of file Function.cpp.
References lldb_private::FileSpec::Clear(), lldb_private::LineTable::FindLineEntryByAddress(), GetAddressRange(), lldb_private::LineEntry::GetFile(), lldb_private::CompileUnit::GetLineTable(), lldb_private::Address::GetOffset(), lldb_private::LineEntry::line, m_comp_unit, and lldb_private::Address::SetOffset().
Referenced by CommandObjectSourceList::DisplayFunctionSource().
|
inline |
Get accessor for the frame base location.
Definition at line 514 of file Function.h.
References m_frame_base.
Referenced by lldb_private::StackFrame::GetFrameBaseExpression(), and lldb_private::StackFrame::GetFrameBaseValue().
|
inline |
Get const accessor for the frame base location.
Definition at line 520 of file Function.h.
References m_frame_base.
lldb::DisassemblerSP Function::GetInstructions | ( | const ExecutionContext & | exe_ctx, |
const char * | flavor, | ||
bool | force_live_memory = false |
||
) |
Definition at line 457 of file Function.cpp.
References lldb_private::Disassembler::DisassembleRange(), GetAddressRange(), lldb_private::ExecutionContext::GetTargetRef(), and lldb_private::ExecutionContext::HasTargetScope().
Referenced by CalculateDisass(), and GetDisassembly().
bool Function::GetIsOptimized | ( | ) |
Get whether compiler optimizations were enabled for this function.
The debug information may provide information about whether this function was compiled with optimization or not. In this case, "optimized" means that the debug experience may be difficult for the user to understand. Variables may not be available when the developer would expect them, stepping through the source lines in the function may appear strange, etc.
Definition at line 501 of file Function.cpp.
References lldb_private::CompileUnit::GetIsOptimized(), and m_comp_unit.
Referenced by lldb_private::FormatEntity::Format(), and lldb_private::Process::PrintWarningOptimization().
lldb::LanguageType Function::GetLanguage | ( | ) | const |
Definition at line 682 of file Function.cpp.
References lldb::eLanguageTypeUnknown, lldb_private::CompileUnit::GetLanguage(), lldb_private::Mangled::GuessLanguage(), m_comp_unit, and m_mangled.
Referenced by lldb_private::FormatEntity::Format(), lldb_private::SymbolContext::GetLanguage(), and IsTopLevelFunction().
|
inline |
Definition at line 528 of file Function.h.
References m_mangled.
Referenced by lldb_private::ClangExpressionDeclMap::AddOneFunction(), lldb_private::FormatEntity::Format(), lldb_private::Debugger::FormatDisassemblerAddress(), lldb_private::BreakpointLocation::GetDescription(), lldb::SBFunction::GetDisplayName(), lldb_private::SymbolContext::GetFunctionName(), lldb::SBFunction::GetMangledName(), lldb_private::StackFrame::GuessLanguage(), and lldb_private::SymbolContextSpecifier::SymbolContextMatches().
ConstString Function::GetName | ( | ) | const |
Definition at line 693 of file Function.cpp.
References lldb_private::Mangled::GetName(), and m_mangled.
Referenced by lldb_private::SymbolContext::DumpStopContext(), Evaluate_DW_OP_entry_value(), lldb_private::FormatEntity::Format(), GetBlock(), lldb::SBFunction::GetDescription(), lldb_private::BreakpointLocation::GetDescription(), GetDescription(), lldb_private::CPlusPlusLanguage::GetFunctionDisplayName(), lldb::SBFrame::GetFunctionName(), lldb::SBFunction::GetName(), GetSymbolOrFunctionName(), lldb_private::RegisterContextUnwind::IsTrapHandlerSymbol(), lldb_private::ClangExpressionDeclMap::SearchFunctionsInSymbolContexts(), and SymbolContextsMightBeEquivalent().
ConstString Function::GetNameNoArguments | ( | ) | const |
Definition at line 697 of file Function.cpp.
References lldb_private::Mangled::ePreferDemangledWithoutArguments, lldb_private::Mangled::GetName(), and m_mangled.
Referenced by lldb_private::SymbolContext::DumpStopContext(), and lldb_private::FormatEntity::Format().
uint32_t Function::GetPrologueByteSize | ( | ) |
Get the size of the prologue instructions for this function.
The "prologue" instructions include any instructions given line number 0 immediately following the prologue end.
Definition at line 567 of file Function.cpp.
References lldb_private::LineTable::FindLineEntryByAddress(), flagsCalculatedPrologueSize, GetAddressRange(), lldb_private::AddressRange::GetBaseAddress(), lldb_private::AddressRange::GetByteSize(), lldb_private::Address::GetFileAddress(), lldb_private::LineTable::GetLineEntryAtIndex(), lldb_private::CompileUnit::GetLineTable(), lldb_private::LineEntry::is_prologue_end, lldb_private::Flags::IsClear(), lldb_private::LineEntry::line, LLDB_INVALID_ADDRESS, m_comp_unit, m_flags, m_prologue_byte_size, m_range, lldb_private::LineEntry::range, lldb_private::Flags::Set(), and UINT32_MAX.
Referenced by lldb_private::BreakpointResolver::AddLocation(), lldb::SBFunction::GetPrologueByteSize(), lldb_private::Symbol::GetPrologueByteSize(), and lldb_private::ThreadPlanStepInRange::ShouldStop().
void Function::GetStartLineSourceInfo | ( | FileSpec & | source_file, |
uint32_t & | line_no | ||
) |
Find the file and line number of the source location of the start of the function.
This will use the declaration if present and fall back on the line table if that fails. So there may NOT be a line table entry for this source file/line combo.
[out] | source_file | The source file. |
[out] | line_no | The line number. |
Definition at line 270 of file Function.cpp.
References lldb_private::FileSpec::Clear(), lldb_private::LineTable::FindLineEntryByAddress(), GetAddressRange(), lldb_private::Type::GetDeclaration(), lldb_private::Declaration::GetFile(), lldb_private::LineEntry::GetFile(), lldb_private::Declaration::GetLine(), lldb_private::CompileUnit::GetLineTable(), GetType(), lldb_private::LineEntry::line, m_comp_unit, and m_type.
Referenced by CommandObjectSourceList::DisplayFunctionSource(), lldb_private::BreakpointResolverFileLine::FilterContexts(), lldb_private::Disassembler::GetFunctionDeclLineEntry(), lldb_private::StackFrame::GetStatus(), and lldb_private::Disassembler::PrintInstructions().
llvm::ArrayRef< std::unique_ptr< CallEdge > > Function::GetTailCallingEdges | ( | ) |
Get the outgoing tail-calling edges from this function.
If none exist, return std::nullopt.
Definition at line 349 of file Function.cpp.
References GetCallEdges().
Referenced by Evaluate_DW_OP_entry_value(), and FindInterveningFrames().
Type * Function::GetType | ( | ) |
Get accessor for the type that describes the function return value type, and parameter types.
Definition at line 539 of file Function.cpp.
References CalculateSymbolContext(), m_type, m_type_uid, lldb_private::SymbolContext::module_sp, and lldb_private::SymbolFile::ResolveTypeUID().
Referenced by lldb_private::ClangExpressionDeclMap::AddOneFunction(), lldb_private::Block::AddRange(), lldb_private::SymbolContext::Dump(), GetCompilerType(), lldb::SBFunction::GetDescription(), lldb_private::SymbolContext::GetDescription(), GetStartLineSourceInfo(), lldb::SBFunction::GetType(), lldb_private::Thread::ReturnFromFrame(), and lldb_private::ClangExpressionDeclMap::SearchFunctionsInSymbolContexts().
const Type * Function::GetType | ( | ) | const |
Get const accessor for the type that describes the function return value type, and parameter types.
Definition at line 558 of file Function.cpp.
References m_type.
bool Function::IsTopLevelFunction | ( | ) |
Get whether this function represents a 'top-level' function.
The concept of a top-level function is language-specific, mostly meant to represent the notion of scripting-style code that has global visibility of the variables/symbols/functions/... defined within the containing file/module
If stopped in a top-level function, LLDB will expose global variables as-if locals in the 'frame variable' command
Definition at line 512 of file Function.cpp.
References lldb_private::Language::FindPlugin(), and GetLanguage().
Referenced by CommandObjectFrameVariable::DoExecute().
size_t Function::MemorySize | ( | ) | const |
Get the memory cost of this object.
Definition at line 496 of file Function.cpp.
References m_block, and lldb_private::Block::MemorySize().
|
protected |
All lexical blocks contained in this function.
Definition at line 650 of file Function.h.
Referenced by Dump(), Function(), GetBlock(), and MemorySize().
|
protected |
|
protected |
Exclusive lock that controls read/write access to m_call_edges and m_call_edges_resolved.
Definition at line 667 of file Function.h.
Referenced by GetCallEdges().
|
protected |
Whether call site info has been parsed.
Definition at line 670 of file Function.h.
Referenced by GetCallEdges().
|
protected |
The compile unit that owns this function.
Definition at line 636 of file Function.h.
Referenced by CalculateSymbolContext(), DumpSymbolContext(), GetBlock(), GetCompileUnit(), GetEndLineSourceInfo(), GetIsOptimized(), GetLanguage(), GetPrologueByteSize(), and GetStartLineSourceInfo().
|
protected |
Definition at line 660 of file Function.h.
Referenced by GetPrologueByteSize().
|
protected |
The frame base expression for variables that are relative to the frame pointer.
Definition at line 658 of file Function.h.
Referenced by GetFrameBaseExpression().
|
protected |
The mangled function name if any.
If empty, there is no mangled information.
Definition at line 647 of file Function.h.
Referenced by Dump(), GetDescription(), GetDisplayName(), GetLanguage(), GetMangled(), GetName(), and GetNameNoArguments().
|
protected |
Compute the prologue size once and cache it.
Definition at line 663 of file Function.h.
Referenced by GetPrologueByteSize().
|
protected |
The function address range that covers the widest range needed to contain all blocks.
Definition at line 654 of file Function.h.
Referenced by CalculateSymbolContextModule(), Dump(), GetAddressRange(), and GetPrologueByteSize().
|
protected |
The function prototype type for this function that includes the function info (FunctionInfo), return type and parameters.
Definition at line 643 of file Function.h.
Referenced by Dump(), GetStartLineSourceInfo(), and GetType().
|
protected |
The user ID of for the prototype Type for this function.
Definition at line 639 of file Function.h.