Go to the documentation of this file.
25 BreakpointResolverFileLine::BreakpointResolverFileLine(
26 const BreakpointSP &bkpt,
lldb::addr_t offset,
bool skip_prologue,
28 std::optional<llvm::StringRef> removed_prefix_opt)
30 m_location_spec(location_spec), m_skip_prologue(skip_prologue),
31 m_removed_prefix_opt(removed_prefix_opt) {}
36 llvm::StringRef filename;
49 error.SetErrorString(
"BRFL::CFSD: Couldn't find filename entry.");
56 error.SetErrorString(
"BRFL::CFSD: Couldn't find line number entry.");
70 error.SetErrorString(
"BRFL::CFSD: Couldn't find check inlines entry.");
77 error.SetErrorString(
"BRFL::CFSD: Couldn't find skip prologue entry.");
84 error.SetErrorString(
"BRFL::CFSD: Couldn't find exact match entry.");
89 check_inlines, exact_match);
108 options_dict_sp->AddIntegerItem(
142 if (!inline_declaration.
IsValid())
144 file = inline_declaration.
GetFile();
145 line = inline_declaration.
GetLine();
184 const int decl_line_is_too_late_fudge = 1;
187 LLDB_LOG(log,
"removing symbol context at {0}:{1}", file, line);
201 const llvm::StringRef path_separator = llvm::sys::path::get_separator(
207 [path_separator](llvm::StringRef a, llvm::StringRef b,
208 bool case_sensitive) -> std::optional<llvm::StringRef> {
209 if (case_sensitive ? a.consume_back(b) : a.consume_back_insensitive(b)) {
210 if (a.empty() || a.endswith(path_separator)) {
236 llvm::StringRef request_file_dir =
239 llvm::StringRef new_mapping_from;
240 llvm::SmallString<256> new_mapping_to;
247 std::optional<llvm::StringRef> new_mapping_from_opt =
248 check_suffix(sc_file_dir, request_file_dir, case_sensitive);
249 if (new_mapping_from_opt) {
250 new_mapping_from = *new_mapping_from_opt;
251 if (new_mapping_to.empty())
252 new_mapping_to =
".";
254 std::optional<llvm::StringRef> new_mapping_to_opt =
255 check_suffix(request_file_dir, sc_file_dir, case_sensitive);
256 if (new_mapping_to_opt) {
257 new_mapping_from =
".";
258 llvm::sys::path::append(new_mapping_to, *new_mapping_to_opt);
262 if (!new_mapping_from.empty() && !new_mapping_to.empty()) {
263 LLDB_LOG(log,
"generating auto source map from {0} to {1}",
264 new_mapping_from, new_mapping_to);
296 const size_t num_comp_units = context.
module_sp->GetNumCompileUnits();
297 for (
size_t i = 0; i < num_comp_units; i++) {
298 CompUnitSP cu_sp(context.
module_sp->GetCompileUnitAtIndex(i));
326 s->
Printf(
"file = '%s', line = %u, ",
331 s->
Printf(
"column = %u, ", *column);
337 lldb::BreakpointResolverSP
FileSpec GetFileSpec() const
Searcher::CallbackReturn SearchCallback(SearchFilter &filter, SymbolContext &context, Address *addr) override
Block * block
The Block for a given query.
bool GetAutoSourceMapRelative() const
FileSpec file
The source file, possibly mapped by the target.source-map setting.
static BreakpointResolver * CreateFromStructuredData(const lldb::BreakpointSP &bkpt, const StructuredData::Dictionary &data_dict, Status &error)
lldb::SearchDepth GetDepth() override
#define LLDB_INVALID_COLUMN_NUMBER
std::optional< uint32_t > GetLine() const
std::optional< uint16_t > GetColumn() const
bool AppendUnique(llvm::StringRef path, llvm::StringRef replacement, bool notify)
Append <path, replacement> pair without duplication.
Style GetPathStyle() const
bool GetContextAtIndex(size_t idx, SymbolContext &sc) const
Get accessor for a symbol context at index idx.
const char * AsCString(const char *value_if_empty=nullptr) const
Get the string value as a C string.
const ConstString & GetFilename() const
Filename string const get accessor.
FileSpec & GetFile()
Get accessor for file specification.
std::optional< llvm::StringRef > m_removed_prefix_opt
llvm::StringRef GetString() const
bool GetValueForKeyAsInteger(llvm::StringRef key, IntType &result) const
static llvm::raw_ostream & error(Stream &strm)
llvm::StringRef GetStringRef() const
Get the string value as a llvm::StringRef.
General Outline: Provides the callback and search depth for the SearchFilter search.
void DeduceSourceMapping(SymbolContextList &sc_list)
StructuredData::ObjectSP SerializeToStructuredData() override
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 ...
std::shared_ptr< Object > ObjectSP
Function * function
The Function for a given query.
lldb::BreakpointResolverSP CopyForBreakpoint(lldb::BreakpointSP &breakpoint) override
uint32_t GetSize() const
Get accessor for a symbol context list size.
void IncreaseSourceMapDeduceCount()
std::shared_ptr< Dictionary > DictionarySP
SourceLocationSpec m_location_spec
uint32_t line
The source line number, or zero if there is no line number information.
Declaration & GetDeclaration()
Get accessor for the declaration information.
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.
General Outline: The BreakpointResolver is a Searcher.
StructuredData::DictionarySP WrapOptionsDict(StructuredData::DictionarySP options_dict_sp)
uint32_t GetLine() const
Get accessor for the declaration line number.
bool IsRelative() const
Returns true if the filespec represents a relative path.
TargetStats & GetStatistics()
const ConstString & GetDirectory() const
Directory string const get accessor.
static const char * GetKey(OptionNames enum_value)
void FilterContexts(SymbolContextList &sc_list)
lldb::ModuleSP module_sp
The Module for a given query.
virtual bool CompUnitPasses(FileSpec &fileSpec)
Call this method with a FileSpec to see if file spec passes the filter as the name of a compilation u...
#define LLDB_LOG(log,...)
The LLDB_LOG* macros defined below are the way to emit log messages.
bool IsCaseSensitive() const
Case sensitivity of path.
size_t Printf(const char *format,...) __attribute__((format(printf
Output printf formatted output to the stream.
lldb::addr_t GetOffset() const
BreakpointResolverFileLine(const lldb::BreakpointSP &bkpt, lldb::addr_t offset, bool skip_prologue, const SourceLocationSpec &location_spec, std::optional< llvm::StringRef > removed_prefix_opt=std::nullopt)
A class that represents a running process on the host machine.
bool GetExactMatch() const
void GetDescription(Stream *s) override
Prints a canonical description for the breakpoint to the stream s.
PathMappingList & GetSourcePathMap() const
bool GetCheckInlines() const
const InlineFunctionInfo * GetInlinedFunctionInfo() const
Get const accessor for any inlined function information.
bool GetValueForKeyAsString(llvm::StringRef key, llvm::StringRef &result) const
LineEntry line_entry
The LineEntry for a given query.
void Dump(Stream *s) const override
Standard "Dump" method. At present it does nothing.
Log * GetLog(Cat mask)
Retrieve the Log object for the channel associated with the given log enum.
size_t GetPath(char *path, size_t max_path_length, bool denormalize=true) const
Extract the full path to the file.
bool GetValueForKeyAsBoolean(llvm::StringRef key, bool &result) const
lldb::BreakpointSP GetBreakpoint() const
This gets the breakpoint for this resolver.
static bool Equal(const FileSpec &a, const FileSpec &b, bool full)
Block * GetContainingInlinedBlock()
Get the inlined block that contains this block.
bool RemoveContextAtIndex(size_t idx)
@ eCallbackReturnContinue