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;
73 "BRFL::CFSD: Couldn't find check inlines entry.");
81 "BRFL::CFSD: Couldn't find skip prologue entry.");
94 check_inlines, exact_match);
98 return std::make_shared<BreakpointResolverFileLine>(
99 nullptr, offset, skip_prologue, location_spec);
113 options_dict_sp->AddIntegerItem(
136 for(uint32_t i = 0; i < sc_list.
GetSize(); ++i) {
147 if (!inline_declaration.
IsValid())
149 file_sp = std::make_shared<SupportFile>(inline_declaration.
GetFile());
150 line = inline_declaration.
GetLine();
159 LLDB_LOG(log,
"unexpected symbol context file {0}",
192 const int decl_line_is_too_late_fudge = 1;
195 LLDB_LOG(log,
"removing symbol context at {0}:{1}",
196 file_sp->GetSpecOnly(), line);
214 [](llvm::StringRef a, llvm::StringRef b,
215 bool case_sensitive) -> std::optional<llvm::StringRef> {
216 if (case_sensitive ? a.consume_back(b) : a.consume_back_insensitive(b)) {
219 if (a.empty() || a.ends_with(
"/")) {
236 FileSpec sc_file = sc.line_entry.GetFile();
242 llvm::StringRef request_file_dir =
245 llvm::StringRef new_mapping_from;
246 llvm::SmallString<256> new_mapping_to;
253 std::optional<llvm::StringRef> new_mapping_from_opt =
254 check_suffix(sc_file_dir, request_file_dir, case_sensitive);
255 if (new_mapping_from_opt) {
256 new_mapping_from = *new_mapping_from_opt;
257 if (new_mapping_to.empty())
258 new_mapping_to =
".";
260 std::optional<llvm::StringRef> new_mapping_to_opt =
261 check_suffix(request_file_dir, sc_file_dir, case_sensitive);
262 if (new_mapping_to_opt) {
263 new_mapping_from =
".";
264 llvm::sys::path::append(new_mapping_to, *new_mapping_to_opt);
268 if (!new_mapping_from.empty() && !new_mapping_to.empty()) {
269 LLDB_LOG(log,
"generating auto source map from {0} to {1}",
270 new_mapping_from, new_mapping_to);
305 const size_t num_comp_units = context.
module_sp->GetNumCompileUnits();
306 for (
size_t i = 0; i < num_comp_units; i++) {
311 sc_list, &realpath_prefixes);
341 s->
Printf(
"file = '%s', line = %u, ",
346 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(lldb::SupportFileSP &source_file_sp, 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
static Status FromErrorString(const char *str)
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
@ eEqualFileSpecAndChecksumIfSet
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::SupportFile > SupportFileSP
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.
lldb::SupportFileSP file_sp
The source file, possibly mapped by the target.source-map setting.