[Lldb-commits] [PATCH] D125616: [NFC] two small perf fixes for when using a DebugSymbols DBGShellCommands to find a dSYM

Jason Molenda via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon May 16 10:45:08 PDT 2022


jasonmolenda added inline comments.


================
Comment at: lldb/source/Symbol/LocateSymbolFileMacOSX.cpp:154-155
+          // Check to see if we have the file on the local filesystem.
+          if (!module_spec.GetFileSpec().GetPath().empty() &&
+              FileSystem::Instance().Exists(module_spec.GetFileSpec())) {
+            ModuleSpec exe_spec;
----------------
JDevlieghere wrote:
> I assume an empty file spec wouldn't exist. Can this be simplified?
I was worried that FileSystem::Exists might return true for an empty string filepath; it looks like this devolves down to a `access()` call, it's probably fine.


================
Comment at: lldb/source/Symbol/LocateSymbolFileMacOSX.cpp:165-169
+              if (log) {
+                LLDB_LOGF(log, "using original binary filepath %s for UUID %s",
+                          module_spec.GetFileSpec().GetPath().c_str(),
+                          uuid->GetAsString().c_str());
+              }
----------------
JDevlieghere wrote:
> The macro checks if log is NULL.
Ah good catch.  I was copy & pasting from nearby code that did the same, I'll fix both.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D125616/new/

https://reviews.llvm.org/D125616



More information about the lldb-commits mailing list