[Lldb-commits] [lldb] Add `SBModule.SetLocateDwoCallback` (PR #69517)
Alex Langford via lldb-commits
lldb-commits at lists.llvm.org
Thu Oct 19 09:42:33 PDT 2023
================
@@ -1742,20 +1742,37 @@ SymbolFileDWARF::GetDwoSymbolFileForCompileUnit(
if (std::shared_ptr<SymbolFileDWARFDwo> dwp_sp = GetDwpSymbolFile())
return dwp_sp;
- FileSpec dwo_file(dwo_name);
- FileSystem::Instance().Resolve(dwo_file);
- bool found = false;
+ const char *comp_dir =
+ cu_die.GetAttributeValueAsString(dwarf_cu, DW_AT_comp_dir, nullptr);
+
+ // Try locating the dwo via the callback first.
+ FileSpec dwo_file;
+ SymbolFile::LocateDwoCallback locate_dwo_callback =
+ SymbolFile::GetLocateDwoCallback();
+ if (locate_dwo_callback) {
+ const FileSpec &objfile_spec = m_objfile_sp->GetFileSpec();
+ Status error = locate_dwo_callback(objfile_spec, dwo_name, comp_dir,
+ dwarf_cu->GetDWOId().value(), dwo_file);
+ if (error.Fail()) {
+ GetObjectFile()->GetModule()->ReportWarning(
+ "locate DWO callback failed with error: {0}",
+ error.AsCString("unknown error"));
+ }
----------------
bulbazord wrote:
Logging seems fine to me, many users might not even be aware that the dwo callback is installed into their session. Adding warnings like this can get spammy pretty quickly.
https://github.com/llvm/llvm-project/pull/69517
More information about the lldb-commits
mailing list