diff options
author | Jonas Devlieghere <jonas@devlieghere.com> | 2024-08-30 10:58:32 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-08-30 10:58:32 -0700 |
commit | 130eddf7a13f15c9c48b7fa7faf60e9bbee4f703 (patch) | |
tree | 98b5d00cf0db51be6cd8daeeed42036c9e6a7304 /lldb/source/Commands/CommandObjectBreakpoint.cpp | |
parent | 0efa38699a4988793cdd51426fe27f00b5e5ce37 (diff) | |
download | llvm-130eddf7a13f15c9c48b7fa7faf60e9bbee4f703.zip llvm-130eddf7a13f15c9c48b7fa7faf60e9bbee4f703.tar.gz llvm-130eddf7a13f15c9c48b7fa7faf60e9bbee4f703.tar.bz2 |
[lldb] Deal with SupportFiles in SourceManager (NFC) (#106740)
To support detecting MD5 checksum mismatches, deal with SupportFiles
rather than a plain FileSpecs in the SourceManager.
Diffstat (limited to 'lldb/source/Commands/CommandObjectBreakpoint.cpp')
-rw-r--r-- | lldb/source/Commands/CommandObjectBreakpoint.cpp | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/lldb/source/Commands/CommandObjectBreakpoint.cpp b/lldb/source/Commands/CommandObjectBreakpoint.cpp index abde27b..ede3dd2 100644 --- a/lldb/source/Commands/CommandObjectBreakpoint.cpp +++ b/lldb/source/Commands/CommandObjectBreakpoint.cpp @@ -769,20 +769,26 @@ protected: private: bool GetDefaultFile(Target &target, FileSpec &file, CommandReturnObject &result) { - uint32_t default_line; // First use the Source Manager's default file. Then use the current stack // frame's file. - if (!target.GetSourceManager().GetDefaultFileAndLine(file, default_line)) { + if (auto maybe_file_and_line = + target.GetSourceManager().GetDefaultFileAndLine()) { + file = maybe_file_and_line->support_file_sp->GetSpecOnly(); + return true; + } + StackFrame *cur_frame = m_exe_ctx.GetFramePtr(); if (cur_frame == nullptr) { result.AppendError( "No selected frame to use to find the default file."); return false; - } else if (!cur_frame->HasDebugInformation()) { + } + if (!cur_frame->HasDebugInformation()) { result.AppendError("Cannot use the selected frame to find the default " "file, it has no debug info."); return false; - } else { + } + const SymbolContext &sc = cur_frame->GetSymbolContext(eSymbolContextLineEntry); if (sc.line_entry.GetFile()) { @@ -791,8 +797,6 @@ private: result.AppendError("Can't find the file for the selected frame to " "use as the default file."); return false; - } - } } return true; } |