Skip to content

Commit 0fa3671

Browse files
committed
[lldb] Fix log & progress report for in-memory binaries
Fix the log and progress report message for in-memory binaries. If there's no object file, use the name from the Module. With this patch we correctly show the library name when attaching to a remote process without an expanded shared cache. Differential revision: https://reviews.llvm.org/D122177 (cherry picked from commit 3323321)
1 parent f0d1da4 commit 0fa3671

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2245,14 +2245,14 @@ ParseNList(DataExtractor &nlist_data, lldb::offset_t &nlist_data_offset,
22452245
enum { DebugSymbols = true, NonDebugSymbols = false };
22462246

22472247
size_t ObjectFileMachO::ParseSymtab() {
2248-
LLDB_SCOPED_TIMERF("ObjectFileMachO::ParseSymtab () module = %s",
2249-
m_file.GetFilename().AsCString(""));
22502248
ModuleSP module_sp(GetModule());
22512249
if (!module_sp)
22522250
return 0;
22532251

2254-
Progress progress(llvm::formatv("Parsing symbol table for {0}",
2255-
m_file.GetFilename().AsCString("<Unknown>")));
2252+
const FileSpec &file = m_file ? m_file : module_sp->GetFileSpec();
2253+
const char *file_name = file.GetFilename().AsCString("<Unknown>");
2254+
LLDB_SCOPED_TIMERF("ObjectFileMachO::ParseSymtab () module = %s", file_name);
2255+
Progress progress(llvm::formatv("Parsing symbol table for {0}", file_name));
22562256

22572257
llvm::MachO::symtab_command symtab_load_command = {0, 0, 0, 0, 0, 0};
22582258
llvm::MachO::linkedit_data_command function_starts_load_command = {0, 0, 0, 0};

0 commit comments

Comments
 (0)