[Lldb-commits] [PATCH] D122177: [lldb] Fix log & progress report for in-memory binaries

Jonas Devlieghere via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon Mar 21 13:38:52 PDT 2022


JDevlieghere created this revision.
JDevlieghere added reviewers: jasonmolenda, clayborg.
Herald added a project: All.
JDevlieghere requested review of this revision.

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.


https://reviews.llvm.org/D122177

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


Index: lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
===================================================================
--- lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
+++ lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
@@ -2201,14 +2201,16 @@
 enum { DebugSymbols = true, NonDebugSymbols = false };
 
 void ObjectFileMachO::ParseSymtab(Symtab &symtab) {
-  LLDB_SCOPED_TIMERF("ObjectFileMachO::ParseSymtab () module = %s",
-                     m_file.GetFilename().AsCString(""));
   ModuleSP module_sp(GetModule());
   if (!module_sp)
     return;
 
+  const FileSpec &file = m_file ? m_file : module_sp->GetFileSpec();
+  LLDB_SCOPED_TIMERF("ObjectFileMachO::ParseSymtab () module = %s",
+                     file.GetFilename().AsCString(""));
+
   Progress progress(llvm::formatv("Parsing symbol table for {0}",
-                                  m_file.GetFilename().AsCString("<Unknown>")));
+                                  file.GetFilename().AsCString("<Unknown>")));
 
   llvm::MachO::symtab_command symtab_load_command = {0, 0, 0, 0, 0, 0};
   llvm::MachO::linkedit_data_command function_starts_load_command = {0, 0, 0, 0};


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D122177.417077.patch
Type: text/x-patch
Size: 1175 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20220321/7663a543/attachment.bin>


More information about the lldb-commits mailing list