Coverage Report

Created: 2022-01-18 06:27

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