[Lldb-commits] [PATCH] D76938: [lldb/PlatformMacOSX] Re-implement GetDeveloperDirectory

Jonas Devlieghere via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Fri Mar 27 10:17:24 PDT 2020


JDevlieghere created this revision.
JDevlieghere added reviewers: aprantl, jasonmolenda.

`GetDeveloperDirectory` returns a `const char*` which is `NULL` when we cannot find the developer directory. This crashes in `PlatformDarwinKernel::CollectKextAndKernelDirectories` because we're unconditionally assigning it to a `std::string`. Coincidentally I just refactored a bunch of code in `PlatformMacOSX` so instead of a ad-hoc fix I've reimplemented the method based on `GetXcodeContentsDirectory`.

The change is mostly NFC. Obviously it fixes the crash, but it also removes support for finding the Xcode directory through he legacy `$XCODE_SELECT_PREFIX_DIR/usr/share/xcode-select/xcode_dir_path`.


Repository:
  rLLDB LLDB

https://reviews.llvm.org/D76938

Files:
  lldb/source/Plugins/Platform/MacOSX/PlatformAppleSimulator.cpp
  lldb/source/Plugins/Platform/MacOSX/PlatformAppleTVSimulator.cpp
  lldb/source/Plugins/Platform/MacOSX/PlatformAppleWatchSimulator.cpp
  lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp
  lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.h
  lldb/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp
  lldb/source/Plugins/Platform/MacOSX/PlatformRemoteDarwinDevice.cpp
  lldb/source/Plugins/Platform/MacOSX/PlatformiOSSimulator.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D76938.253158.patch
Type: text/x-patch
Size: 13355 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20200327/a32d7dff/attachment-0001.bin>


More information about the lldb-commits mailing list