LLDB mainline
|
"lldb/Core/SourceLocationSpec.h" A source location specifier class. More...
#include <SourceLocationSpec.h>
Public Member Functions | |
SourceLocationSpec (FileSpec file_spec, uint32_t line, std::optional< uint16_t > column=std::nullopt, bool check_inlines=false, bool exact_match=false) | |
Constructor. | |
SourceLocationSpec ()=delete | |
operator bool () const | |
Convert to boolean operator. | |
bool | operator! () const |
Logical NOT operator. | |
bool | operator== (const SourceLocationSpec &rhs) const |
Equal to operator. | |
bool | operator!= (const SourceLocationSpec &rhs) const |
Not equal to operator. | |
bool | operator< (const SourceLocationSpec &rhs) const |
Less than to operator. | |
void | Dump (Stream &s) const |
Dump this object to a Stream. | |
std::string | GetString () const |
FileSpec | GetFileSpec () const |
std::optional< uint32_t > | GetLine () const |
std::optional< uint16_t > | GetColumn () const |
bool | GetCheckInlines () const |
bool | GetExactMatch () const |
Static Public Member Functions | |
static int | Compare (const SourceLocationSpec &lhs, const SourceLocationSpec &rhs) |
Compare two SourceLocationSpec objects. | |
static bool | Equal (const SourceLocationSpec &lhs, const SourceLocationSpec &rhs, bool full) |
Protected Attributes | |
Declaration | m_declaration |
bool | m_check_inlines |
Tells if the resolver should look in inlined declaration. | |
bool | m_exact_match |
Tells if the resolver should look for an exact match. | |
"lldb/Core/SourceLocationSpec.h" A source location specifier class.
A source location specifier class that holds a Declaration object containing a FileSpec with line and column information. The column line is optional. It also holds search flags that can be fetched by resolvers to look inlined declarations and/or exact matches.
Definition at line 27 of file SourceLocationSpec.h.
|
explicit |
Constructor.
Takes a file_spec with a line number and a column number. If column is null or not provided, it is set to std::nullopt.
[in] | file_spec | The full or partial path to a file. |
[in] | line | The line number in the source file. |
[in] | column | The column number in the line of the source file. |
[in] | check_inlines | Whether to look for a match in inlined declaration. |
[in] | exact_match | Whether to look for an exact match. |
Definition at line 17 of file SourceLocationSpec.cpp.
|
delete |
|
static |
Compare two SourceLocationSpec objects.
If full is true, then the file_spec, the line and column must match. If full is false, then only the file_spec and line number for lhs and rhs are compared. This allows a SourceLocationSpec object that have no column information to match a SourceLocationSpec objects that have column information with matching file_spec and line component.
[in] | lhs | A const reference to the Left Hand Side object to compare. |
[in] | rhs | A const reference to the Right Hand Side object to compare. |
[in] | full | If true, then the file_spec, the line and column must match for a compare to return zero (equal to). If false, then only the file_spec and line number for lhs and rhs are compared, else a full comparison is done. |
Definition at line 47 of file SourceLocationSpec.cpp.
References lldb_private::Declaration::Compare(), and m_declaration.
Referenced by operator<().
void SourceLocationSpec::Dump | ( | Stream & | s | ) | const |
Dump this object to a Stream.
Dump the object to the supplied stream s, starting with the file name, then the line number and if available the column number.
[in] | s | The stream to which to dump the object description. |
Definition at line 59 of file SourceLocationSpec.cpp.
References lldb_private::Declaration::Dump(), m_check_inlines, m_declaration, and m_exact_match.
Referenced by GetString(), and lldb_private::operator<<().
|
static |
Definition at line 52 of file SourceLocationSpec.cpp.
References GetFileSpec(), and GetLine().
|
inline |
Definition at line 172 of file SourceLocationSpec.h.
References m_check_inlines.
Referenced by operator==(), lldb_private::CompileUnit::ResolveSymbolContext(), and lldb_private::BreakpointResolverFileLine::SerializeToStructuredData().
std::optional< uint16_t > SourceLocationSpec::GetColumn | ( | ) | const |
Definition at line 78 of file SourceLocationSpec.cpp.
References lldb_private::Declaration::GetColumn(), LLDB_INVALID_COLUMN_NUMBER, and m_declaration.
Referenced by lldb_private::LineTable::FindLineEntryIndexByFileIndexImpl(), lldb_private::BreakpointResolverFileLine::GetDescription(), lldb_private::CompileUnit::ResolveSymbolContext(), lldb_private::BreakpointResolverFileLine::SearchCallback(), and lldb_private::BreakpointResolverFileLine::SerializeToStructuredData().
|
inline |
Definition at line 174 of file SourceLocationSpec.h.
References m_exact_match.
Referenced by lldb_private::BreakpointResolverFileLine::FilterContexts(), lldb_private::LineTable::FindLineEntryIndexByFileIndexImpl(), lldb_private::BreakpointResolverFileLine::GetDescription(), operator==(), and lldb_private::BreakpointResolverFileLine::SerializeToStructuredData().
|
inline |
Definition at line 166 of file SourceLocationSpec.h.
References lldb_private::Declaration::GetFile(), and m_declaration.
Referenced by lldb_private::BreakpointResolverFileLine::DeduceSourceMapping(), Equal(), lldb_private::BreakpointResolverFileLine::GetDescription(), lldb_private::AddressResolverFileLine::GetDescription(), lldb_private::Breakpoint::GetMatchingFileLine(), lldb_private::npdb::SymbolFileNativePDB::ResolveSymbolContext(), lldb_private::CompileUnit::ResolveSymbolContext(), lldb_private::BreakpointResolverFileLine::SearchCallback(), lldb_private::AddressResolverFileLine::SearchCallback(), and lldb_private::BreakpointResolverFileLine::SerializeToStructuredData().
std::optional< uint32_t > SourceLocationSpec::GetLine | ( | ) | const |
Definition at line 71 of file SourceLocationSpec.cpp.
References lldb_private::Declaration::GetLine(), LLDB_INVALID_LINE_NUMBER, and m_declaration.
Referenced by Equal(), lldb_private::BreakpointResolverFileLine::FilterContexts(), lldb_private::LineTable::FindLineEntryIndexByFileIndexImpl(), lldb_private::BreakpointResolverFileLine::GetDescription(), lldb_private::AddressResolverFileLine::GetDescription(), lldb_private::Breakpoint::GetMatchingFileLine(), lldb_private::CompileUnit::ResolveSymbolContext(), lldb_private::BreakpointResolverFileLine::SearchCallback(), lldb_private::AddressResolverFileLine::SearchCallback(), and lldb_private::BreakpointResolverFileLine::SerializeToStructuredData().
std::string SourceLocationSpec::GetString | ( | ) | const |
Definition at line 65 of file SourceLocationSpec.cpp.
References Dump(), and lldb_private::StreamString::GetString().
|
explicit |
Convert to boolean operator.
This allows code to check a SourceLocationSpec object to see if it contains anything valid using code such as:
Definition at line 24 of file SourceLocationSpec.cpp.
bool SourceLocationSpec::operator! | ( | ) | const |
Logical NOT operator.
This allows code to check a SourceLocationSpec object to see if it is invalid using code such as:
Definition at line 26 of file SourceLocationSpec.cpp.
bool SourceLocationSpec::operator!= | ( | const SourceLocationSpec & | rhs | ) | const |
Not equal to operator.
Tests if this object is not equal to rhs.
[in] | rhs | A const SourceLocationSpec object reference to compare this object to. |
Definition at line 34 of file SourceLocationSpec.cpp.
bool SourceLocationSpec::operator< | ( | const SourceLocationSpec & | rhs | ) | const |
Less than to operator.
Tests if this object is less than rhs.
[in] | rhs | A const SourceLocationSpec object reference to compare this object to. |
Definition at line 38 of file SourceLocationSpec.cpp.
References Compare().
bool SourceLocationSpec::operator== | ( | const SourceLocationSpec & | rhs | ) | const |
Equal to operator.
Tests if this object is equal to rhs.
[in] | rhs | A const SourceLocationSpec object reference to compare this object to. |
Definition at line 28 of file SourceLocationSpec.cpp.
References GetCheckInlines(), GetExactMatch(), m_check_inlines, m_declaration, and m_exact_match.
|
protected |
Tells if the resolver should look in inlined declaration.
Definition at line 179 of file SourceLocationSpec.h.
Referenced by Dump(), GetCheckInlines(), and operator==().
|
protected |
Definition at line 177 of file SourceLocationSpec.h.
Referenced by Compare(), Dump(), GetColumn(), GetFileSpec(), GetLine(), and operator==().
|
protected |
Tells if the resolver should look for an exact match.
Definition at line 181 of file SourceLocationSpec.h.
Referenced by Dump(), GetExactMatch(), and operator==().