Skip to content

Commit 3323321

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
1 parent cff34cc commit 3323321

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
@@ -2201,14 +2201,14 @@ ParseNList(DataExtractor &nlist_data, lldb::offset_t &nlist_data_offset,
22012201
enum { DebugSymbols = true, NonDebugSymbols = false };
22022202

22032203
void ObjectFileMachO::ParseSymtab(Symtab &symtab) {
2204-
LLDB_SCOPED_TIMERF("ObjectFileMachO::ParseSymtab () module = %s",
2205-
m_file.GetFilename().AsCString(""));
22062204
ModuleSP module_sp(GetModule());
22072205
if (!module_sp)
22082206
return;
22092207

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

22132213
llvm::MachO::symtab_command symtab_load_command = {0, 0, 0, 0, 0, 0};
22142214
llvm::MachO::linkedit_data_command function_starts_load_command = {0, 0, 0, 0};

0 commit comments

Comments
 (0)