1 //===-- DynamicLoaderMacOS.cpp --------------------------------------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
9 #include "lldb/Breakpoint/StoppointCallbackContext.h"
10 #include "lldb/Core/Debugger.h"
11 #include "lldb/Core/Module.h"
12 #include "lldb/Core/PluginManager.h"
13 #include "lldb/Core/Section.h"
14 #include "lldb/Symbol/ObjectFile.h"
15 #include "lldb/Symbol/SymbolVendor.h"
16 #include "lldb/Target/ABI.h"
17 #include "lldb/Target/SectionLoadList.h"
18 #include "lldb/Target/StackFrame.h"
19 #include "lldb/Target/Target.h"
20 #include "lldb/Target/Thread.h"
21 #include "lldb/Utility/LLDBLog.h"
22 #include "lldb/Utility/Log.h"
23 #include "lldb/Utility/State.h"
24 
25 #include "DynamicLoaderDarwin.h"
26 #include "DynamicLoaderMacOS.h"
27 
28 #include "Plugins/TypeSystem/Clang/TypeSystemClang.h"
29 
30 using namespace lldb;
31 using namespace lldb_private;
32 
33 // Create an instance of this class. This function is filled into the plugin
34 // info class that gets handed out by the plugin factory and allows the lldb to
35 // instantiate an instance of this class.
36 DynamicLoader *DynamicLoaderMacOS::CreateInstance(Process *process,
37                                                   bool force) {
38   bool create = force;
39   if (!create) {
40     create = true;
41     Module *exe_module = process->GetTarget().GetExecutableModulePointer();
42     if (exe_module) {
43       ObjectFile *object_file = exe_module->GetObjectFile();
44       if (object_file) {
45         create = (object_file->GetStrata() == ObjectFile::eStrataUser);
46       }
47     }
48 
49     if (create) {
50       const llvm::Triple &triple_ref =
51           process->GetTarget().GetArchitecture().GetTriple();
52       switch (triple_ref.getOS()) {
53       case llvm::Triple::Darwin:
54       case llvm::Triple::MacOSX:
55       case llvm::Triple::IOS:
56       case llvm::Triple::TvOS:
57       case llvm::Triple::WatchOS:
58       // NEED_BRIDGEOS_TRIPLE case llvm::Triple::BridgeOS:
59         create = triple_ref.getVendor() == llvm::Triple::Apple;
60         break;
61       default:
62         create = false;
63         break;
64       }
65     }
66   }
67 
68   if (!UseDYLDSPI(process)) {
69     create = false;
70   }
71 
72   if (create)
73     return new DynamicLoaderMacOS(process);
74   return nullptr;
75 }
76 
77 // Constructor
78 DynamicLoaderMacOS::DynamicLoaderMacOS(Process *process)
79     : DynamicLoaderDarwin(process), m_image_infos_stop_id(UINT32_MAX),
80       m_break_id(LLDB_INVALID_BREAK_ID),
81       m_dyld_handover_break_id(LLDB_INVALID_BREAK_ID), m_mutex(),
82       m_maybe_image_infos_address(LLDB_INVALID_ADDRESS) {}
83 
84 // Destructor
85 DynamicLoaderMacOS::~DynamicLoaderMacOS() {
86   if (LLDB_BREAK_ID_IS_VALID(m_break_id))
87     m_process->GetTarget().RemoveBreakpointByID(m_break_id);
88   if (LLDB_BREAK_ID_IS_VALID(m_dyld_handover_break_id))
89     m_process->GetTarget().RemoveBreakpointByID(m_dyld_handover_break_id);
90 }
91 
92 bool DynamicLoaderMacOS::ProcessDidExec() {
93   std::lock_guard<std::recursive_mutex> baseclass_guard(GetMutex());
94   bool did_exec = false;
95   if (m_process) {
96     // If we are stopped after an exec, we will have only one thread...
97     if (m_process->GetThreadList().GetSize() == 1) {
98       // Maybe we still have an image infos address around?  If so see
99       // if that has changed, and if so we have exec'ed.
100       if (m_maybe_image_infos_address != LLDB_INVALID_ADDRESS) {
101         lldb::addr_t image_infos_address = m_process->GetImageInfoAddress();
102         if (image_infos_address != m_maybe_image_infos_address) {
103           // We don't really have to reset this here, since we are going to
104           // call DoInitialImageFetch right away to handle the exec.  But in
105           // case anybody looks at it in the meantime, it can't hurt.
106           m_maybe_image_infos_address = image_infos_address;
107           did_exec = true;
108         }
109       }
110 
111       if (!did_exec) {
112         // See if we are stopped at '_dyld_start'
113         ThreadSP thread_sp(m_process->GetThreadList().GetThreadAtIndex(0));
114         if (thread_sp) {
115           lldb::StackFrameSP frame_sp(thread_sp->GetStackFrameAtIndex(0));
116           if (frame_sp) {
117             const Symbol *symbol =
118                 frame_sp->GetSymbolContext(eSymbolContextSymbol).symbol;
119             if (symbol) {
120               if (symbol->GetName() == "_dyld_start")
121                 did_exec = true;
122             }
123           }
124         }
125       }
126     }
127   }
128 
129   if (did_exec) {
130     m_libpthread_module_wp.reset();
131     m_pthread_getspecific_addr.Clear();
132   }
133   return did_exec;
134 }
135 
136 // Clear out the state of this class.
137 void DynamicLoaderMacOS::DoClear() {
138   std::lock_guard<std::recursive_mutex> guard(m_mutex);
139 
140   if (LLDB_BREAK_ID_IS_VALID(m_break_id))
141     m_process->GetTarget().RemoveBreakpointByID(m_break_id);
142   if (LLDB_BREAK_ID_IS_VALID(m_dyld_handover_break_id))
143     m_process->GetTarget().RemoveBreakpointByID(m_dyld_handover_break_id);
144 
145   m_break_id = LLDB_INVALID_BREAK_ID;
146   m_dyld_handover_break_id = LLDB_INVALID_BREAK_ID;
147 }
148 
149 // Check if we have found DYLD yet
150 bool DynamicLoaderMacOS::DidSetNotificationBreakpoint() {
151   return LLDB_BREAK_ID_IS_VALID(m_break_id);
152 }
153 
154 void DynamicLoaderMacOS::ClearNotificationBreakpoint() {
155   if (LLDB_BREAK_ID_IS_VALID(m_break_id)) {
156     m_process->GetTarget().RemoveBreakpointByID(m_break_id);
157     m_break_id = LLDB_INVALID_BREAK_ID;
158   }
159 }
160 
161 // Try and figure out where dyld is by first asking the Process if it knows
162 // (which currently calls down in the lldb::Process to get the DYLD info
163 // (available on SnowLeopard only). If that fails, then check in the default
164 // addresses.
165 void DynamicLoaderMacOS::DoInitialImageFetch() {
166   Log *log = GetLog(LLDBLog::DynamicLoader);
167 
168   // Remove any binaries we pre-loaded in the Target before
169   // launching/attaching. If the same binaries are present in the process,
170   // we'll get them from the shared module cache, we won't need to re-load them
171   // from disk.
172   UnloadAllImages();
173 
174   StructuredData::ObjectSP all_image_info_json_sp(
175       m_process->GetLoadedDynamicLibrariesInfos());
176   ImageInfo::collection image_infos;
177   if (all_image_info_json_sp.get() &&
178       all_image_info_json_sp->GetAsDictionary() &&
179       all_image_info_json_sp->GetAsDictionary()->HasKey("images") &&
180       all_image_info_json_sp->GetAsDictionary()
181           ->GetValueForKey("images")
182           ->GetAsArray()) {
183     if (JSONImageInformationIntoImageInfo(all_image_info_json_sp,
184                                           image_infos)) {
185       LLDB_LOGF(log, "Initial module fetch:  Adding %" PRId64 " modules.\n",
186                 (uint64_t)image_infos.size());
187 
188       UpdateSpecialBinariesFromNewImageInfos(image_infos);
189       AddModulesUsingImageInfos(image_infos);
190     }
191   }
192 
193   m_dyld_image_infos_stop_id = m_process->GetStopID();
194   m_maybe_image_infos_address = m_process->GetImageInfoAddress();
195 }
196 
197 bool DynamicLoaderMacOS::NeedToDoInitialImageFetch() { return true; }
198 
199 // Static callback function that gets called when our DYLD notification
200 // breakpoint gets hit. We update all of our image infos and then let our super
201 // class DynamicLoader class decide if we should stop or not (based on global
202 // preference).
203 bool DynamicLoaderMacOS::NotifyBreakpointHit(void *baton,
204                                              StoppointCallbackContext *context,
205                                              lldb::user_id_t break_id,
206                                              lldb::user_id_t break_loc_id) {
207   // Let the event know that the images have changed
208   // DYLD passes three arguments to the notification breakpoint.
209   // Arg1: enum dyld_notify_mode mode - 0 = adding, 1 = removing, 2 = remove
210   // all Arg2: unsigned long icount        - Number of shared libraries
211   // added/removed Arg3: uint64_t mach_headers[]     - Array of load addresses
212   // of binaries added/removed
213 
214   DynamicLoaderMacOS *dyld_instance = (DynamicLoaderMacOS *)baton;
215 
216   ExecutionContext exe_ctx(context->exe_ctx_ref);
217   Process *process = exe_ctx.GetProcessPtr();
218 
219   // This is a sanity check just in case this dyld_instance is an old dyld
220   // plugin's breakpoint still lying around.
221   if (process != dyld_instance->m_process)
222     return false;
223 
224   if (dyld_instance->m_image_infos_stop_id != UINT32_MAX &&
225       process->GetStopID() < dyld_instance->m_image_infos_stop_id) {
226     return false;
227   }
228 
229   const lldb::ABISP &abi = process->GetABI();
230   if (abi) {
231     // Build up the value array to store the three arguments given above, then
232     // get the values from the ABI:
233 
234     TypeSystemClang *clang_ast_context =
235         ScratchTypeSystemClang::GetForTarget(process->GetTarget());
236     if (!clang_ast_context)
237       return false;
238 
239     ValueList argument_values;
240 
241     Value mode_value;    // enum dyld_notify_mode { dyld_notify_adding=0,
242                          // dyld_notify_removing=1, dyld_notify_remove_all=2 };
243     Value count_value;   // unsigned long count
244     Value headers_value; // uint64_t machHeaders[] (aka void*)
245 
246     CompilerType clang_void_ptr_type =
247         clang_ast_context->GetBasicType(eBasicTypeVoid).GetPointerType();
248     CompilerType clang_uint32_type =
249         clang_ast_context->GetBuiltinTypeForEncodingAndBitSize(
250             lldb::eEncodingUint, 32);
251     CompilerType clang_uint64_type =
252         clang_ast_context->GetBuiltinTypeForEncodingAndBitSize(
253             lldb::eEncodingUint, 32);
254 
255     mode_value.SetValueType(Value::ValueType::Scalar);
256     mode_value.SetCompilerType(clang_uint32_type);
257 
258     if (process->GetTarget().GetArchitecture().GetAddressByteSize() == 4) {
259       count_value.SetValueType(Value::ValueType::Scalar);
260       count_value.SetCompilerType(clang_uint32_type);
261     } else {
262       count_value.SetValueType(Value::ValueType::Scalar);
263       count_value.SetCompilerType(clang_uint64_type);
264     }
265 
266     headers_value.SetValueType(Value::ValueType::Scalar);
267     headers_value.SetCompilerType(clang_void_ptr_type);
268 
269     argument_values.PushValue(mode_value);
270     argument_values.PushValue(count_value);
271     argument_values.PushValue(headers_value);
272 
273     if (abi->GetArgumentValues(exe_ctx.GetThreadRef(), argument_values)) {
274       uint32_t dyld_mode =
275           argument_values.GetValueAtIndex(0)->GetScalar().UInt(-1);
276       if (dyld_mode != static_cast<uint32_t>(-1)) {
277         // Okay the mode was right, now get the number of elements, and the
278         // array of new elements...
279         uint32_t image_infos_count =
280             argument_values.GetValueAtIndex(1)->GetScalar().UInt(-1);
281         if (image_infos_count != static_cast<uint32_t>(-1)) {
282           addr_t header_array =
283               argument_values.GetValueAtIndex(2)->GetScalar().ULongLong(-1);
284           if (header_array != static_cast<uint64_t>(-1)) {
285             std::vector<addr_t> image_load_addresses;
286             for (uint64_t i = 0; i < image_infos_count; i++) {
287               Status error;
288               addr_t addr = process->ReadUnsignedIntegerFromMemory(
289                   header_array + (8 * i), 8, LLDB_INVALID_ADDRESS, error);
290               if (addr != LLDB_INVALID_ADDRESS) {
291                 image_load_addresses.push_back(addr);
292               }
293             }
294             if (dyld_mode == 0) {
295               // dyld_notify_adding
296               if (process->GetTarget().GetImages().GetSize() == 0) {
297                 // When all images have been removed, we're doing the
298                 // dyld handover from a launch-dyld to a shared-cache-dyld,
299                 // and we've just hit our one-shot address breakpoint in
300                 // the sc-dyld.  Note that the image addresses passed to
301                 // this function are inferior sizeof(void*) not uint64_t's
302                 // like our normal notification, so don't even look at
303                 // image_load_addresses.
304 
305                 dyld_instance->ClearDYLDHandoverBreakpoint();
306 
307                 dyld_instance->DoInitialImageFetch();
308                 dyld_instance->SetNotificationBreakpoint();
309               } else {
310                 dyld_instance->AddBinaries(image_load_addresses);
311               }
312             } else if (dyld_mode == 1) {
313               // dyld_notify_removing
314               dyld_instance->UnloadImages(image_load_addresses);
315             } else if (dyld_mode == 2) {
316               // dyld_notify_remove_all
317               dyld_instance->UnloadAllImages();
318             } else if (dyld_mode == 3 && image_infos_count == 1) {
319               // dyld_image_dyld_moved
320 
321               dyld_instance->ClearNotificationBreakpoint();
322               dyld_instance->UnloadAllImages();
323               dyld_instance->ClearDYLDModule();
324               process->GetTarget().GetImages().Clear();
325               process->GetTarget().GetSectionLoadList().Clear();
326 
327               addr_t all_image_infos = process->GetImageInfoAddress();
328               int addr_size =
329                   process->GetTarget().GetArchitecture().GetAddressByteSize();
330               addr_t notification_location = all_image_infos +
331                                              4 +        // version
332                                              4 +        // infoArrayCount
333                                              addr_size; // infoArray
334               Status error;
335               addr_t notification_addr =
336                   process->ReadPointerFromMemory(notification_location, error);
337               if (ABISP abi_sp = process->GetABI())
338                 notification_addr = abi_sp->FixCodeAddress (notification_addr);
339 
340               dyld_instance->SetDYLDHandoverBreakpoint(notification_addr);
341             }
342           }
343         }
344       }
345     }
346   } else {
347     Target &target = process->GetTarget();
348     Debugger::ReportWarning(
349         "no ABI plugin located for triple " +
350             target.GetArchitecture().GetTriple().getTriple() +
351             ": shared libraries will not be registered",
352         target.GetDebugger().GetID());
353   }
354 
355   // Return true to stop the target, false to just let the target run
356   return dyld_instance->GetStopWhenImagesChange();
357 }
358 
359 void DynamicLoaderMacOS::AddBinaries(
360     const std::vector<lldb::addr_t> &load_addresses) {
361   Log *log = GetLog(LLDBLog::DynamicLoader);
362   ImageInfo::collection image_infos;
363 
364   LLDB_LOGF(log, "Adding %" PRId64 " modules.",
365             (uint64_t)load_addresses.size());
366   StructuredData::ObjectSP binaries_info_sp =
367       m_process->GetLoadedDynamicLibrariesInfos(load_addresses);
368   if (binaries_info_sp.get() && binaries_info_sp->GetAsDictionary() &&
369       binaries_info_sp->GetAsDictionary()->HasKey("images") &&
370       binaries_info_sp->GetAsDictionary()
371           ->GetValueForKey("images")
372           ->GetAsArray() &&
373       binaries_info_sp->GetAsDictionary()
374               ->GetValueForKey("images")
375               ->GetAsArray()
376               ->GetSize() == load_addresses.size()) {
377     if (JSONImageInformationIntoImageInfo(binaries_info_sp, image_infos)) {
378       UpdateSpecialBinariesFromNewImageInfos(image_infos);
379       AddModulesUsingImageInfos(image_infos);
380     }
381     m_dyld_image_infos_stop_id = m_process->GetStopID();
382   }
383 }
384 
385 // Dump the _dyld_all_image_infos members and all current image infos that we
386 // have parsed to the file handle provided.
387 void DynamicLoaderMacOS::PutToLog(Log *log) const {
388   if (log == nullptr)
389     return;
390 }
391 
392 bool DynamicLoaderMacOS::SetNotificationBreakpoint() {
393   if (m_break_id == LLDB_INVALID_BREAK_ID) {
394     ModuleSP dyld_sp(GetDYLDModule());
395     if (dyld_sp) {
396       bool internal = true;
397       bool hardware = false;
398       LazyBool skip_prologue = eLazyBoolNo;
399       FileSpecList *source_files = nullptr;
400       FileSpecList dyld_filelist;
401       dyld_filelist.Append(dyld_sp->GetFileSpec());
402 
403       Breakpoint *breakpoint =
404           m_process->GetTarget()
405               .CreateBreakpoint(&dyld_filelist, source_files,
406                                 "_dyld_debugger_notification",
407                                 eFunctionNameTypeFull, eLanguageTypeC, 0,
408                                 skip_prologue, internal, hardware)
409               .get();
410       breakpoint->SetCallback(DynamicLoaderMacOS::NotifyBreakpointHit, this,
411                               true);
412       breakpoint->SetBreakpointKind("shared-library-event");
413       m_break_id = breakpoint->GetID();
414     }
415   }
416   return m_break_id != LLDB_INVALID_BREAK_ID;
417 }
418 
419 bool DynamicLoaderMacOS::SetDYLDHandoverBreakpoint(addr_t notification_address) {
420   if (m_dyld_handover_break_id == LLDB_INVALID_BREAK_ID) {
421     BreakpointSP dyld_handover_bp =
422         m_process->GetTarget().CreateBreakpoint(notification_address, true,
423                                               false);
424     dyld_handover_bp->SetCallback(
425         DynamicLoaderMacOS::NotifyBreakpointHit, this, true);
426     dyld_handover_bp->SetOneShot(true);
427     m_dyld_handover_break_id = dyld_handover_bp->GetID();
428     return true;
429   }
430   return false;
431 }
432 
433 void DynamicLoaderMacOS::ClearDYLDHandoverBreakpoint() {
434   if (LLDB_BREAK_ID_IS_VALID(m_dyld_handover_break_id))
435     m_process->GetTarget().RemoveBreakpointByID(m_dyld_handover_break_id);
436   m_dyld_handover_break_id = LLDB_INVALID_BREAK_ID;
437 }
438 
439 
440 addr_t
441 DynamicLoaderMacOS::GetDyldLockVariableAddressFromModule(Module *module) {
442   SymbolContext sc;
443   Target &target = m_process->GetTarget();
444   if (Symtab *symtab = module->GetSymtab()) {
445     std::vector<uint32_t> match_indexes;
446     ConstString g_symbol_name("_dyld_global_lock_held");
447     uint32_t num_matches = 0;
448     num_matches =
449         symtab->AppendSymbolIndexesWithName(g_symbol_name, match_indexes);
450     if (num_matches == 1) {
451       Symbol *symbol = symtab->SymbolAtIndex(match_indexes[0]);
452       if (symbol &&
453           (symbol->ValueIsAddress() || symbol->GetAddressRef().IsValid())) {
454         return symbol->GetAddressRef().GetOpcodeLoadAddress(&target);
455       }
456     }
457   }
458   return LLDB_INVALID_ADDRESS;
459 }
460 
461 //  Look for this symbol:
462 //
463 //  int __attribute__((visibility("hidden")))           _dyld_global_lock_held =
464 //  0;
465 //
466 //  in libdyld.dylib.
467 Status DynamicLoaderMacOS::CanLoadImage() {
468   Status error;
469   addr_t symbol_address = LLDB_INVALID_ADDRESS;
470   ConstString g_libdyld_name("libdyld.dylib");
471   Target &target = m_process->GetTarget();
472   const ModuleList &target_modules = target.GetImages();
473   std::lock_guard<std::recursive_mutex> guard(target_modules.GetMutex());
474 
475   // Find any modules named "libdyld.dylib" and look for the symbol there first
476   for (ModuleSP module_sp : target.GetImages().ModulesNoLocking()) {
477     if (module_sp) {
478       if (module_sp->GetFileSpec().GetFilename() == g_libdyld_name) {
479         symbol_address = GetDyldLockVariableAddressFromModule(module_sp.get());
480         if (symbol_address != LLDB_INVALID_ADDRESS)
481           break;
482       }
483     }
484   }
485 
486   // Search through all modules looking for the symbol in them
487   if (symbol_address == LLDB_INVALID_ADDRESS) {
488     for (ModuleSP module_sp : target.GetImages().Modules()) {
489       if (module_sp) {
490         addr_t symbol_address =
491             GetDyldLockVariableAddressFromModule(module_sp.get());
492         if (symbol_address != LLDB_INVALID_ADDRESS)
493           break;
494       }
495     }
496   }
497 
498   // Default assumption is that it is OK to load images. Only say that we
499   // cannot load images if we find the symbol in libdyld and it indicates that
500   // we cannot.
501 
502   if (symbol_address != LLDB_INVALID_ADDRESS) {
503     {
504       int lock_held =
505           m_process->ReadUnsignedIntegerFromMemory(symbol_address, 4, 0, error);
506       if (lock_held != 0) {
507         error.SetErrorString("dyld lock held - unsafe to load images.");
508       }
509     }
510   } else {
511     // If we were unable to find _dyld_global_lock_held in any modules, or it
512     // is not loaded into memory yet, we may be at process startup (sitting  at
513     // _dyld_start) - so we should not allow dlopen calls. But if we found more
514     // than one module then we are clearly past _dyld_start so in that case
515     // we'll default to "it's safe".
516     if (target.GetImages().GetSize() <= 1)
517       error.SetErrorString("could not find the dyld library or "
518                            "the dyld lock symbol");
519   }
520   return error;
521 }
522 
523 bool DynamicLoaderMacOS::GetSharedCacheInformation(
524     lldb::addr_t &base_address, UUID &uuid, LazyBool &using_shared_cache,
525     LazyBool &private_shared_cache) {
526   base_address = LLDB_INVALID_ADDRESS;
527   uuid.Clear();
528   using_shared_cache = eLazyBoolCalculate;
529   private_shared_cache = eLazyBoolCalculate;
530 
531   if (m_process) {
532     StructuredData::ObjectSP info = m_process->GetSharedCacheInfo();
533     StructuredData::Dictionary *info_dict = nullptr;
534     if (info.get() && info->GetAsDictionary()) {
535       info_dict = info->GetAsDictionary();
536     }
537 
538     // {"shared_cache_base_address":140735683125248,"shared_cache_uuid
539     // ":"DDB8D70C-
540     // C9A2-3561-B2C8-BE48A4F33F96","no_shared_cache":false,"shared_cache_private_cache":false}
541 
542     if (info_dict && info_dict->HasKey("shared_cache_uuid") &&
543         info_dict->HasKey("no_shared_cache") &&
544         info_dict->HasKey("shared_cache_base_address")) {
545       base_address = info_dict->GetValueForKey("shared_cache_base_address")
546                          ->GetIntegerValue(LLDB_INVALID_ADDRESS);
547       std::string uuid_str = std::string(
548           info_dict->GetValueForKey("shared_cache_uuid")->GetStringValue());
549       if (!uuid_str.empty())
550         uuid.SetFromStringRef(uuid_str);
551       if (!info_dict->GetValueForKey("no_shared_cache")->GetBooleanValue())
552         using_shared_cache = eLazyBoolYes;
553       else
554         using_shared_cache = eLazyBoolNo;
555       if (info_dict->GetValueForKey("shared_cache_private_cache")
556               ->GetBooleanValue())
557         private_shared_cache = eLazyBoolYes;
558       else
559         private_shared_cache = eLazyBoolNo;
560 
561       return true;
562     }
563   }
564   return false;
565 }
566 
567 void DynamicLoaderMacOS::Initialize() {
568   PluginManager::RegisterPlugin(GetPluginNameStatic(),
569                                 GetPluginDescriptionStatic(), CreateInstance);
570 }
571 
572 void DynamicLoaderMacOS::Terminate() {
573   PluginManager::UnregisterPlugin(CreateInstance);
574 }
575 
576 llvm::StringRef DynamicLoaderMacOS::GetPluginDescriptionStatic() {
577   return "Dynamic loader plug-in that watches for shared library loads/unloads "
578          "in MacOSX user processes.";
579 }
580