Page MenuHomePhabricator

Simplify LocateDSYMInVincinityOfExecutable a bit, and call Symbols::DownloadObjectAndSymbolFile for .dSYM.yaa archives

Authored by jasonmolenda on Oct 15 2018, 4:39 PM.



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.

Diff Detail


Event Timeline

jasonmolenda created this revision.Oct 15 2018, 4:39 PM
This revision was not accepted when it landed; it landed in state Needs Review.Oct 16 2018, 10:27 AM
Closed by commit rLLDB344626: Simplify LocateDSYMInVincinityOfExecutable by moving (authored by jmolenda, committed by ). · Explain Why
This revision was automatically updated to reflect the committed changes.