25#include "lldb/Host/Config.h"
52 PlatformDarwinKernel::Initialize();
61 default_platform_sp->SetSystemArchitecture(HostInfo::GetArchitecture());
81 PlatformDarwinKernel::Terminate();
90 return "Local Mac OS X user platform plug-in.";
107 ObjectFile *objfile = exe_module_sp->GetObjectFile();
116 if (
FileSpec fspec = HostInfo::GetXcodeContentsDirectory()) {
118 sdk_path.
Printf(
"%s/Developer/Platforms/MacOSX.platform/Developer/"
119 "SDKs/MacOSX%u.%u.sdk",
120 fspec.GetPath().c_str(), version.getMajor(),
121 *version.getMinor());
127 auto sdk_path_or_err =
129 if (!sdk_path_or_err) {
131 toString(sdk_path_or_err.takeError()));
146 std::vector<ArchSpec> result;
147#if defined(__arm__) || defined(__arm64__) || defined(__aarch64__)
153 if (host_os == llvm::Triple::MacOSX) {
157 result.push_back(
ArchSpec(
"x86_64-apple-macosx"));
158 result.push_back(
ArchSpec(
"x86_64-apple-ios-macabi"));
159 result.push_back(
ArchSpec(
"arm64-apple-ios-macabi"));
160 result.push_back(
ArchSpec(
"arm64e-apple-ios-macabi"));
166 if (!process_host_arch ||
167 process_host_arch.
GetTriple().getOS() == llvm::Triple::MacOSX) {
168 result.push_back(
ArchSpec(
"arm64-apple-ios"));
169 result.push_back(
ArchSpec(
"arm64e-apple-ios"));
174 result.push_back(
ArchSpec(
"x86_64-apple-ios-macabi"));
185 module_search_paths_ptr,
186 old_modules, did_create_ptr);
191 ObjectFile *objfile = module_sp->GetObjectFile();
192 if (objfile ==
nullptr) {
197 llvm::SmallVector<lldb::ModuleSP, 1> old_x86_64_modules;
198 bool did_create =
false;
200 module_spec_x86_64, x86_64_module_sp, module_search_paths_ptr,
201 &old_x86_64_modules, &did_create);
202 if (x86_64_module_sp && x86_64_module_sp->GetObjectFile()) {
203 module_sp = x86_64_module_sp;
205 old_modules->append(old_x86_64_modules.begin(),
206 old_x86_64_modules.end());
208 *did_create_ptr = did_create;
217 module_search_paths_ptr,
218 old_modules, did_create_ptr);
224 return "macOS DeviceSupport";
static llvm::raw_ostream & error(Stream &strm)
#define LLDB_PLUGIN_DEFINE(PluginName)
An architecture specification class.
llvm::Triple & GetTriple()
Architecture triple accessor.
A uniqued constant string class.
static void ReportError(std::string message, std::optional< lldb::user_id_t > debugger_id=std::nullopt, std::once_flag *once=nullptr)
Report error events.
size_t GetPath(char *path, size_t max_path_length, bool denormalize=true) const
Extract the full path to the file.
static FileSystem & Instance()
ArchSpec & GetArchitecture()
A plug-in interface definition class for object file parsers.
virtual llvm::VersionTuple GetSDKVersion()
Get the SDK OS version this object file was built with.
static bool RegisterPlugin(llvm::StringRef name, llvm::StringRef description, ABICreateInstance create_callback)
static bool UnregisterPlugin(ABICreateInstance create_callback)
A plug-in interface definition class for debugging a process.
llvm::StringRef GetString() const
size_t Printf(const char *format,...) __attribute__((format(printf
Output printf formatted output to the stream.
lldb::ModuleSP GetExecutableModule()
Gets the module for the main executable.
static XcodeSDK GetAnyMacOS()
A class that represents a running process on the host machine.
const char * toString(AppleArm64ExceptionClass EC)
std::shared_ptr< lldb_private::Platform > PlatformSP
std::shared_ptr< lldb_private::Module > ModuleSP