[Lldb-commits] [PATCH] D53305: Simplify LocateDSYMInVincinityOfExecutable a bit, and call Symbols::DownloadObjectAndSymbolFile for .dSYM.yaa archives

Jason Molenda via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon Oct 15 16:40:46 PDT 2018


jasonmolenda created this revision.
jasonmolenda added a reviewer: jingham.
jasonmolenda added a project: LLDB.
Herald added a subscriber: abidh.

Host/common/Symbols.cpp has a method LocateDSYMInVincinityOfExecutable which looks for a dSYM next to a binary ("foo" + "foo.dSYM") and it looks for a dSYM next to a bundle ("foo.framework/foo" + "foo.framework.dSYM").  It constructed these two paths differently - one with strcat's one with FileSpec component adding, which isn't great.

This patch adds a helper function LookForDsymNextToExecutablePath which only knows how to look next to a given FileSpec for a dSYM.  It also knows to look for a .dSYM.yaa file -- yaa is a compressed archive format used inside Apple akin to a zip file.  Instead of having lldb manage a cache directory & expanding it there, I'm calling over to Symbols::DownloadObjectAndSymbolFile() which knows how to expand the archive on the local filesystem and give lldb the path to the expanded dSYM.

There aren't any tests here because the testsuite in dSYM mode exercises this code well.  I tried intentionally breaking the bundle-parent-directory-searching code and picked up more than a dozen fails, for instance.


Repository:
  rLLDB LLDB

https://reviews.llvm.org/D53305

Files:
  source/Host/common/Symbols.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D53305.169770.patch
Type: text/x-patch
Size: 9498 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20181015/c0d6b67a/attachment-0001.bin>


More information about the lldb-commits mailing list