26#include "lldb/Host/Config.h"
53 PlatformDarwinKernel::Initialize();
63 default_platform_sp->SetSystemArchitecture(HostInfo::GetArchitecture());
84 PlatformDarwinKernel::Terminate();
93 return "Local Mac OS X user platform plug-in.";
110 ObjectFile *objfile = exe_module_sp->GetObjectFile();
119 if (
FileSpec fspec = HostInfo::GetXcodeContentsDirectory()) {
121 sdk_path.
Printf(
"%s/Developer/Platforms/MacOSX.platform/Developer/"
122 "SDKs/MacOSX%u.%u.sdk",
123 fspec.GetPath().c_str(), version.getMajor(),
124 *version.getMinor());
130 auto sdk_path_or_err =
132 if (!sdk_path_or_err) {
134 toString(sdk_path_or_err.takeError()));
149 std::vector<ArchSpec> result;
150#if defined(__arm__) || defined(__arm64__) || defined(__aarch64__)
156 if (host_os == llvm::Triple::MacOSX) {
160 result.push_back(
ArchSpec(
"x86_64-apple-macosx"));
161 result.push_back(
ArchSpec(
"x86_64-apple-ios-macabi"));
162 result.push_back(
ArchSpec(
"arm64-apple-ios-macabi"));
163 result.push_back(
ArchSpec(
"arm64e-apple-ios-macabi"));
169 if (!process_host_arch ||
170 process_host_arch.
GetTriple().getOS() == llvm::Triple::MacOSX) {
171 result.push_back(
ArchSpec(
"arm64-apple-ios"));
172 result.push_back(
ArchSpec(
"arm64e-apple-ios"));
177 result.push_back(
ArchSpec(
"x86_64-apple-ios-macabi"));
188 module_search_paths_ptr,
189 old_modules, did_create_ptr);
194 ObjectFile *objfile = module_sp->GetObjectFile();
195 if (objfile ==
nullptr) {
200 llvm::SmallVector<lldb::ModuleSP, 1> old_x86_64_modules;
201 bool did_create =
false;
203 module_spec_x86_64, x86_64_module_sp, module_search_paths_ptr,
204 &old_x86_64_modules, &did_create);
205 if (x86_64_module_sp && x86_64_module_sp->GetObjectFile()) {
206 module_sp = x86_64_module_sp;
208 old_modules->append(old_x86_64_modules.begin(),
209 old_x86_64_modules.end());
211 *did_create_ptr = did_create;
220 module_search_paths_ptr,
221 old_modules, did_create_ptr);
227 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