LLDB mainline
|
A class that describes the declaration location of a lldb object. More...
#include "lldb/Core/Declaration.h"
Public Member Functions | |
Declaration ()=default | |
Default constructor. | |
Declaration (const FileSpec &file_spec, uint32_t line=0, uint16_t column=LLDB_INVALID_COLUMN_NUMBER) | |
Construct with file specification, and optional line and column. | |
Declaration (const Declaration *decl_ptr) | |
Construct with a pointer to another Declaration object. | |
void | Clear () |
Clear the object's state. | |
bool | FileAndLineEqual (const Declaration &declaration) const |
Checks if this object has the same file and line as another declaration object. | |
void | Dump (Stream *s, bool show_fullpaths) const |
Dump a description of this object to a Stream. | |
bool | DumpStopContext (Stream *s, bool show_fullpaths) const |
FileSpec & | GetFile () |
Get accessor for file specification. | |
const FileSpec & | GetFile () const |
Get const accessor for file specification. | |
uint32_t | GetLine () const |
Get accessor for the declaration line number. | |
uint16_t | GetColumn () const |
Get accessor for the declaration column number. | |
operator bool () const | |
Convert to boolean operator. | |
bool | IsValid () const |
size_t | MemorySize () const |
Get the memory cost of this object. | |
void | SetFile (const FileSpec &file_spec) |
Set accessor for the declaration file specification. | |
void | SetLine (uint32_t line) |
Set accessor for the declaration line number. | |
void | SetColumn (uint16_t column) |
Set accessor for the declaration column number. | |
Static Public Member Functions | |
static int | Compare (const Declaration &lhs, const Declaration &rhs) |
Compare two declaration objects. | |
Protected Attributes | |
FileSpec | m_file |
The file specification that points to the source file where the declaration occurred. | |
uint32_t | m_line = 0 |
Non-zero values indicates a valid line number, zero indicates no line number information is available. | |
uint16_t | m_column = LLDB_INVALID_COLUMN_NUMBER |
Non-zero values indicates a valid column number, zero indicates no column information is available. | |
A class that describes the declaration location of a lldb object.
The declarations include the file specification, line number, and the column info and can help track where functions, blocks, inlined functions, types, variables, any many other debug core objects were declared.
Definition at line 24 of file Declaration.h.
|
default |
Default constructor.
Referenced by MemorySize().
|
inline |
Construct with file specification, and optional line and column.
[in] | file_spec | The file specification that describes where this was declared. |
[in] | line | The line number that describes where this was declared. Set to zero if there is no line number information. |
[in] | column | The column number that describes where this was declared. Set to zero if there is no column number information. |
Definition at line 42 of file Declaration.h.
|
inline |
Construct with a pointer to another Declaration object.
Definition at line 47 of file Declaration.h.
|
inline |
Clear the object's state.
Sets the file specification to be empty, and the line and column to zero.
Definition at line 57 of file Declaration.h.
References lldb_private::FileSpec::Clear(), m_column, m_file, and m_line.
Referenced by lldb_private::ValueObject::GetDeclaration(), and DWARFASTParserClang::GetUniqueTypeNameAndDeclaration().
|
static |
Compare two declaration objects.
Compares the two file specifications from lhs and rhs. If the file specifications are equal, then continue to compare the line number and column numbers respectively.
[in] | lhs | The Left Hand Side const Declaration object reference. |
[in] | rhs | The Right Hand Side const Declaration object reference. |
Definition at line 58 of file Declaration.cpp.
References lldb_private::FileSpec::Compare(), m_column, m_file, and m_line.
Referenced by lldb_private::FunctionInfo::Compare(), lldb_private::SourceLocationSpec::Compare(), lldb::SBDeclaration::operator!=(), and lldb::SBDeclaration::operator==().
void Declaration::Dump | ( | Stream * | s, |
bool | show_fullpaths | ||
) | 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. |
Definition at line 14 of file Declaration.cpp.
References lldb_private::FileSpec::GetFilename(), LLDB_INVALID_COLUMN_NUMBER, m_column, m_file, m_line, and lldb_private::Stream::Printf().
Referenced by lldb_private::SourceLocationSpec::Dump(), lldb_private::Variable::Dump(), lldb_private::Type::Dump(), lldb_private::FunctionInfo::Dump(), and lldb_private::Type::GetDescription().
bool Declaration::DumpStopContext | ( | Stream * | s, |
bool | show_fullpaths | ||
) | const |
Definition at line 35 of file Declaration.cpp.
References lldb_private::ConstString::Dump(), lldb_private::FileSpec::GetFilename(), LLDB_INVALID_COLUMN_NUMBER, m_column, m_file, m_line, and lldb_private::Stream::Printf().
Referenced by lldb_private::Variable::DumpDeclaration(), and lldb::SBValue::Watch().
bool Declaration::FileAndLineEqual | ( | const Declaration & | declaration | ) | const |
Checks if this object has the same file and line as another declaration object.
[in] | declaration | The const Declaration object to compare with. |
Definition at line 73 of file Declaration.cpp.
References lldb_private::FileSpec::Compare(), m_file, and m_line.
|
inline |
Get accessor for the declaration column number.
Definition at line 127 of file Declaration.h.
References m_column.
Referenced by lldb_private::SourceLocationSpec::GetColumn(), lldb::SBBlock::GetInlinedCallSiteColumn(), lldb_private::SymbolContext::GetParentOfInlinedScope(), and lldb_private::operator==().
|
inline |
Get accessor for file specification.
Definition at line 107 of file Declaration.h.
References m_file.
Referenced by lldb_private::Block::AddRange(), lldb_private::BreakpointResolverFileLine::FilterContexts(), lldb_private::SourceLocationSpec::GetFileSpec(), lldb::SBBlock::GetInlinedCallSiteFile(), lldb_private::InstrumentationRuntimeTSan::GetLocationDescription(), lldb_private::SymbolContext::GetParentOfInlinedScope(), lldb_private::Function::GetStartLineSourceInfo(), lldb_private::operator==(), lldb_private::SymbolContextSpecifier::SymbolContextMatches(), and lldb::SBValue::Watch().
|
inline |
Get const accessor for file specification.
Definition at line 113 of file Declaration.h.
References m_file.
|
inline |
Get accessor for the declaration line number.
Definition at line 120 of file Declaration.h.
References m_line.
Referenced by lldb_private::Block::AddRange(), lldb_private::BreakpointResolverFileLine::FilterContexts(), lldb::SBBlock::GetInlinedCallSiteLine(), lldb_private::SourceLocationSpec::GetLine(), lldb_private::InstrumentationRuntimeTSan::GetLocationDescription(), lldb_private::SymbolContext::GetParentOfInlinedScope(), lldb_private::Function::GetStartLineSourceInfo(), and lldb_private::operator==().
|
inline |
Definition at line 145 of file Declaration.h.
References LLDB_INVALID_LINE_NUMBER, m_file, and m_line.
Referenced by lldb_private::BreakpointResolverFileLine::FilterContexts(), operator bool(), and lldb_private::plugin::dwarf::UniqueDWARFASTType::UpdateToDefDIE().
size_t Declaration::MemorySize | ( | ) | const |
Get the memory cost of this object.
Definition at line 56 of file Declaration.cpp.
References Declaration().
Referenced by lldb_private::FunctionInfo::MemorySize().
|
inlineexplicit |
Convert to boolean operator.
This allows code to check a Declaration object to see if it contains anything valid using code such as:
Definition at line 143 of file Declaration.h.
References IsValid().
|
inline |
Set accessor for the declaration column number.
[in] | column | Non-zero indicates a valid column number, zero indicates no column information is available. |
Definition at line 175 of file Declaration.h.
References m_column.
Referenced by AddSourceInfoToDecl(), DWARFASTParserClang::ParseChildEnumerators(), ParsedDWARFTypeAttributes::ParsedDWARFTypeAttributes(), lldb_private::plugin::dwarf::SymbolFileDWARF::ParseVariableDIE(), SymbolFilePDB::ParseVariableForPDBData(), and lldb::SBDeclaration::SetColumn().
|
inline |
Set accessor for the declaration file specification.
[in] | file_spec | The new declaration file specification. |
Definition at line 161 of file Declaration.h.
References m_file.
Referenced by AddSourceInfoToDecl(), DWARFASTParserClang::ParseChildEnumerators(), ParsedDWARFTypeAttributes::ParsedDWARFTypeAttributes(), lldb_private::plugin::dwarf::SymbolFileDWARF::ParseVariableDIE(), SymbolFilePDB::ParseVariableForPDBData(), and lldb::SBDeclaration::SetFileSpec().
|
inline |
Set accessor for the declaration line number.
[in] | line | Non-zero indicates a valid line number, zero indicates no line information is available. |
Definition at line 168 of file Declaration.h.
References m_line.
Referenced by AddSourceInfoToDecl(), DWARFASTParserClang::ParseChildEnumerators(), ParsedDWARFTypeAttributes::ParsedDWARFTypeAttributes(), lldb_private::plugin::dwarf::SymbolFileDWARF::ParseVariableDIE(), SymbolFilePDB::ParseVariableForPDBData(), and lldb::SBDeclaration::SetLine().
|
protected |
Non-zero values indicates a valid column number, zero indicates no column information is available.
Definition at line 186 of file Declaration.h.
Referenced by Clear(), Compare(), Dump(), DumpStopContext(), GetColumn(), and SetColumn().
|
protected |
The file specification that points to the source file where the declaration occurred.
Definition at line 180 of file Declaration.h.
Referenced by Clear(), Compare(), Dump(), DumpStopContext(), FileAndLineEqual(), GetFile(), IsValid(), and SetFile().
|
protected |
Non-zero values indicates a valid line number, zero indicates no line number information is available.
Definition at line 183 of file Declaration.h.
Referenced by Clear(), Compare(), Dump(), DumpStopContext(), FileAndLineEqual(), GetLine(), IsValid(), and SetLine().