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.