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) {
145 std::vector<ArchSpec> result;
146#if defined(__arm__) || defined(__arm64__) || defined(__aarch64__)
152 if (host_os == llvm::Triple::MacOSX) {
156 result.push_back(
ArchSpec(
"x86_64-apple-macosx"));
157 result.push_back(
ArchSpec(
"x86_64-apple-ios-macabi"));
158 result.push_back(
ArchSpec(
"arm64-apple-ios-macabi"));
159 result.push_back(
ArchSpec(
"arm64e-apple-ios-macabi"));
165 if (!process_host_arch ||
166 process_host_arch.
GetTriple().getOS() == llvm::Triple::MacOSX) {
167 result.push_back(
ArchSpec(
"arm64-apple-ios"));
168 result.push_back(
ArchSpec(
"arm64e-apple-ios"));
173 result.push_back(
ArchSpec(
"x86_64-apple-ios-macabi"));
183 module_spec, module_sp, old_modules, did_create_ptr, process);
188 ObjectFile *objfile = module_sp->GetObjectFile();
189 if (objfile ==
nullptr) {
194 llvm::SmallVector<lldb::ModuleSP, 1> old_x86_64_modules;
195 bool did_create =
false;
197 module_spec_x86_64, x86_64_module_sp, &old_x86_64_modules,
198 &did_create, process);
199 if (x86_64_module_sp && x86_64_module_sp->GetObjectFile()) {
200 module_sp = x86_64_module_sp;
202 old_modules->append(old_x86_64_modules.begin(),
203 old_x86_64_modules.end());
205 *did_create_ptr = did_create;
214 old_modules, did_create_ptr);
220 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.
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.
std::string toString(FormatterBytecode::OpCodes op)
std::shared_ptr< lldb_private::Platform > PlatformSP
std::shared_ptr< lldb_private::Module > ModuleSP