LLDB mainline
|
General Outline: The BreakpointResolver is a Searcher. More...
#include <BreakpointResolver.h>
Public Types | |
enum | ResolverTy { FileLineResolver = 0 , AddressResolver , NameResolver , FileRegexResolver , PythonResolver , ExceptionResolver , LastKnownResolverType = ExceptionResolver , UnknownResolver } |
An enumeration for keeping track of the concrete subclass that is actually instantiated. More... | |
Public Types inherited from lldb_private::Searcher | |
enum | CallbackReturn { eCallbackReturnStop = 0 , eCallbackReturnContinue , eCallbackReturnPop } |
Public Member Functions | |
BreakpointResolver (const lldb::BreakpointSP &bkpt, unsigned char resolverType, lldb::addr_t offset=0) | |
The breakpoint resolver need to have a breakpoint for "ResolveBreakpoint to make sense. | |
~BreakpointResolver () override | |
The Destructor is virtual, all significant breakpoint resolvers derive from this class. | |
void | SetBreakpoint (const lldb::BreakpointSP &bkpt) |
This sets the breakpoint for this resolver. | |
lldb::BreakpointSP | GetBreakpoint () const |
This gets the breakpoint for this resolver. | |
void | SetOffset (lldb::addr_t offset) |
This updates the offset for this breakpoint. | |
lldb::addr_t | GetOffset () const |
virtual void | ResolveBreakpoint (SearchFilter &filter) |
In response to this method the resolver scans all the modules in the breakpoint's target, and adds any new locations it finds. | |
virtual void | ResolveBreakpointInModules (SearchFilter &filter, ModuleList &modules) |
In response to this method the resolver scans the modules in the module list modules, and adds any new locations it finds. | |
void | GetDescription (Stream *s) override=0 |
Prints a canonical description for the breakpoint to the stream s. | |
virtual void | Dump (Stream *s) const =0 |
Standard "Dump" method. At present it does nothing. | |
virtual StructuredData::ObjectSP | SerializeToStructuredData () |
StructuredData::DictionarySP | WrapOptionsDict (StructuredData::DictionarySP options_dict_sp) |
unsigned | getResolverID () const |
getResolverID - Return an ID for the concrete type of this object. | |
enum ResolverTy | GetResolverTy () |
const char * | GetResolverName () |
virtual lldb::BreakpointResolverSP | CopyForBreakpoint (lldb::BreakpointSP &breakpoint)=0 |
Public Member Functions inherited from lldb_private::Searcher | |
Searcher () | |
virtual | ~Searcher () |
virtual CallbackReturn | SearchCallback (SearchFilter &filter, SymbolContext &context, Address *addr)=0 |
virtual lldb::SearchDepth | GetDepth ()=0 |
virtual void | GetDescription (Stream *s) |
Prints a canonical description for the searcher to the stream s. | |
Static Public Member Functions | |
static lldb::BreakpointResolverSP | CreateFromStructuredData (const StructuredData::Dictionary &resolver_dict, Status &error) |
This section handles serializing and deserializing from StructuredData objects. | |
static const char * | GetSerializationKey () |
static const char * | GetSerializationSubclassKey () |
static const char * | GetSerializationSubclassOptionsKey () |
static const char * | ResolverTyToName (enum ResolverTy) |
static ResolverTy | NameToResolverTy (llvm::StringRef name) |
static const char * | GetKey (OptionNames enum_value) |
Static Public Attributes | |
static const char * | g_ty_to_name [LastKnownResolverType+2] |
Protected Types | |
enum class | OptionNames : uint32_t { AddressOffset = 0 , ExactMatch , FileName , Inlines , LanguageName , LineNumber , Column , ModuleName , NameMaskArray , Offset , PythonClassName , RegexString , ScriptArgs , SectionName , SearchDepth , SkipPrologue , SymbolNameArray , LastOptionName } |
Protected Member Functions | |
virtual void | NotifyBreakpointSet () |
void | SetSCMatchesByLine (SearchFilter &filter, SymbolContextList &sc_list, bool skip_prologue, llvm::StringRef log_ident, uint32_t line=0, std::optional< uint16_t > column=std::nullopt) |
Takes a symbol context list of matches which supposedly represent the same file and line number in a CU, and find the nearest actual line number that matches, and then filter down the matching addresses to unique entries, and skip the prologue if asked to do so, and then set breakpoint locations in this breakpoint for all the resultant addresses. | |
void | SetSCMatchesByLine (SearchFilter &, SymbolContextList &, bool, const char *)=delete |
lldb::BreakpointLocationSP | AddLocation (Address loc_addr, bool *new_location=nullptr) |
Static Protected Attributes | |
static const char * | g_option_names [static_cast< uint32_t >(OptionNames::LastOptionName)] |
Private Member Functions | |
void | AddLocation (SearchFilter &filter, const SymbolContext &sc, bool skip_prologue, llvm::StringRef log_ident) |
Helper for SetSCMatchesByLine . | |
BreakpointResolver (const BreakpointResolver &)=delete | |
const BreakpointResolver & | operator= (const BreakpointResolver &)=delete |
Private Attributes | |
lldb::BreakpointWP | m_breakpoint |
lldb::addr_t | m_offset |
const unsigned char | SubclassID |
Friends | |
class | Breakpoint |
General Outline: The BreakpointResolver is a Searcher.
"lldb/Breakpoint/BreakpointResolver.h" This class works with SearchFilter to resolve logical breakpoints to their of concrete breakpoint locations.
In that protocol, the SearchFilter asks the question "At what depth of the symbol context descent do you want your callback to get called?" of the filter. The resolver answers this question (in the GetDepth method) and provides the resolution callback. Each Breakpoint has a BreakpointResolver, and it calls either ResolveBreakpoint or ResolveBreakpointInModules to tell it to look for new breakpoint locations.
Definition at line 36 of file BreakpointResolver.h.
|
strongprotected |
Definition at line 168 of file BreakpointResolver.h.
An enumeration for keeping track of the concrete subclass that is actually instantiated.
Values of this enumeration are kept in the BreakpointResolver's SubclassID field. They are used for concrete type identification.
Enumerator | |
---|---|
FileLineResolver | |
AddressResolver | |
NameResolver | |
FileRegexResolver | |
PythonResolver | |
ExceptionResolver | |
LastKnownResolverType | |
UnknownResolver |
Definition at line 128 of file BreakpointResolver.h.
BreakpointResolver::BreakpointResolver | ( | const lldb::BreakpointSP & | bkpt, |
unsigned char | resolverType, | ||
lldb::addr_t | offset = 0 |
||
) |
The breakpoint resolver need to have a breakpoint for "ResolveBreakpoint to make sense.
It can be constructed without a breakpoint, but you have to call SetBreakpoint before ResolveBreakpoint.
[in] | bkpt | The breakpoint that owns this resolver. |
[in] | resolverType | The concrete breakpoint resolver type for this breakpoint. |
Definition at line 66 of file BreakpointResolver.cpp.
|
overridedefault |
The Destructor is virtual, all significant breakpoint resolvers derive from this class.
|
privatedelete |
|
protected |
Definition at line 366 of file BreakpointResolver.cpp.
References GetBreakpoint(), m_offset, and lldb_private::Address::Slide().
Referenced by AddLocation(), lldb_private::BreakpointResolverAddress::SearchCallback(), lldb_private::BreakpointResolverName::SearchCallback(), and SetSCMatchesByLine().
|
private |
Helper for SetSCMatchesByLine
.
Definition at line 304 of file BreakpointResolver.cpp.
References AddLocation(), lldb_private::SearchFilter::AddressPasses(), lldb_private::Breakpoints, lldb_private::Address::CalculateSymbolContextLineEntry(), lldb_private::LineEntry::Compare(), lldb::eDescriptionLevelVerbose, lldb_private::SymbolContext::function, lldb_private::Function::GetAddressRange(), lldb_private::AddressRange::GetBaseAddress(), GetBreakpoint(), lldb_private::StreamString::GetData(), lldb_private::Address::GetFileAddress(), lldb_private::GetLog(), lldb_private::Function::GetPrologueByteSize(), lldb_private::Address::IsValid(), lldb_private::SymbolContext::line_entry, LLDB_LOG, LLDB_LOGF, lldb_private::LineEntry::range, and lldb_private::Address::Slide().
|
pure virtual |
|
static |
This section handles serializing and deserializing from StructuredData objects.
Definition at line 73 of file BreakpointResolver.cpp.
References AddressResolver, lldb_private::BreakpointResolverFileLine::CreateFromStructuredData(), lldb_private::BreakpointResolverName::CreateFromStructuredData(), lldb_private::BreakpointResolverAddress::CreateFromStructuredData(), lldb_private::BreakpointResolverFileRegex::CreateFromStructuredData(), lldb_private::BreakpointResolverScripted::CreateFromStructuredData(), error(), ExceptionResolver, FileLineResolver, FileRegexResolver, lldb_private::Status::FromErrorString(), lldb_private::Status::FromErrorStringWithFormatv(), GetKey(), GetSerializationSubclassKey(), GetSerializationSubclassOptionsKey(), lldb_private::StructuredData::Dictionary::GetValueForKeyAsDictionary(), lldb_private::StructuredData::Dictionary::GetValueForKeyAsInteger(), lldb_private::StructuredData::Dictionary::GetValueForKeyAsString(), lldb_private::StructuredData::Object::IsValid(), NameResolver, NameToResolverTy(), Offset, PythonResolver, and UnknownResolver.
Referenced by lldb_private::Breakpoint::CreateFromStructuredData().
|
pure virtual |
Standard "Dump" method. At present it does nothing.
Implemented in lldb_private::BreakpointResolverAddress, lldb_private::BreakpointResolverFileLine, lldb_private::BreakpointResolverFileRegex, lldb_private::BreakpointResolverName, lldb_private::BreakpointResolverScripted, and ExceptionBreakpointResolver.
|
inline |
This gets the breakpoint for this resolver.
Definition at line 63 of file BreakpointResolver.h.
References m_breakpoint.
Referenced by AddLocation(), lldb_private::BreakpointResolverFileLine::DeduceSourceMapping(), lldb_private::BreakpointResolverAddress::GetDescription(), lldb_private::BreakpointResolverScripted::GetScriptInterpreter(), lldb_private::BreakpointResolverScripted::NotifyBreakpointSet(), lldb_private::BreakpointResolverAddress::ResolveBreakpoint(), lldb_private::BreakpointResolverAddress::ResolveBreakpointInModules(), lldb_private::BreakpointResolverAddress::SearchCallback(), lldb_private::BreakpointResolverFileLine::SearchCallback(), and lldb_private::BreakpointResolverName::SearchCallback().
|
overridepure virtual |
Prints a canonical description for the breakpoint to the stream s.
[in] | s | Stream to which the output is copied. |
Reimplemented from lldb_private::Searcher.
Implemented in lldb_private::BreakpointResolverAddress, lldb_private::BreakpointResolverFileLine, lldb_private::BreakpointResolverFileRegex, lldb_private::BreakpointResolverName, lldb_private::BreakpointResolverScripted, and ExceptionBreakpointResolver.
|
inlinestatic |
Definition at line 194 of file BreakpointResolver.h.
References g_option_names.
Referenced by lldb_private::BreakpointResolverFileLine::CreateFromStructuredData(), lldb_private::BreakpointResolverName::CreateFromStructuredData(), lldb_private::BreakpointResolverAddress::CreateFromStructuredData(), lldb_private::BreakpointResolverFileRegex::CreateFromStructuredData(), lldb_private::BreakpointResolverScripted::CreateFromStructuredData(), CreateFromStructuredData(), lldb_private::BreakpointResolverAddress::SerializeToStructuredData(), lldb_private::BreakpointResolverFileLine::SerializeToStructuredData(), lldb_private::BreakpointResolverFileRegex::SerializeToStructuredData(), lldb_private::BreakpointResolverName::SerializeToStructuredData(), lldb_private::BreakpointResolverScripted::SerializeToStructuredData(), and WrapOptionsDict().
|
inline |
Definition at line 78 of file BreakpointResolver.h.
References m_offset.
Referenced by lldb_private::BreakpointResolverFileLine::CopyForBreakpoint().
|
inline |
getResolverID - Return an ID for the concrete type of this object.
This is used to implement the LLVM classof checks. This should not be used for any other purpose, as the values may change as LLDB evolves.
Definition at line 146 of file BreakpointResolver.h.
References SubclassID.
Referenced by lldb_private::BreakpointResolverAddress::classof(), lldb_private::BreakpointResolverFileLine::classof(), lldb_private::BreakpointResolverFileRegex::classof(), lldb_private::BreakpointResolverName::classof(), lldb_private::BreakpointResolverScripted::classof(), and ExceptionBreakpointResolver::classof().
|
inline |
Definition at line 155 of file BreakpointResolver.h.
References GetResolverTy(), and ResolverTyToName().
Referenced by WrapOptionsDict().
|
inline |
Definition at line 148 of file BreakpointResolver.h.
References LastKnownResolverType, SubclassID, and UnknownResolver.
Referenced by GetResolverName().
|
inlinestatic |
Definition at line 115 of file BreakpointResolver.h.
Referenced by lldb_private::Breakpoint::CreateFromStructuredData(), and lldb_private::Breakpoint::SerializeToStructuredData().
|
inlinestatic |
Definition at line 117 of file BreakpointResolver.h.
Referenced by CreateFromStructuredData(), and WrapOptionsDict().
|
inlinestatic |
Definition at line 119 of file BreakpointResolver.h.
Referenced by CreateFromStructuredData(), and WrapOptionsDict().
|
static |
Definition at line 58 of file BreakpointResolver.cpp.
References g_ty_to_name, LastKnownResolverType, and UnknownResolver.
Referenced by CreateFromStructuredData().
|
inlineprotectedvirtual |
Reimplemented in lldb_private::BreakpointResolverScripted.
Definition at line 191 of file BreakpointResolver.h.
Referenced by SetBreakpoint().
|
privatedelete |
|
virtual |
In response to this method the resolver scans all the modules in the breakpoint's target, and adds any new locations it finds.
[in] | filter | The filter that will manage the search for this resolver. |
Reimplemented in lldb_private::BreakpointResolverAddress.
Definition at line 180 of file BreakpointResolver.cpp.
References lldb_private::SearchFilter::Search().
Referenced by lldb_private::BreakpointResolverAddress::ResolveBreakpoint().
|
virtual |
In response to this method the resolver scans the modules in the module list modules, and adds any new locations it finds.
[in] | filter | The filter that will manage the search for this resolver. |
Reimplemented in lldb_private::BreakpointResolverAddress.
Definition at line 175 of file BreakpointResolver.cpp.
References lldb_private::SearchFilter::SearchInModuleList().
Referenced by lldb_private::BreakpointResolverAddress::ResolveBreakpointInModules().
|
static |
Definition at line 50 of file BreakpointResolver.cpp.
References g_ty_to_name, LastKnownResolverType, and UnknownResolver.
Referenced by GetResolverName().
|
inlinevirtual |
Reimplemented in lldb_private::BreakpointResolverAddress, lldb_private::BreakpointResolverFileLine, lldb_private::BreakpointResolverFileRegex, lldb_private::BreakpointResolverName, and lldb_private::BreakpointResolverScripted.
Definition at line 111 of file BreakpointResolver.h.
void BreakpointResolver::SetBreakpoint | ( | const lldb::BreakpointSP & | bkpt | ) |
This sets the breakpoint for this resolver.
[in] | bkpt | The breakpoint that owns this resolver. |
Definition at line 169 of file BreakpointResolver.cpp.
References m_breakpoint, and NotifyBreakpointSet().
void BreakpointResolver::SetOffset | ( | lldb::addr_t | offset | ) |
This updates the offset for this breakpoint.
All the locations currently set for this breakpoint will have their offset adjusted when this is called.
[in] | offset | The offset to add to all locations. |
Definition at line 372 of file BreakpointResolver.cpp.
References m_offset.
|
protecteddelete |
|
protected |
Takes a symbol context list of matches which supposedly represent the same file and line number in a CU, and find the nearest actual line number that matches, and then filter down the matching addresses to unique entries, and skip the prologue if asked to do so, and then set breakpoint locations in this breakpoint for all the resultant addresses.
When column
is nonzero the line
and column
args are used to filter the results to find the first breakpoint >= (line, column).
Definition at line 207 of file BreakpointResolver.cpp.
References AddLocation(), lldb_private::SymbolContext::block, lldb_private::Language::FindPlugin(), lldb_private::AddressRange::GetBaseAddress(), lldb_private::Address::GetFileAddress(), lldb_private::Language::GetGlobalLanguageProperties(), lldb_private::Language::IgnoreForLineBreakpoints(), lldb_private::LineEntry::line, lldb_private::SymbolContext::line_entry, lldb_private::LineEntry::range, and UINT32_MAX.
Referenced by lldb_private::BreakpointResolverFileLine::SearchCallback(), and lldb_private::BreakpointResolverFileRegex::SearchCallback().
StructuredData::DictionarySP BreakpointResolver::WrapOptionsDict | ( | StructuredData::DictionarySP | options_dict_sp | ) |
Definition at line 154 of file BreakpointResolver.cpp.
References GetKey(), GetResolverName(), GetSerializationSubclassKey(), GetSerializationSubclassOptionsKey(), m_offset, and Offset.
Referenced by lldb_private::BreakpointResolverAddress::SerializeToStructuredData(), lldb_private::BreakpointResolverFileLine::SerializeToStructuredData(), lldb_private::BreakpointResolverFileRegex::SerializeToStructuredData(), lldb_private::BreakpointResolverName::SerializeToStructuredData(), and lldb_private::BreakpointResolverScripted::SerializeToStructuredData().
|
friend |
Definition at line 37 of file BreakpointResolver.h.
|
staticprotected |
Definition at line 189 of file BreakpointResolver.h.
Referenced by GetKey().
|
static |
Definition at line 141 of file BreakpointResolver.h.
Referenced by NameToResolverTy(), and ResolverTyToName().
|
private |
Definition at line 221 of file BreakpointResolver.h.
Referenced by GetBreakpoint(), and SetBreakpoint().
|
private |
Definition at line 222 of file BreakpointResolver.h.
Referenced by AddLocation(), GetOffset(), SetOffset(), and WrapOptionsDict().
|
private |
Definition at line 226 of file BreakpointResolver.h.
Referenced by getResolverID(), and GetResolverTy().