29 std::optional<llvm::StringRef> removed_prefix_opt)
31 m_location_spec(location_spec), m_skip_prologue(skip_prologue),
32 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);
93 return std::make_shared<BreakpointResolverFileLine>(
94 nullptr, offset, skip_prologue, location_spec);
108 options_dict_sp->AddIntegerItem(
131 for(uint32_t i = 0; i < sc_list.
GetSize(); ++i) {
142 if (!inline_declaration.
IsValid())
144 file = inline_declaration.
GetFile();
145 line = inline_declaration.
GetLine();
152 LLDB_LOG(log,
"unexpected symbol context file {0}",
185 const int decl_line_is_too_late_fudge = 1;
188 LLDB_LOG(log,
"removing symbol context at {0}:{1}", file, line);
206 [](llvm::StringRef a, llvm::StringRef b,
207 bool case_sensitive) -> std::optional<llvm::StringRef> {
208 if (case_sensitive ? a.consume_back(b) : a.consume_back_insensitive(b)) {
211 if (a.empty() || a.ends_with(
"/")) {
228 FileSpec sc_file = sc.line_entry.GetFile();
234 llvm::StringRef request_file_dir =
237 llvm::StringRef new_mapping_from;
238 llvm::SmallString<256> new_mapping_to;
245 std::optional<llvm::StringRef> new_mapping_from_opt =
246 check_suffix(sc_file_dir, request_file_dir, case_sensitive);
247 if (new_mapping_from_opt) {
248 new_mapping_from = *new_mapping_from_opt;
249 if (new_mapping_to.empty())
250 new_mapping_to =
".";
252 std::optional<llvm::StringRef> new_mapping_to_opt =
253 check_suffix(request_file_dir, sc_file_dir, case_sensitive);
254 if (new_mapping_to_opt) {
255 new_mapping_from =
".";
256 llvm::sys::path::append(new_mapping_to, *new_mapping_to_opt);
260 if (!new_mapping_from.empty() && !new_mapping_to.empty()) {
261 LLDB_LOG(log,
"generating auto source map from {0} to {1}",
262 new_mapping_from, new_mapping_to);
297 const size_t num_comp_units = context.
module_sp->GetNumCompileUnits();
298 for (
size_t i = 0; i < num_comp_units; i++) {
303 sc_list, &realpath_prefixes);
333 s->
Printf(
"file = '%s', line = %u, ",
338 s->
Printf(
"column = %u, ", *column);
static llvm::raw_ostream & error(Stream &strm)
#define LLDB_LOG(log,...)
The LLDB_LOG* macros defined below are the way to emit log messages.
A section + offset based address class.
A class that describes a single lexical block.
Block * GetContainingInlinedBlock()
Get the inlined block that contains this block.
const InlineFunctionInfo * GetInlinedFunctionInfo() const
Get const accessor for any inlined function information.
"lldb/Breakpoint/BreakpointResolverFileLine.h" This class sets breakpoints by file and line.
Searcher::CallbackReturn SearchCallback(SearchFilter &filter, SymbolContext &context, Address *addr) override
static lldb::BreakpointResolverSP CreateFromStructuredData(const StructuredData::Dictionary &data_dict, Status &error)
void GetDescription(Stream *s) override
Prints a canonical description for the breakpoint to the stream s.
void DeduceSourceMapping(const SymbolContextList &sc_list)
StructuredData::ObjectSP SerializeToStructuredData() override
std::optional< llvm::StringRef > m_removed_prefix_opt
void FilterContexts(SymbolContextList &sc_list)
void Dump(Stream *s) const override
Standard "Dump" method. At present it does nothing.
SourceLocationSpec m_location_spec
lldb::SearchDepth GetDepth() override
lldb::BreakpointResolverSP CopyForBreakpoint(lldb::BreakpointSP &breakpoint) override
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)
General Outline: The BreakpointResolver is a Searcher.
lldb::addr_t GetOffset() const
static const char * GetKey(OptionNames enum_value)
StructuredData::DictionarySP WrapOptionsDict(StructuredData::DictionarySP options_dict_sp)
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 ...
lldb::BreakpointSP GetBreakpoint() const
This gets the breakpoint for this resolver.
const char * AsCString(const char *value_if_empty=nullptr) const
Get the string value as a C string.
llvm::StringRef GetStringRef() const
Get the string value as a llvm::StringRef.
A class that describes the declaration location of a lldb object.
uint32_t GetLine() const
Get accessor for the declaration line number.
FileSpec & GetFile()
Get accessor for file specification.
This class finds address for source file and line.
static bool Equal(const FileSpec &a, const FileSpec &b, bool full)
bool IsRelative() const
Returns true if the filespec represents a relative path.
const ConstString & GetFilename() const
Filename string const get accessor.
const ConstString & GetDirectory() const
Directory string const get accessor.
bool IsCaseSensitive() const
Case sensitivity of path.
size_t GetPath(char *path, size_t max_path_length, bool denormalize=true) const
Extract the full path to the file.
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.
bool AppendUnique(llvm::StringRef path, llvm::StringRef replacement, bool notify)
Append <path, replacement> pair without duplication.
uint32_t GetSourceRealpathAttemptCount() const
uint32_t GetSourceRealpathCompatibleCount() const
General Outline: Provides the callback and search depth for the SearchFilter search.
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...
@ eCallbackReturnContinue
"lldb/Core/SourceLocationSpec.h" A source location specifier class.
std::optional< uint32_t > GetLine() const
bool GetCheckInlines() const
std::optional< uint16_t > GetColumn() const
FileSpec GetFileSpec() const
bool GetExactMatch() const
llvm::StringRef GetString() const
A stream class that can stream formatted output to a file.
size_t Printf(const char *format,...) __attribute__((format(printf
Output printf formatted output to the stream.
bool GetValueForKeyAsInteger(llvm::StringRef key, IntType &result) const
bool GetValueForKeyAsString(llvm::StringRef key, llvm::StringRef &result) const
bool GetValueForKeyAsBoolean(llvm::StringRef key, bool &result) const
std::shared_ptr< Dictionary > DictionarySP
std::shared_ptr< Object > ObjectSP
Defines a list of symbol context objects.
bool GetContextAtIndex(size_t idx, SymbolContext &sc) const
Get accessor for a symbol context at index idx.
uint32_t GetSize() const
Get accessor for a symbol context list size.
bool RemoveContextAtIndex(size_t idx)
Defines a symbol context baton that can be handed other debug core functions.
Function * function
The Function for a given query.
Block * block
The Block for a given query.
lldb::ModuleSP module_sp
The Module for a given query.
LineEntry line_entry
The LineEntry for a given query.
RealpathPrefixes GetSourceRealpathPrefixes() const
PathMappingList & GetSourcePathMap() const
bool GetAutoSourceMapRelative() const
void IncreaseSourceMapDeduceCount()
void IncreaseSourceRealpathAttemptCount(uint32_t count)
void IncreaseSourceRealpathCompatibleCount(uint32_t count)
TargetStats & GetStatistics()
#define LLDB_INVALID_COLUMN_NUMBER
A class that represents a running process on the host machine.
Log * GetLog(Cat mask)
Retrieve the Log object for the channel associated with the given log enum.
std::shared_ptr< lldb_private::BreakpointResolver > BreakpointResolverSP
std::shared_ptr< lldb_private::Breakpoint > BreakpointSP
std::shared_ptr< lldb_private::CompileUnit > CompUnitSP
uint32_t line
The source line number, or LLDB_INVALID_LINE_NUMBER if there is no line number information.
const FileSpec & GetFile() const
Helper to access the file.