Skip to content

Commit 6dadfbc

Browse files
authored
Merge pull request #8414 from apple/jdevlieghere/rdar/124643548
[lldb] Show module name in progress update for downloading symbols (llvm#85342)
2 parents a9da7d7 + e3b8a42 commit 6dadfbc

File tree

3 files changed

+25
-18
lines changed

3 files changed

+25
-18
lines changed

lldb/source/Commands/CommandObjectTarget.cpp

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3171,15 +3171,19 @@ class CommandObjectTargetModulesList : public CommandObjectParsed {
31713171

31723172
case 'r': {
31733173
size_t ref_count = 0;
3174+
char in_shared_cache = 'Y';
3175+
31743176
ModuleSP module_sp(module->shared_from_this());
3177+
if (!ModuleList::ModuleIsInCache(module))
3178+
in_shared_cache = 'N';
31753179
if (module_sp) {
31763180
// Take one away to make sure we don't count our local "module_sp"
31773181
ref_count = module_sp.use_count() - 1;
31783182
}
31793183
if (width)
3180-
strm.Printf("{%*" PRIu64 "}", width, (uint64_t)ref_count);
3184+
strm.Printf("{%c %*" PRIu64 "}", in_shared_cache, width, (uint64_t)ref_count);
31813185
else
3182-
strm.Printf("{%" PRIu64 "}", (uint64_t)ref_count);
3186+
strm.Printf("{%c %" PRIu64 "}", in_shared_cache, (uint64_t)ref_count);
31833187
} break;
31843188

31853189
case 's':
@@ -4319,11 +4323,8 @@ class CommandObjectTargetSymbolsAdd : public CommandObjectParsed {
43194323

43204324
ModuleSpec module_spec;
43214325
module_spec.GetUUID() = frame_module_sp->GetUUID();
4322-
4323-
if (FileSystem::Instance().Exists(frame_module_sp->GetPlatformFileSpec())) {
4324-
module_spec.GetArchitecture() = frame_module_sp->GetArchitecture();
4325-
module_spec.GetFileSpec() = frame_module_sp->GetPlatformFileSpec();
4326-
}
4326+
module_spec.GetArchitecture() = frame_module_sp->GetArchitecture();
4327+
module_spec.GetFileSpec() = frame_module_sp->GetPlatformFileSpec();
43274328

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

43694370
ModuleSpec module_spec;
43704371
module_spec.GetUUID() = frame_module_sp->GetUUID();
4371-
4372-
if (FileSystem::Instance().Exists(
4373-
frame_module_sp->GetPlatformFileSpec())) {
4374-
module_spec.GetArchitecture() = frame_module_sp->GetArchitecture();
4375-
module_spec.GetFileSpec() = frame_module_sp->GetPlatformFileSpec();
4376-
}
4372+
module_spec.GetFileSpec() = frame_module_sp->GetPlatformFileSpec();
4373+
module_spec.GetArchitecture() = frame_module_sp->GetArchitecture();
43774374

43784375
bool current_frame_flush = false;
43794376
if (DownloadObjectAndSymbolFile(module_spec, result, current_frame_flush))

lldb/source/Commands/Options.td

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -937,8 +937,8 @@ let Command = "target modules list" in {
937937
OptionalArg<"Width">, Desc<"Display the modification time with optional "
938938
"width of the module.">;
939939
def target_modules_list_ref_count : Option<"ref-count", "r">, Group<1>,
940-
OptionalArg<"Width">, Desc<"Display the reference count if the module is "
941-
"still in the shared module cache.">;
940+
OptionalArg<"Width">, Desc<"Display whether the module is still in the "
941+
"the shared module cache (Y/N), and its shared pointer use_count.">;
942942
def target_modules_list_pointer : Option<"pointer", "p">, Group<1>,
943943
OptionalArg<"None">, Desc<"Display the module pointer.">;
944944
def target_modules_list_global : Option<"global", "g">, Group<1>,

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)