Skip to content

Commit b7dd601

Browse files
authored
[lldb] Show module name in progress update for downloading symbols (#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
1 parent 0e21672 commit b7dd601

File tree

2 files changed

+18
-15
lines changed

2 files changed

+18
-15
lines changed

lldb/source/Commands/CommandObjectTarget.cpp

+5-12
Original file line numberDiff line numberDiff line change
@@ -3377,7 +3377,7 @@ class CommandObjectTargetModulesList : public CommandObjectParsed {
33773377
case 'r': {
33783378
size_t ref_count = 0;
33793379
char in_shared_cache = 'Y';
3380-
3380+
33813381
ModuleSP module_sp(module->shared_from_this());
33823382
if (!ModuleList::ModuleIsInCache(module))
33833383
in_shared_cache = 'N';
@@ -4508,11 +4508,8 @@ class CommandObjectTargetSymbolsAdd : public CommandObjectParsed {
45084508

45094509
ModuleSpec module_spec;
45104510
module_spec.GetUUID() = frame_module_sp->GetUUID();
4511-
4512-
if (FileSystem::Instance().Exists(frame_module_sp->GetPlatformFileSpec())) {
4513-
module_spec.GetArchitecture() = frame_module_sp->GetArchitecture();
4514-
module_spec.GetFileSpec() = frame_module_sp->GetPlatformFileSpec();
4515-
}
4511+
module_spec.GetArchitecture() = frame_module_sp->GetArchitecture();
4512+
module_spec.GetFileSpec() = frame_module_sp->GetPlatformFileSpec();
45164513

45174514
if (!DownloadObjectAndSymbolFile(module_spec, result, flush)) {
45184515
result.AppendError("unable to find debug symbols for the current frame");
@@ -4557,12 +4554,8 @@ class CommandObjectTargetSymbolsAdd : public CommandObjectParsed {
45574554

45584555
ModuleSpec module_spec;
45594556
module_spec.GetUUID() = frame_module_sp->GetUUID();
4560-
4561-
if (FileSystem::Instance().Exists(
4562-
frame_module_sp->GetPlatformFileSpec())) {
4563-
module_spec.GetArchitecture() = frame_module_sp->GetArchitecture();
4564-
module_spec.GetFileSpec() = frame_module_sp->GetPlatformFileSpec();
4565-
}
4557+
module_spec.GetFileSpec() = frame_module_sp->GetPlatformFileSpec();
4558+
module_spec.GetArchitecture() = frame_module_sp->GetArchitecture();
45664559

45674560
bool current_frame_flush = false;
45684561
if (DownloadObjectAndSymbolFile(module_spec, result, current_frame_flush))

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

+13-3
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)