Skip to content

Commit e3b8a42

Browse files
committed
[lldb] Show module name in progress update for downloading symbols (llvm#85342)
Currently, we always show the argument passed to dsymForUUID in the corresponding progress update. Most of the time this is a UUID, but it can also be an absolute path. The former is pretty uninformative and the latter needlessly noisy. This changes the progress update to print the UUID and the module name, if both are available. Otherwise, we print the UUID or the module name depending on which one is available. We now also unconditionally pass the module file spec and architecture to DownloadObjectAndSymbolFile, while previously this was conditional on the file existing on-disk. This should be harmless: - We already check that the file exists in DownloadObjectAndSymbolFile. - It doesn't make sense to check the filesystem for the architecutre. rdar://124643548 (cherry picked from commit b7dd601)
1 parent c16a459 commit e3b8a42

File tree

2 files changed

+18
-15
lines changed

2 files changed

+18
-15
lines changed

lldb/source/Commands/CommandObjectTarget.cpp

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3172,7 +3172,7 @@ class CommandObjectTargetModulesList : public CommandObjectParsed {
31723172
case 'r': {
31733173
size_t ref_count = 0;
31743174
char in_shared_cache = 'Y';
3175-
3175+
31763176
ModuleSP module_sp(module->shared_from_this());
31773177
if (!ModuleList::ModuleIsInCache(module))
31783178
in_shared_cache = 'N';
@@ -4323,11 +4323,8 @@ class CommandObjectTargetSymbolsAdd : public CommandObjectParsed {
43234323

43244324
ModuleSpec module_spec;
43254325
module_spec.GetUUID() = frame_module_sp->GetUUID();
4326-
4327-
if (FileSystem::Instance().Exists(frame_module_sp->GetPlatformFileSpec())) {
4328-
module_spec.GetArchitecture() = frame_module_sp->GetArchitecture();
4329-
module_spec.GetFileSpec() = frame_module_sp->GetPlatformFileSpec();
4330-
}
4326+
module_spec.GetArchitecture() = frame_module_sp->GetArchitecture();
4327+
module_spec.GetFileSpec() = frame_module_sp->GetPlatformFileSpec();
43314328

43324329
if (!DownloadObjectAndSymbolFile(module_spec, result, flush)) {
43334330
result.AppendError("unable to find debug symbols for the current frame");
@@ -4372,12 +4369,8 @@ class CommandObjectTargetSymbolsAdd : public CommandObjectParsed {
43724369

43734370
ModuleSpec module_spec;
43744371
module_spec.GetUUID() = frame_module_sp->GetUUID();
4375-
4376-
if (FileSystem::Instance().Exists(
4377-
frame_module_sp->GetPlatformFileSpec())) {
4378-
module_spec.GetArchitecture() = frame_module_sp->GetArchitecture();
4379-
module_spec.GetFileSpec() = frame_module_sp->GetPlatformFileSpec();
4380-
}
4372+
module_spec.GetFileSpec() = frame_module_sp->GetPlatformFileSpec();
4373+
module_spec.GetArchitecture() = frame_module_sp->GetArchitecture();
43814374

43824375
bool current_frame_flush = false;
43834376
if (DownloadObjectAndSymbolFile(module_spec, result, current_frame_flush))

lldb/source/Plugins/SymbolLocator/DebugSymbols/SymbolLocatorDebugSymbols.cpp

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1066,11 +1066,21 @@ bool SymbolLocatorDebugSymbols::DownloadObjectAndSymbolFile(
10661066
command << lookup_arg;
10671067

10681068
// Log and report progress.
1069+
std::string lookup_desc;
1070+
if (uuid_ptr && file_spec_ptr)
1071+
lookup_desc =
1072+
llvm::formatv("{0} ({1})", file_spec_ptr->GetFilename().GetString(),
1073+
uuid_ptr->GetAsString());
1074+
else if (uuid_ptr)
1075+
lookup_desc = uuid_ptr->GetAsString();
1076+
else if (file_spec_ptr)
1077+
lookup_desc = file_spec_ptr->GetFilename().GetString();
1078+
10691079
Log *log = GetLog(LLDBLog::Host);
1070-
LLDB_LOG(log, "Calling {0} with {1} to find dSYM: {2}", dsymForUUID_exe_path,
1071-
lookup_arg, command.GetString());
1080+
LLDB_LOG(log, "Calling {0} for {1} to find dSYM: {2}", dsymForUUID_exe_path,
1081+
lookup_desc, command.GetString());
10721082

1073-
Progress progress("Downloading symbol file", lookup_arg);
1083+
Progress progress("Downloading symbol file for", lookup_desc);
10741084

10751085
// Invoke dsymForUUID.
10761086
int exit_status = -1;

0 commit comments

Comments
 (0)