LLDB  mainline
DynamicLoaderDarwin.cpp
Go to the documentation of this file.
1 //===-- DynamicLoaderDarwin.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 "DynamicLoaderDarwin.h"
10 
12 #include "lldb/Core/Debugger.h"
13 #include "lldb/Core/Module.h"
14 #include "lldb/Core/ModuleSpec.h"
16 #include "lldb/Core/Section.h"
18 #include "lldb/Host/FileSystem.h"
19 #include "lldb/Host/HostInfo.h"
20 #include "lldb/Symbol/Function.h"
21 #include "lldb/Symbol/ObjectFile.h"
22 #include "lldb/Target/ABI.h"
24 #include "lldb/Target/StackFrame.h"
25 #include "lldb/Target/Target.h"
26 #include "lldb/Target/Thread.h"
31 #include "lldb/Utility/LLDBLog.h"
32 #include "lldb/Utility/Log.h"
33 #include "lldb/Utility/State.h"
34 
37 
38 //#define ENABLE_DEBUG_PRINTF // COMMENT THIS LINE OUT PRIOR TO CHECKIN
39 #ifdef ENABLE_DEBUG_PRINTF
40 #include <cstdio>
41 #define DEBUG_PRINTF(fmt, ...) printf(fmt, ##__VA_ARGS__)
42 #else
43 #define DEBUG_PRINTF(fmt, ...)
44 #endif
45 
46 #ifndef __APPLE__
48 #else
49 #include <uuid/uuid.h>
50 #endif
51 
52 #include <memory>
53 
54 using namespace lldb;
55 using namespace lldb_private;
56 
57 // Constructor
58 DynamicLoaderDarwin::DynamicLoaderDarwin(Process *process)
59  : DynamicLoader(process), m_dyld_module_wp(), m_libpthread_module_wp(),
60  m_pthread_getspecific_addr(), m_tid_to_tls_map(), m_dyld_image_infos(),
61  m_dyld_image_infos_stop_id(UINT32_MAX), m_dyld(), m_mutex() {}
62 
63 // Destructor
65 
66 /// Called after attaching a process.
67 ///
68 /// Allow DynamicLoader plug-ins to execute some code after
69 /// attaching to a process.
74 }
75 
76 /// Called after attaching a process.
77 ///
78 /// Allow DynamicLoader plug-ins to execute some code after
79 /// attaching to a process.
84 }
85 
86 // Clear out the state of this class.
87 void DynamicLoaderDarwin::Clear(bool clear_process) {
88  std::lock_guard<std::recursive_mutex> guard(m_mutex);
89  if (clear_process)
90  m_process = nullptr;
91  m_dyld_image_infos.clear();
93  m_dyld.Clear(false);
94 }
95 
97  ImageInfo &image_info, bool can_create, bool *did_create_ptr) {
98  if (did_create_ptr)
99  *did_create_ptr = false;
100 
101  Target &target = m_process->GetTarget();
102  const ModuleList &target_images = target.GetImages();
103  ModuleSpec module_spec(image_info.file_spec);
104  module_spec.GetUUID() = image_info.uuid;
105 
106  // macCatalyst support: Request matching os/environment.
107  {
108  auto &target_triple = target.GetArchitecture().GetTriple();
109  if (target_triple.getOS() == llvm::Triple::IOS &&
110  target_triple.getEnvironment() == llvm::Triple::MacABI) {
111  // Request the macCatalyst variant of frameworks that have both
112  // a PLATFORM_MACOS and a PLATFORM_MACCATALYST load command.
113  module_spec.GetArchitecture() = ArchSpec(target_triple);
114  }
115  }
116 
117  ModuleSP module_sp(target_images.FindFirstModule(module_spec));
118 
119  if (module_sp && !module_spec.GetUUID().IsValid() &&
120  !module_sp->GetUUID().IsValid()) {
121  // No UUID, we must rely upon the cached module modification time and the
122  // modification time of the file on disk
123  if (module_sp->GetModificationTime() !=
124  FileSystem::Instance().GetModificationTime(module_sp->GetFileSpec()))
125  module_sp.reset();
126  }
127 
128  if (module_sp || !can_create)
129  return module_sp;
130 
131  if (HostInfo::GetArchitecture().IsCompatibleMatch(target.GetArchitecture())) {
132  // When debugging on the host, we are most likely using the same shared
133  // cache as our inferior. The dylibs from the shared cache might not
134  // exist on the filesystem, so let's use the images in our own memory
135  // to create the modules.
136  // Check if the requested image is in our shared cache.
137  SharedCacheImageInfo image_info =
138  HostInfo::GetSharedCacheImageInfo(module_spec.GetFileSpec().GetPath());
139 
140  // If we found it and it has the correct UUID, let's proceed with
141  // creating a module from the memory contents.
142  if (image_info.uuid &&
143  (!module_spec.GetUUID() || module_spec.GetUUID() == image_info.uuid)) {
144  ModuleSpec shared_cache_spec(module_spec.GetFileSpec(), image_info.uuid,
145  image_info.data_sp);
146  module_sp =
147  target.GetOrCreateModule(shared_cache_spec, false /* notify */);
148  }
149  }
150  // We'll call Target::ModulesDidLoad after all the modules have been
151  // added to the target, don't let it be called for every one.
152  if (!module_sp)
153  module_sp = target.GetOrCreateModule(module_spec, false /* notify */);
154  if (!module_sp || module_sp->GetObjectFile() == nullptr)
155  module_sp = m_process->ReadModuleFromMemory(image_info.file_spec,
156  image_info.address);
157 
158  if (did_create_ptr)
159  *did_create_ptr = (bool)module_sp;
160 
161  return module_sp;
162 }
163 
165  const std::vector<lldb::addr_t> &solib_addresses) {
166  std::lock_guard<std::recursive_mutex> guard(m_mutex);
168  return;
169 
171  Target &target = m_process->GetTarget();
172  LLDB_LOGF(log, "Removing %" PRId64 " modules.",
173  (uint64_t)solib_addresses.size());
174 
175  ModuleList unloaded_module_list;
176 
177  for (addr_t solib_addr : solib_addresses) {
178  Address header;
179  if (header.SetLoadAddress(solib_addr, &target)) {
180  if (header.GetOffset() == 0) {
181  ModuleSP module_to_remove(header.GetModule());
182  if (module_to_remove.get()) {
183  LLDB_LOGF(log, "Removing module at address 0x%" PRIx64, solib_addr);
184  // remove the sections from the Target
185  UnloadSections(module_to_remove);
186  // add this to the list of modules to remove
187  unloaded_module_list.AppendIfNeeded(module_to_remove);
188  // remove the entry from the m_dyld_image_infos
189  ImageInfo::collection::iterator pos, end = m_dyld_image_infos.end();
190  for (pos = m_dyld_image_infos.begin(); pos != end; pos++) {
191  if (solib_addr == (*pos).address) {
192  m_dyld_image_infos.erase(pos);
193  break;
194  }
195  }
196  }
197  }
198  }
199  }
200 
201  if (unloaded_module_list.GetSize() > 0) {
202  if (log) {
203  log->PutCString("Unloaded:");
204  unloaded_module_list.LogUUIDAndPaths(
205  log, "DynamicLoaderDarwin::UnloadModules");
206  }
207  m_process->GetTarget().GetImages().Remove(unloaded_module_list);
209  }
210 }
211 
214  ModuleList unloaded_modules_list;
215 
216  Target &target = m_process->GetTarget();
217  const ModuleList &target_modules = target.GetImages();
218  std::lock_guard<std::recursive_mutex> guard(target_modules.GetMutex());
219 
220  ModuleSP dyld_sp(GetDYLDModule());
221  for (ModuleSP module_sp : target_modules.Modules()) {
222  // Don't remove dyld - else we'll lose our breakpoint notifying us about
223  // libraries being re-loaded...
224  if (module_sp && module_sp != dyld_sp) {
225  UnloadSections(module_sp);
226  unloaded_modules_list.Append(module_sp);
227  }
228  }
229 
230  if (unloaded_modules_list.GetSize() != 0) {
231  if (log) {
232  log->PutCString("Unloaded:");
233  unloaded_modules_list.LogUUIDAndPaths(
234  log, "DynamicLoaderDarwin::UnloadAllImages");
235  }
236  target.GetImages().Remove(unloaded_modules_list);
237  m_dyld_image_infos.clear();
239  }
240 }
241 
242 // Update the load addresses for all segments in MODULE using the updated INFO
243 // that is passed in.
245  ImageInfo &info) {
246  bool changed = false;
247  if (module) {
248  ObjectFile *image_object_file = module->GetObjectFile();
249  if (image_object_file) {
250  SectionList *section_list = image_object_file->GetSectionList();
251  if (section_list) {
252  std::vector<uint32_t> inaccessible_segment_indexes;
253  // We now know the slide amount, so go through all sections and update
254  // the load addresses with the correct values.
255  const size_t num_segments = info.segments.size();
256  for (size_t i = 0; i < num_segments; ++i) {
257  // Only load a segment if it has protections. Things like __PAGEZERO
258  // don't have any protections, and they shouldn't be slid
259  SectionSP section_sp(
260  section_list->FindSectionByName(info.segments[i].name));
261 
262  if (info.segments[i].maxprot == 0) {
263  inaccessible_segment_indexes.push_back(i);
264  } else {
265  const addr_t new_section_load_addr =
266  info.segments[i].vmaddr + info.slide;
267  static ConstString g_section_name_LINKEDIT("__LINKEDIT");
268 
269  if (section_sp) {
270  // __LINKEDIT sections from files in the shared cache can overlap
271  // so check to see what the segment name is and pass "false" so
272  // we don't warn of overlapping "Section" objects, and "true" for
273  // all other sections.
274  const bool warn_multiple =
275  section_sp->GetName() != g_section_name_LINKEDIT;
276 
278  section_sp, new_section_load_addr, warn_multiple);
279  }
280  }
281  }
282 
283  // If the loaded the file (it changed) and we have segments that are
284  // not readable or writeable, add them to the invalid memory region
285  // cache for the process. This will typically only be the __PAGEZERO
286  // segment in the main executable. We might be able to apply this more
287  // generally to more sections that have no protections in the future,
288  // but for now we are going to just do __PAGEZERO.
289  if (changed && !inaccessible_segment_indexes.empty()) {
290  for (uint32_t i = 0; i < inaccessible_segment_indexes.size(); ++i) {
291  const uint32_t seg_idx = inaccessible_segment_indexes[i];
292  SectionSP section_sp(
293  section_list->FindSectionByName(info.segments[seg_idx].name));
294 
295  if (section_sp) {
296  static ConstString g_pagezero_section_name("__PAGEZERO");
297  if (g_pagezero_section_name == section_sp->GetName()) {
298  // __PAGEZERO never slides...
299  const lldb::addr_t vmaddr = info.segments[seg_idx].vmaddr;
300  const lldb::addr_t vmsize = info.segments[seg_idx].vmsize;
301  Process::LoadRange pagezero_range(vmaddr, vmsize);
302  m_process->AddInvalidMemoryRegion(pagezero_range);
303  }
304  }
305  }
306  }
307  }
308  }
309  }
310  // We might have an in memory image that was loaded as soon as it was created
311  if (info.load_stop_id == m_process->GetStopID())
312  changed = true;
313  else if (changed) {
314  // Update the stop ID when this library was updated
315  info.load_stop_id = m_process->GetStopID();
316  }
317  return changed;
318 }
319 
320 // Unload the segments in MODULE using the INFO that is passed in.
322  ImageInfo &info) {
323  bool changed = false;
324  if (module) {
325  ObjectFile *image_object_file = module->GetObjectFile();
326  if (image_object_file) {
327  SectionList *section_list = image_object_file->GetSectionList();
328  if (section_list) {
329  const size_t num_segments = info.segments.size();
330  for (size_t i = 0; i < num_segments; ++i) {
331  SectionSP section_sp(
332  section_list->FindSectionByName(info.segments[i].name));
333  if (section_sp) {
334  const addr_t old_section_load_addr =
335  info.segments[i].vmaddr + info.slide;
337  section_sp, old_section_load_addr))
338  changed = true;
339  } else {
341  llvm::formatv("unable to find and unload segment named "
342  "'{0}' in '{1}' in macosx dynamic loader plug-in",
343  info.segments[i].name.AsCString("<invalid>"),
344  image_object_file->GetFileSpec().GetPath()));
345  }
346  }
347  }
348  }
349  }
350  return changed;
351 }
352 
353 // Given a JSON dictionary (from debugserver, most likely) of binary images
354 // loaded in the inferior process, add the images to the ImageInfo collection.
355 
357  StructuredData::ObjectSP image_details,
358  ImageInfo::collection &image_infos) {
359  StructuredData::ObjectSP images_sp =
360  image_details->GetAsDictionary()->GetValueForKey("images");
361  if (images_sp.get() == nullptr)
362  return false;
363 
364  image_infos.resize(images_sp->GetAsArray()->GetSize());
365 
366  for (size_t i = 0; i < image_infos.size(); i++) {
367  StructuredData::ObjectSP image_sp =
368  images_sp->GetAsArray()->GetItemAtIndex(i);
369  if (image_sp.get() == nullptr || image_sp->GetAsDictionary() == nullptr)
370  return false;
371  StructuredData::Dictionary *image = image_sp->GetAsDictionary();
372  // clang-format off
373  if (!image->HasKey("load_address") ||
374  !image->HasKey("pathname") ||
375  !image->HasKey("mod_date") ||
376  !image->HasKey("mach_header") ||
377  image->GetValueForKey("mach_header")->GetAsDictionary() == nullptr ||
378  !image->HasKey("segments") ||
379  image->GetValueForKey("segments")->GetAsArray() == nullptr ||
380  !image->HasKey("uuid")) {
381  return false;
382  }
383  // clang-format on
384  image_infos[i].address =
385  image->GetValueForKey("load_address")->GetAsInteger()->GetValue();
386  image_infos[i].mod_date =
387  image->GetValueForKey("mod_date")->GetAsInteger()->GetValue();
388  image_infos[i].file_spec.SetFile(
389  image->GetValueForKey("pathname")->GetAsString()->GetValue(),
390  FileSpec::Style::native);
391 
393  image->GetValueForKey("mach_header")->GetAsDictionary();
394  image_infos[i].header.magic =
395  mh->GetValueForKey("magic")->GetAsInteger()->GetValue();
396  image_infos[i].header.cputype =
397  mh->GetValueForKey("cputype")->GetAsInteger()->GetValue();
398  image_infos[i].header.cpusubtype =
399  mh->GetValueForKey("cpusubtype")->GetAsInteger()->GetValue();
400  image_infos[i].header.filetype =
401  mh->GetValueForKey("filetype")->GetAsInteger()->GetValue();
402 
403  if (image->HasKey("min_version_os_name")) {
404  std::string os_name =
405  std::string(image->GetValueForKey("min_version_os_name")
406  ->GetAsString()
407  ->GetValue());
408  if (os_name == "macosx")
409  image_infos[i].os_type = llvm::Triple::MacOSX;
410  else if (os_name == "ios" || os_name == "iphoneos")
411  image_infos[i].os_type = llvm::Triple::IOS;
412  else if (os_name == "tvos")
413  image_infos[i].os_type = llvm::Triple::TvOS;
414  else if (os_name == "watchos")
415  image_infos[i].os_type = llvm::Triple::WatchOS;
416  // NEED_BRIDGEOS_TRIPLE else if (os_name == "bridgeos")
417  // NEED_BRIDGEOS_TRIPLE image_infos[i].os_type = llvm::Triple::BridgeOS;
418  else if (os_name == "maccatalyst") {
419  image_infos[i].os_type = llvm::Triple::IOS;
420  image_infos[i].os_env = llvm::Triple::MacABI;
421  } else if (os_name == "iossimulator") {
422  image_infos[i].os_type = llvm::Triple::IOS;
423  image_infos[i].os_env = llvm::Triple::Simulator;
424  } else if (os_name == "tvossimulator") {
425  image_infos[i].os_type = llvm::Triple::TvOS;
426  image_infos[i].os_env = llvm::Triple::Simulator;
427  } else if (os_name == "watchossimulator") {
428  image_infos[i].os_type = llvm::Triple::WatchOS;
429  image_infos[i].os_env = llvm::Triple::Simulator;
430  }
431  }
432  if (image->HasKey("min_version_os_sdk")) {
433  image_infos[i].min_version_os_sdk =
434  std::string(image->GetValueForKey("min_version_os_sdk")
435  ->GetAsString()
436  ->GetValue());
437  }
438 
439  // Fields that aren't used by DynamicLoaderDarwin so debugserver doesn't
440  // currently send them in the reply.
441 
442  if (mh->HasKey("flags"))
443  image_infos[i].header.flags =
444  mh->GetValueForKey("flags")->GetAsInteger()->GetValue();
445  else
446  image_infos[i].header.flags = 0;
447 
448  if (mh->HasKey("ncmds"))
449  image_infos[i].header.ncmds =
450  mh->GetValueForKey("ncmds")->GetAsInteger()->GetValue();
451  else
452  image_infos[i].header.ncmds = 0;
453 
454  if (mh->HasKey("sizeofcmds"))
455  image_infos[i].header.sizeofcmds =
456  mh->GetValueForKey("sizeofcmds")->GetAsInteger()->GetValue();
457  else
458  image_infos[i].header.sizeofcmds = 0;
459 
460  StructuredData::Array *segments =
461  image->GetValueForKey("segments")->GetAsArray();
462  uint32_t segcount = segments->GetSize();
463  for (size_t j = 0; j < segcount; j++) {
464  Segment segment;
466  segments->GetItemAtIndex(j)->GetAsDictionary();
467  segment.name =
468  ConstString(seg->GetValueForKey("name")->GetAsString()->GetValue());
469  segment.vmaddr =
470  seg->GetValueForKey("vmaddr")->GetAsInteger()->GetValue();
471  segment.vmsize =
472  seg->GetValueForKey("vmsize")->GetAsInteger()->GetValue();
473  segment.fileoff =
474  seg->GetValueForKey("fileoff")->GetAsInteger()->GetValue();
475  segment.filesize =
476  seg->GetValueForKey("filesize")->GetAsInteger()->GetValue();
477  segment.maxprot =
478  seg->GetValueForKey("maxprot")->GetAsInteger()->GetValue();
479 
480  // Fields that aren't used by DynamicLoaderDarwin so debugserver doesn't
481  // currently send them in the reply.
482 
483  if (seg->HasKey("initprot"))
484  segment.initprot =
485  seg->GetValueForKey("initprot")->GetAsInteger()->GetValue();
486  else
487  segment.initprot = 0;
488 
489  if (seg->HasKey("flags"))
490  segment.flags =
491  seg->GetValueForKey("flags")->GetAsInteger()->GetValue();
492  else
493  segment.flags = 0;
494 
495  if (seg->HasKey("nsects"))
496  segment.nsects =
497  seg->GetValueForKey("nsects")->GetAsInteger()->GetValue();
498  else
499  segment.nsects = 0;
500 
501  image_infos[i].segments.push_back(segment);
502  }
503 
504  image_infos[i].uuid.SetFromOptionalStringRef(
505  image->GetValueForKey("uuid")->GetAsString()->GetValue());
506 
507  // All sections listed in the dyld image info structure will all either be
508  // fixed up already, or they will all be off by a single slide amount that
509  // is determined by finding the first segment that is at file offset zero
510  // which also has bytes (a file size that is greater than zero) in the
511  // object file.
512 
513  // Determine the slide amount (if any)
514  const size_t num_sections = image_infos[i].segments.size();
515  for (size_t k = 0; k < num_sections; ++k) {
516  // Iterate through the object file sections to find the first section
517  // that starts of file offset zero and that has bytes in the file...
518  if ((image_infos[i].segments[k].fileoff == 0 &&
519  image_infos[i].segments[k].filesize > 0) ||
520  (image_infos[i].segments[k].name == "__TEXT")) {
521  image_infos[i].slide =
522  image_infos[i].address - image_infos[i].segments[k].vmaddr;
523  // We have found the slide amount, so we can exit this for loop.
524  break;
525  }
526  }
527  }
528 
529  return true;
530 }
531 
533  ImageInfo::collection &image_infos) {
534  uint32_t exe_idx = UINT32_MAX;
535  uint32_t dyld_idx = UINT32_MAX;
536  Target &target = m_process->GetTarget();
538  ConstString g_dyld_sim_filename("dyld_sim");
539 
540  ArchSpec target_arch = target.GetArchitecture();
541  const size_t image_infos_size = image_infos.size();
542  for (size_t i = 0; i < image_infos_size; i++) {
543  if (image_infos[i].header.filetype == llvm::MachO::MH_DYLINKER) {
544  // In a "simulator" process we will have two dyld modules --
545  // a "dyld" that we want to keep track of, and a "dyld_sim" which
546  // we don't need to keep track of here. dyld_sim will have a non-macosx
547  // OS.
548  if (target_arch.GetTriple().getEnvironment() == llvm::Triple::Simulator &&
549  image_infos[i].os_type != llvm::Triple::OSType::MacOSX) {
550  continue;
551  }
552 
553  dyld_idx = i;
554  }
555  if (image_infos[i].header.filetype == llvm::MachO::MH_EXECUTE) {
556  exe_idx = i;
557  }
558  }
559 
560  // Set the target executable if we haven't found one so far.
561  if (exe_idx != UINT32_MAX && !target.GetExecutableModule()) {
562  const bool can_create = true;
563  ModuleSP exe_module_sp(FindTargetModuleForImageInfo(image_infos[exe_idx],
564  can_create, nullptr));
565  if (exe_module_sp) {
566  LLDB_LOGF(log, "Found executable module: %s",
567  exe_module_sp->GetFileSpec().GetPath().c_str());
568  target.GetImages().AppendIfNeeded(exe_module_sp);
569  UpdateImageLoadAddress(exe_module_sp.get(), image_infos[exe_idx]);
570  if (exe_module_sp.get() != target.GetExecutableModulePointer()) {
571  target.SetExecutableModule(exe_module_sp, eLoadDependentsNo);
572  }
573  }
574  }
575 
576  if (dyld_idx != UINT32_MAX) {
577  const bool can_create = true;
578  ModuleSP dyld_sp = FindTargetModuleForImageInfo(image_infos[dyld_idx],
579  can_create, nullptr);
580  if (dyld_sp.get()) {
581  LLDB_LOGF(log, "Found dyld module: %s",
582  dyld_sp->GetFileSpec().GetPath().c_str());
583  target.GetImages().AppendIfNeeded(dyld_sp);
584  UpdateImageLoadAddress(dyld_sp.get(), image_infos[dyld_idx]);
585  SetDYLDModule(dyld_sp);
586  }
587  }
588 }
589 
591  ImageInfo &image_info) {
592  if (image_info.header.filetype == llvm::MachO::MH_DYLINKER) {
593  const bool can_create = true;
594  ModuleSP dyld_sp =
595  FindTargetModuleForImageInfo(image_info, can_create, nullptr);
596  if (dyld_sp.get()) {
597  Target &target = m_process->GetTarget();
598  target.GetImages().AppendIfNeeded(dyld_sp);
599  UpdateImageLoadAddress(dyld_sp.get(), image_info);
600  SetDYLDModule(dyld_sp);
601  }
602  }
603 }
604 
605 void DynamicLoaderDarwin::SetDYLDModule(lldb::ModuleSP &dyld_module_sp) {
606  m_dyld_module_wp = dyld_module_sp;
607 }
608 
610  ModuleSP dyld_sp(m_dyld_module_wp.lock());
611  return dyld_sp;
612 }
613 
615 
617  ImageInfo::collection &image_infos) {
618  std::lock_guard<std::recursive_mutex> guard(m_mutex);
619  // Now add these images to the main list.
620  ModuleList loaded_module_list;
622  Target &target = m_process->GetTarget();
623  ModuleList &target_images = target.GetImages();
624 
625  for (uint32_t idx = 0; idx < image_infos.size(); ++idx) {
626  if (log) {
627  LLDB_LOGF(log, "Adding new image at address=0x%16.16" PRIx64 ".",
628  image_infos[idx].address);
629  image_infos[idx].PutToLog(log);
630  }
631 
632  m_dyld_image_infos.push_back(image_infos[idx]);
633 
634  ModuleSP image_module_sp(
635  FindTargetModuleForImageInfo(image_infos[idx], true, nullptr));
636 
637  if (image_module_sp) {
638  ObjectFile *objfile = image_module_sp->GetObjectFile();
639  if (objfile) {
640  SectionList *sections = objfile->GetSectionList();
641  if (sections) {
642  ConstString commpage_dbstr("__commpage");
643  Section *commpage_section =
644  sections->FindSectionByName(commpage_dbstr).get();
645  if (commpage_section) {
646  ModuleSpec module_spec(objfile->GetFileSpec(),
647  image_infos[idx].GetArchitecture());
648  module_spec.GetObjectName() = commpage_dbstr;
649  ModuleSP commpage_image_module_sp(
650  target_images.FindFirstModule(module_spec));
651  if (!commpage_image_module_sp) {
652  module_spec.SetObjectOffset(objfile->GetFileOffset() +
653  commpage_section->GetFileOffset());
654  module_spec.SetObjectSize(objfile->GetByteSize());
655  commpage_image_module_sp = target.GetOrCreateModule(module_spec,
656  true /* notify */);
657  if (!commpage_image_module_sp ||
658  commpage_image_module_sp->GetObjectFile() == nullptr) {
659  commpage_image_module_sp = m_process->ReadModuleFromMemory(
660  image_infos[idx].file_spec, image_infos[idx].address);
661  // Always load a memory image right away in the target in case
662  // we end up trying to read the symbol table from memory... The
663  // __LINKEDIT will need to be mapped so we can figure out where
664  // the symbol table bits are...
665  bool changed = false;
666  UpdateImageLoadAddress(commpage_image_module_sp.get(),
667  image_infos[idx]);
668  target.GetImages().Append(commpage_image_module_sp);
669  if (changed) {
670  image_infos[idx].load_stop_id = m_process->GetStopID();
671  loaded_module_list.AppendIfNeeded(commpage_image_module_sp);
672  }
673  }
674  }
675  }
676  }
677  }
678 
679  // UpdateImageLoadAddress will return true if any segments change load
680  // address. We need to check this so we don't mention that all loaded
681  // shared libraries are newly loaded each time we hit out dyld breakpoint
682  // since dyld will list all shared libraries each time.
683  if (UpdateImageLoadAddress(image_module_sp.get(), image_infos[idx])) {
684  target_images.AppendIfNeeded(image_module_sp);
685  loaded_module_list.AppendIfNeeded(image_module_sp);
686  }
687 
688  // To support macCatalyst and legacy iOS simulator,
689  // update the module's platform with the DYLD info.
690  ArchSpec dyld_spec = image_infos[idx].GetArchitecture();
691  auto &dyld_triple = dyld_spec.GetTriple();
692  if ((dyld_triple.getEnvironment() == llvm::Triple::MacABI &&
693  dyld_triple.getOS() == llvm::Triple::IOS) ||
694  (dyld_triple.getEnvironment() == llvm::Triple::Simulator &&
695  (dyld_triple.getOS() == llvm::Triple::IOS ||
696  dyld_triple.getOS() == llvm::Triple::TvOS ||
697  dyld_triple.getOS() == llvm::Triple::WatchOS)))
698  image_module_sp->MergeArchitecture(dyld_spec);
699  }
700  }
701 
702  if (loaded_module_list.GetSize() > 0) {
703  if (log)
704  loaded_module_list.LogUUIDAndPaths(log,
705  "DynamicLoaderDarwin::ModulesDidLoad");
706  m_process->GetTarget().ModulesDidLoad(loaded_module_list);
707  }
708  return true;
709 }
710 
711 // On Mac OS X libobjc (the Objective-C runtime) has several critical dispatch
712 // functions written in hand-written assembly, and also have hand-written
713 // unwind information in the eh_frame section. Normally we prefer analyzing
714 // the assembly instructions of a currently executing frame to unwind from that
715 // frame -- but on hand-written functions this profiling can fail. We should
716 // use the eh_frame instructions for these functions all the time.
717 //
718 // As an aside, it would be better if the eh_frame entries had a flag (or were
719 // extensible so they could have an Apple-specific flag) which indicates that
720 // the instructions are asynchronous -- accurate at every instruction, instead
721 // of our normal default assumption that they are not.
722 
724  ModuleSP module_sp;
725  if (sym_ctx.symbol) {
726  module_sp = sym_ctx.symbol->GetAddressRef().GetModule();
727  }
728  if (module_sp.get() == nullptr && sym_ctx.function) {
729  module_sp =
731  }
732  if (module_sp.get() == nullptr)
733  return false;
734 
736  return objc_runtime != nullptr &&
737  objc_runtime->IsModuleObjCLibrary(module_sp);
738 }
739 
740 // Dump a Segment to the file handle provided.
742  lldb::addr_t slide) const {
743  if (log) {
744  if (slide == 0)
745  LLDB_LOGF(log, "\t\t%16s [0x%16.16" PRIx64 " - 0x%16.16" PRIx64 ")",
746  name.AsCString(""), vmaddr + slide, vmaddr + slide + vmsize);
747  else
748  LLDB_LOGF(log,
749  "\t\t%16s [0x%16.16" PRIx64 " - 0x%16.16" PRIx64
750  ") slide = 0x%" PRIx64,
751  name.AsCString(""), vmaddr + slide, vmaddr + slide + vmsize,
752  slide);
753  }
754 }
755 
757  // Update the module's platform with the DYLD info.
758  lldb_private::ArchSpec arch_spec(lldb_private::eArchTypeMachO, header.cputype,
759  header.cpusubtype);
760  if (os_env == llvm::Triple::MacABI && os_type == llvm::Triple::IOS) {
761  llvm::Triple triple(llvm::Twine(arch_spec.GetArchitectureName()) +
762  "-apple-ios" + min_version_os_sdk + "-macabi");
763  ArchSpec maccatalyst_spec(triple);
764  if (arch_spec.IsCompatibleMatch(maccatalyst_spec))
765  arch_spec.MergeFrom(maccatalyst_spec);
766  }
767  if (os_env == llvm::Triple::Simulator &&
768  (os_type == llvm::Triple::IOS || os_type == llvm::Triple::TvOS ||
769  os_type == llvm::Triple::WatchOS)) {
770  llvm::Triple triple(llvm::Twine(arch_spec.GetArchitectureName()) +
771  "-apple-" + llvm::Triple::getOSTypeName(os_type) +
772  min_version_os_sdk + "-simulator");
773  ArchSpec sim_spec(triple);
774  if (arch_spec.IsCompatibleMatch(sim_spec))
775  arch_spec.MergeFrom(sim_spec);
776  }
777  return arch_spec;
778 }
779 
782  const size_t num_segments = segments.size();
783  for (size_t i = 0; i < num_segments; ++i) {
784  if (segments[i].name == name)
785  return &segments[i];
786  }
787  return nullptr;
788 }
789 
790 // Dump an image info structure to the file handle provided.
792  if (!log)
793  return;
794  if (address == LLDB_INVALID_ADDRESS) {
795  LLDB_LOG(log, "modtime={0:x+8} uuid={1} path='{2}' (UNLOADED)", mod_date,
796  uuid.GetAsString(), file_spec.GetPath());
797  } else {
798  LLDB_LOG(log, "address={0:x+16} modtime={1:x+8} uuid={2} path='{3}'",
799  address, mod_date, uuid.GetAsString(), file_spec.GetPath());
800  for (uint32_t i = 0; i < segments.size(); ++i)
801  segments[i].PutToLog(log, slide);
802  }
803 }
804 
806  DEBUG_PRINTF("DynamicLoaderDarwin::%s() process state = %s\n", __FUNCTION__,
808  Clear(true);
809  m_process = process;
811 }
812 
813 // Member function that gets called when the process state changes.
815  StateType state) {
816  DEBUG_PRINTF("DynamicLoaderDarwin::%s(%s)\n", __FUNCTION__,
817  StateAsCString(state));
818  switch (state) {
819  case eStateConnected:
820  case eStateAttaching:
821  case eStateLaunching:
822  case eStateInvalid:
823  case eStateUnloaded:
824  case eStateExited:
825  case eStateDetached:
826  Clear(false);
827  break;
828 
829  case eStateStopped:
830  // Keep trying find dyld and set our notification breakpoint each time we
831  // stop until we succeed
835 
837  }
838  break;
839 
840  case eStateRunning:
841  case eStateStepping:
842  case eStateCrashed:
843  case eStateSuspended:
844  break;
845  }
846 }
847 
848 ThreadPlanSP
850  bool stop_others) {
851  ThreadPlanSP thread_plan_sp;
852  StackFrame *current_frame = thread.GetStackFrameAtIndex(0).get();
853  const SymbolContext &current_context =
854  current_frame->GetSymbolContext(eSymbolContextSymbol);
855  Symbol *current_symbol = current_context.symbol;
856  Log *log = GetLog(LLDBLog::Step);
857  TargetSP target_sp(thread.CalculateTarget());
858 
859  if (current_symbol != nullptr) {
860  std::vector<Address> addresses;
861 
862  if (current_symbol->IsTrampoline()) {
863  ConstString trampoline_name =
864  current_symbol->GetMangled().GetName(Mangled::ePreferMangled);
865 
866  if (trampoline_name) {
867  const ModuleList &images = target_sp->GetImages();
868 
869  SymbolContextList code_symbols;
870  images.FindSymbolsWithNameAndType(trampoline_name, eSymbolTypeCode,
871  code_symbols);
872  size_t num_code_symbols = code_symbols.GetSize();
873 
874  if (num_code_symbols > 0) {
875  for (uint32_t i = 0; i < num_code_symbols; i++) {
876  SymbolContext context;
877  AddressRange addr_range;
878  if (code_symbols.GetContextAtIndex(i, context)) {
879  context.GetAddressRange(eSymbolContextEverything, 0, false,
880  addr_range);
881  addresses.push_back(addr_range.GetBaseAddress());
882  if (log) {
883  addr_t load_addr =
884  addr_range.GetBaseAddress().GetLoadAddress(target_sp.get());
885 
886  LLDB_LOGF(log,
887  "Found a trampoline target symbol at 0x%" PRIx64 ".",
888  load_addr);
889  }
890  }
891  }
892  }
893 
894  SymbolContextList reexported_symbols;
896  trampoline_name, eSymbolTypeReExported, reexported_symbols);
897  size_t num_reexported_symbols = reexported_symbols.GetSize();
898  if (num_reexported_symbols > 0) {
899  for (uint32_t i = 0; i < num_reexported_symbols; i++) {
900  SymbolContext context;
901  if (reexported_symbols.GetContextAtIndex(i, context)) {
902  if (context.symbol) {
903  Symbol *actual_symbol =
904  context.symbol->ResolveReExportedSymbol(*target_sp.get());
905  if (actual_symbol) {
906  const Address actual_symbol_addr =
907  actual_symbol->GetAddress();
908  if (actual_symbol_addr.IsValid()) {
909  addresses.push_back(actual_symbol_addr);
910  if (log) {
911  lldb::addr_t load_addr =
912  actual_symbol_addr.GetLoadAddress(target_sp.get());
913  LLDB_LOGF(
914  log,
915  "Found a re-exported symbol: %s at 0x%" PRIx64 ".",
916  actual_symbol->GetName().GetCString(), load_addr);
917  }
918  }
919  }
920  }
921  }
922  }
923  }
924 
925  SymbolContextList indirect_symbols;
926  images.FindSymbolsWithNameAndType(trampoline_name, eSymbolTypeResolver,
927  indirect_symbols);
928  size_t num_indirect_symbols = indirect_symbols.GetSize();
929  if (num_indirect_symbols > 0) {
930  for (uint32_t i = 0; i < num_indirect_symbols; i++) {
931  SymbolContext context;
932  AddressRange addr_range;
933  if (indirect_symbols.GetContextAtIndex(i, context)) {
934  context.GetAddressRange(eSymbolContextEverything, 0, false,
935  addr_range);
936  addresses.push_back(addr_range.GetBaseAddress());
937  if (log) {
938  addr_t load_addr =
939  addr_range.GetBaseAddress().GetLoadAddress(target_sp.get());
940 
941  LLDB_LOGF(log,
942  "Found an indirect target symbol at 0x%" PRIx64 ".",
943  load_addr);
944  }
945  }
946  }
947  }
948  }
949  } else if (current_symbol->GetType() == eSymbolTypeReExported) {
950  // I am not sure we could ever end up stopped AT a re-exported symbol.
951  // But just in case:
952 
953  const Symbol *actual_symbol =
954  current_symbol->ResolveReExportedSymbol(*(target_sp.get()));
955  if (actual_symbol) {
956  Address target_addr(actual_symbol->GetAddress());
957  if (target_addr.IsValid()) {
958  LLDB_LOGF(
959  log,
960  "Found a re-exported symbol: %s pointing to: %s at 0x%" PRIx64
961  ".",
962  current_symbol->GetName().GetCString(),
963  actual_symbol->GetName().GetCString(),
964  target_addr.GetLoadAddress(target_sp.get()));
965  addresses.push_back(target_addr.GetLoadAddress(target_sp.get()));
966  }
967  }
968  }
969 
970  if (addresses.size() > 0) {
971  // First check whether any of the addresses point to Indirect symbols,
972  // and if they do, resolve them:
973  std::vector<lldb::addr_t> load_addrs;
974  for (Address address : addresses) {
975  Symbol *symbol = address.CalculateSymbolContextSymbol();
976  if (symbol && symbol->IsIndirect()) {
977  Status error;
978  Address symbol_address = symbol->GetAddress();
979  addr_t resolved_addr = thread.GetProcess()->ResolveIndirectFunction(
980  &symbol_address, error);
981  if (error.Success()) {
982  load_addrs.push_back(resolved_addr);
983  LLDB_LOGF(log,
984  "ResolveIndirectFunction found resolved target for "
985  "%s at 0x%" PRIx64 ".",
986  symbol->GetName().GetCString(), resolved_addr);
987  }
988  } else {
989  load_addrs.push_back(address.GetLoadAddress(target_sp.get()));
990  }
991  }
992  thread_plan_sp = std::make_shared<ThreadPlanRunToAddress>(
993  thread, load_addrs, stop_others);
994  }
995  } else {
996  LLDB_LOGF(log, "Could not find symbol for step through.");
997  }
998 
999  return thread_plan_sp;
1000 }
1001 
1003  lldb_private::Symbol *original_symbol, lldb_private::ModuleList &images,
1004  lldb_private::SymbolContextList &equivalent_symbols) {
1005  ConstString trampoline_name =
1006  original_symbol->GetMangled().GetName(Mangled::ePreferMangled);
1007  if (!trampoline_name)
1008  return;
1009 
1010  static const char *resolver_name_regex = "(_gc|_non_gc|\\$[A-Za-z0-9\\$]+)$";
1011  std::string equivalent_regex_buf("^");
1012  equivalent_regex_buf.append(trampoline_name.GetCString());
1013  equivalent_regex_buf.append(resolver_name_regex);
1014 
1015  RegularExpression equivalent_name_regex(equivalent_regex_buf);
1016  images.FindSymbolsMatchingRegExAndType(equivalent_name_regex, eSymbolTypeCode,
1017  equivalent_symbols);
1018 
1019 }
1020 
1022  ModuleSP module_sp = m_libpthread_module_wp.lock();
1023  if (!module_sp) {
1024  SymbolContextList sc_list;
1025  ModuleSpec module_spec;
1026  module_spec.GetFileSpec().GetFilename().SetCString(
1027  "libsystem_pthread.dylib");
1028  ModuleList module_list;
1029  m_process->GetTarget().GetImages().FindModules(module_spec, module_list);
1030  if (!module_list.IsEmpty()) {
1031  if (module_list.GetSize() == 1) {
1032  module_sp = module_list.GetModuleAtIndex(0);
1033  if (module_sp)
1034  m_libpthread_module_wp = module_sp;
1035  }
1036  }
1037  }
1038  return module_sp;
1039 }
1040 
1043  ModuleSP module_sp = GetPThreadLibraryModule();
1044  if (module_sp) {
1046  module_sp->FindSymbolsWithNameAndType(ConstString("pthread_getspecific"),
1047  eSymbolTypeCode, sc_list);
1048  SymbolContext sc;
1049  if (sc_list.GetContextAtIndex(0, sc)) {
1050  if (sc.symbol)
1052  }
1053  }
1054  }
1056 }
1057 
1059 DynamicLoaderDarwin::GetThreadLocalData(const lldb::ModuleSP module_sp,
1060  const lldb::ThreadSP thread_sp,
1061  lldb::addr_t tls_file_addr) {
1062  if (!thread_sp || !module_sp)
1063  return LLDB_INVALID_ADDRESS;
1064 
1065  std::lock_guard<std::recursive_mutex> guard(m_mutex);
1066 
1067  const uint32_t addr_size = m_process->GetAddressByteSize();
1068  uint8_t buf[sizeof(lldb::addr_t) * 3];
1069 
1070  lldb_private::Address tls_addr;
1071  if (module_sp->ResolveFileAddress(tls_file_addr, tls_addr)) {
1072  Status error;
1073  const size_t tsl_data_size = addr_size * 3;
1074  Target &target = m_process->GetTarget();
1075  if (target.ReadMemory(tls_addr, buf, tsl_data_size, error, true) ==
1076  tsl_data_size) {
1077  const ByteOrder byte_order = m_process->GetByteOrder();
1078  DataExtractor data(buf, sizeof(buf), byte_order, addr_size);
1079  lldb::offset_t offset = addr_size; // Skip the first pointer
1080  const lldb::addr_t pthread_key = data.GetAddress(&offset);
1081  const lldb::addr_t tls_offset = data.GetAddress(&offset);
1082  if (pthread_key != 0) {
1083  // First check to see if we have already figured out the location of
1084  // TLS data for the pthread_key on a specific thread yet. If we have we
1085  // can re-use it since its location will not change unless the process
1086  // execs.
1087  const tid_t tid = thread_sp->GetID();
1088  auto tid_pos = m_tid_to_tls_map.find(tid);
1089  if (tid_pos != m_tid_to_tls_map.end()) {
1090  auto tls_pos = tid_pos->second.find(pthread_key);
1091  if (tls_pos != tid_pos->second.end()) {
1092  return tls_pos->second + tls_offset;
1093  }
1094  }
1095  StackFrameSP frame_sp = thread_sp->GetStackFrameAtIndex(0);
1096  if (frame_sp) {
1097  TypeSystemClang *clang_ast_context =
1099 
1100  if (!clang_ast_context)
1101  return LLDB_INVALID_ADDRESS;
1102 
1103  CompilerType clang_void_ptr_type =
1104  clang_ast_context->GetBasicType(eBasicTypeVoid).GetPointerType();
1105  Address pthread_getspecific_addr = GetPthreadSetSpecificAddress();
1106  if (pthread_getspecific_addr.IsValid()) {
1107  EvaluateExpressionOptions options;
1108 
1109  lldb::ThreadPlanSP thread_plan_sp(new ThreadPlanCallFunction(
1110  *thread_sp, pthread_getspecific_addr, clang_void_ptr_type,
1111  llvm::ArrayRef<lldb::addr_t>(pthread_key), options));
1112 
1113  DiagnosticManager execution_errors;
1114  ExecutionContext exe_ctx(thread_sp);
1116  exe_ctx, thread_plan_sp, options, execution_errors);
1117 
1118  if (results == lldb::eExpressionCompleted) {
1119  lldb::ValueObjectSP result_valobj_sp =
1120  thread_plan_sp->GetReturnValueObject();
1121  if (result_valobj_sp) {
1122  const lldb::addr_t pthread_key_data =
1123  result_valobj_sp->GetValueAsUnsigned(0);
1124  if (pthread_key_data) {
1125  m_tid_to_tls_map[tid].insert(
1126  std::make_pair(pthread_key, pthread_key_data));
1127  return pthread_key_data + tls_offset;
1128  }
1129  }
1130  }
1131  }
1132  }
1133  }
1134  }
1135  }
1136  return LLDB_INVALID_ADDRESS;
1137 }
1138 
1141  bool use_new_spi_interface = false;
1142 
1143  llvm::VersionTuple version = process->GetHostOSVersion();
1144  if (!version.empty()) {
1145  const llvm::Triple::OSType os_type =
1146  process->GetTarget().GetArchitecture().GetTriple().getOS();
1147 
1148  // macOS 10.12 and newer
1149  if (os_type == llvm::Triple::MacOSX &&
1150  version >= llvm::VersionTuple(10, 12))
1151  use_new_spi_interface = true;
1152 
1153  // iOS 10 and newer
1154  if (os_type == llvm::Triple::IOS && version >= llvm::VersionTuple(10))
1155  use_new_spi_interface = true;
1156 
1157  // tvOS 10 and newer
1158  if (os_type == llvm::Triple::TvOS && version >= llvm::VersionTuple(10))
1159  use_new_spi_interface = true;
1160 
1161  // watchOS 3 and newer
1162  if (os_type == llvm::Triple::WatchOS && version >= llvm::VersionTuple(3))
1163  use_new_spi_interface = true;
1164 
1165  // NEED_BRIDGEOS_TRIPLE // Any BridgeOS
1166  // NEED_BRIDGEOS_TRIPLE if (os_type == llvm::Triple::BridgeOS)
1167  // NEED_BRIDGEOS_TRIPLE use_new_spi_interface = true;
1168  }
1169 
1170  if (log) {
1171  if (use_new_spi_interface)
1172  LLDB_LOGF(
1173  log, "DynamicLoaderDarwin::UseDYLDSPI: Use new DynamicLoader plugin");
1174  else
1175  LLDB_LOGF(
1176  log, "DynamicLoaderDarwin::UseDYLDSPI: Use old DynamicLoader plugin");
1177  }
1178  return use_new_spi_interface;
1179 }
lldb_private::DynamicLoaderDarwin::FindEquivalentSymbols
void FindEquivalentSymbols(lldb_private::Symbol *original_symbol, lldb_private::ModuleList &module_list, lldb_private::SymbolContextList &equivalent_symbols) override
Some dynamic loaders provide features where there are a group of symbols "equivalent to" a given symb...
Definition: DynamicLoaderDarwin.cpp:1002
lldb_private::Address::SetLoadAddress
bool SetLoadAddress(lldb::addr_t load_addr, Target *target, bool allow_section_end=false)
Set the address to represent load_addr.
Definition: Address.cpp:1040
lldb_private::AddressRange::GetBaseAddress
Address & GetBaseAddress()
Get accessor for the base address of the range.
Definition: AddressRange.h:209
lldb_private::Module::GetObjectFile
virtual ObjectFile * GetObjectFile()
Get the object file representation for the current architecture.
Definition: Module.cpp:1260
lldb_private::ExecutionContext
Definition: ExecutionContext.h:292
UuidCompatibility.h
lldb_private::SectionList::FindSectionByName
lldb::SectionSP FindSectionByName(ConstString section_dstr) const
Definition: Section.cpp:546
lldb_private::StructuredData::Dictionary
Definition: StructuredData.h:352
lldb_private::ArchSpec
Definition: ArchSpec.h:33
lldb_private::RegularExpression
Definition: RegularExpression.h:18
lldb_private::ObjectFile::GetFileSpec
virtual FileSpec & GetFileSpec()
Get accessor to the object file specification.
Definition: ObjectFile.h:292
lldb_private::DataExtractor::GetAddress
uint64_t GetAddress(lldb::offset_t *offset_ptr) const
Extract an address from *offset_ptr.
Definition: DataExtractor.cpp:649
lldb_private::DynamicLoaderDarwin::GetPThreadLibraryModule
lldb::ModuleSP GetPThreadLibraryModule()
Definition: DynamicLoaderDarwin.cpp:1021
FileSystem.h
lldb_private::Address::IsValid
bool IsValid() const
Check if the object state is valid.
Definition: Address.h:345
lldb::eSymbolTypeCode
@ eSymbolTypeCode
Definition: lldb-enumerations.h:622
lldb_private::DynamicLoaderDarwin::Segment::nsects
uint32_t nsects
Definition: DynamicLoaderDarwin.h:87
lldb_private::ModuleList::Modules
ModuleIterable Modules() const
Definition: ModuleList.h:491
lldb_private::DynamicLoaderDarwin::ImageInfo::segments
std::vector< Segment > segments
All segment vmaddr and vmsize pairs for this executable (from memory of inferior).
Definition: DynamicLoaderDarwin.h:113
ModuleSpec.h
lldb_private::DynamicLoaderDarwin::GetDYLDModule
lldb::ModuleSP GetDYLDModule()
Definition: DynamicLoaderDarwin.cpp:609
lldb_private::Function::GetAddressRange
const AddressRange & GetAddressRange()
Definition: Function.h:457
lldb_private::ObjCLanguageRuntime
Definition: ObjCLanguageRuntime.h:35
lldb_private::StructuredData::Array
Definition: StructuredData.h:165
lldb_private::StructuredData::Dictionary::GetValueForKey
ObjectSP GetValueForKey(llvm::StringRef key) const
Definition: StructuredData.h:389
lldb_private::DynamicLoaderDarwin::m_dyld
ImageInfo m_dyld
Definition: DynamicLoaderDarwin.h:237
lldb_private::Symbol
Definition: Symbol.h:20
lldb_private::Target::GetOrCreateModule
lldb::ModuleSP GetOrCreateModule(const ModuleSpec &module_spec, bool notify, Status *error_ptr=nullptr)
Find a binary on the system and return its Module, or return an existing Module that is already in th...
Definition: Target.cpp:2065
lldb_private::SymbolContext::GetAddressRange
bool GetAddressRange(uint32_t scope, uint32_t range_idx, bool use_inline_block_range, AddressRange &range) const
Get the address range contained within a symbol context.
Definition: SymbolContext.cpp:380
lldb_private::DynamicLoaderDarwin::UpdateImageLoadAddress
bool UpdateImageLoadAddress(lldb_private::Module *module, ImageInfo &info)
Definition: DynamicLoaderDarwin.cpp:244
lldb::eStateAttaching
@ eStateAttaching
Process is currently trying to attach.
Definition: lldb-enumerations.h:78
lldb::ExpressionResults
ExpressionResults
The results of expression evaluation.
Definition: lldb-enumerations.h:270
lldb_private::DynamicLoaderDarwin::JSONImageInformationIntoImageInfo
bool JSONImageInformationIntoImageInfo(lldb_private::StructuredData::ObjectSP image_details, ImageInfo::collection &image_infos)
Definition: DynamicLoaderDarwin.cpp:356
lldb_private::DynamicLoaderDarwin::m_tid_to_tls_map
ThreadIDToTLSMap m_tid_to_tls_map
Definition: DynamicLoaderDarwin.h:232
lldb_private::DynamicLoaderDarwin::m_pthread_getspecific_addr
lldb_private::Address m_pthread_getspecific_addr
Definition: DynamicLoaderDarwin.h:231
lldb_private::DynamicLoaderDarwin::ImageInfo::collection
std::vector< ImageInfo > collection
Definition: DynamicLoaderDarwin.h:170
lldb_private::ObjCLanguageRuntime::Get
static ObjCLanguageRuntime * Get(Process &process)
Definition: ObjCLanguageRuntime.h:214
lldb_private::UUID::IsValid
bool IsValid() const
Definition: UUID.h:79
lldb_private::Process::ReadModuleFromMemory
lldb::ModuleSP ReadModuleFromMemory(const FileSpec &file_spec, lldb::addr_t header_addr, size_t size_to_read=512)
Definition: Process.cpp:2353
LLDB_LOGF
#define LLDB_LOGF(log,...)
Definition: Log.h:343
lldb_private::DynamicLoaderDarwin::UpdateSpecialBinariesFromNewImageInfos
void UpdateSpecialBinariesFromNewImageInfos(ImageInfo::collection &image_infos)
Definition: DynamicLoaderDarwin.cpp:532
DEBUG_PRINTF
#define DEBUG_PRINTF(fmt,...)
Definition: DynamicLoaderDarwin.cpp:43
lldb_private::Process
Definition: Process.h:338
lldb_private::Target::GetExecutableModulePointer
Module * GetExecutableModulePointer()
Definition: Target.cpp:1376
lldb_private::ArchSpec::MergeFrom
void MergeFrom(const ArchSpec &other)
Merges fields from another ArchSpec into this ArchSpec.
Definition: ArchSpec.cpp:802
lldb_private::Target::GetExecutableModule
lldb::ModuleSP GetExecutableModule()
Gets the module for the main executable.
Definition: Target.cpp:1362
lldb_private::ModuleList::GetMutex
std::recursive_mutex & GetMutex() const
Definition: ModuleList.h:208
lldb_private::Thread::CalculateTarget
lldb::TargetSP CalculateTarget() override
Definition: Thread.cpp:1383
lldb_private::ModuleSpec::GetObjectName
ConstString & GetObjectName()
Definition: ModuleSpec.h:103
Module.h
DynamicLoaderDarwin.h
lldb_private::Process::GetTarget
Target & GetTarget()
Get the target object pointer for this module.
Definition: Process.h:1206
lldb_private::EvaluateExpressionOptions
Definition: Target.h:281
lldb_private::StateAsCString
const char * StateAsCString(lldb::StateType state)
Converts a StateType to a C string.
Definition: State.cpp:14
StoppointCallbackContext.h
lldb_private::SymbolContextList
Definition: SymbolContext.h:379
lldb_private::ConstString::SetCString
void SetCString(const char *cstr)
Set the C string value.
Definition: ConstString.cpp:301
lldb_private::SymbolContextList::GetContextAtIndex
bool GetContextAtIndex(size_t idx, SymbolContext &sc) const
Get accessor for a symbol context at index idx.
Definition: SymbolContext.cpp:1260
lldb_private::Module
Definition: Module.h:85
lldb_private::ConstString::AsCString
const char * AsCString(const char *value_if_empty=nullptr) const
Get the string value as a C string.
Definition: ConstString.h:193
lldb_private::ModuleSpec::SetObjectOffset
void SetObjectOffset(uint64_t object_offset)
Definition: ModuleSpec.h:109
lldb_private::SectionList
Definition: Section.h:34
lldb::offset_t
uint64_t offset_t
Definition: lldb-types.h:87
StackFrame.h
lldb_private::Process::IsAlive
virtual bool IsAlive()
Check if a process is still alive.
Definition: Process.cpp:1084
lldb_private::Symbol::CalculateSymbolContextSymbol
Symbol * CalculateSymbolContextSymbol() override
Definition: Symbol.cpp:398
lldb_private::ArchSpec::GetTriple
llvm::Triple & GetTriple()
Architecture triple accessor.
Definition: ArchSpec.h:455
lldb::addr_t
uint64_t addr_t
Definition: lldb-types.h:83
lldb_private::DynamicLoaderDarwin::UnloadModuleSections
bool UnloadModuleSections(lldb_private::Module *module, ImageInfo &info)
Definition: DynamicLoaderDarwin.cpp:321
lldb_private::DynamicLoaderDarwin::ImageInfo
Definition: DynamicLoaderDarwin.h:97
lldb_private::DynamicLoaderDarwin::ImageInfo::FindSegment
const Segment * FindSegment(lldb_private::ConstString name) const
Definition: DynamicLoaderDarwin.cpp:781
Debugger.h
lldb_private::SymbolContext
Definition: SymbolContext.h:33
lldb_private::Target
Definition: Target.h:473
lldb_private::DynamicLoaderDarwin::ImageInfo::file_spec
lldb_private::FileSpec file_spec
Resolved path for this dylib.
Definition: DynamicLoaderDarwin.h:106
Section.h
lldb_private::DynamicLoaderDarwin::ClearDYLDModule
void ClearDYLDModule()
Definition: DynamicLoaderDarwin.cpp:614
ABI.h
lldb_private::Target::GetImages
const ModuleList & GetImages() const
Get accessor for the images for this process.
Definition: Target.h:947
lldb_private::Process::GetState
lldb::StateType GetState()
Get accessor for the current process state.
Definition: Process.cpp:1294
lldb_private::eArchTypeMachO
@ eArchTypeMachO
Definition: lldb-private-enumerations.h:63
lldb_private::DynamicLoaderDarwin::AlwaysRelyOnEHUnwindInfo
bool AlwaysRelyOnEHUnwindInfo(lldb_private::SymbolContext &sym_ctx) override
Ask if the eh_frame information for the given SymbolContext should be relied on even when it's the fi...
Definition: DynamicLoaderDarwin.cpp:723
lldb::eStateExited
@ eStateExited
Process has exited and can't be examined.
Definition: lldb-enumerations.h:90
lldb_private::DynamicLoaderDarwin::SetDYLDModule
void SetDYLDModule(lldb::ModuleSP &dyld_module_sp)
Definition: DynamicLoaderDarwin.cpp:605
lldb_private::ThreadPlanCallFunction
Definition: ThreadPlanCallFunction.h:20
lldb_private::Debugger::ReportWarning
static void ReportWarning(std::string messsage, llvm::Optional< lldb::user_id_t > debugger_id=llvm::None, std::once_flag *once=nullptr)
Report warning events.
Definition: Debugger.cpp:1394
lldb_private::ModuleList::FindSymbolsWithNameAndType
void FindSymbolsWithNameAndType(ConstString name, lldb::SymbolType symbol_type, SymbolContextList &sc_list) const
Definition: ModuleList.cpp:504
lldb_private::ArchSpec::IsCompatibleMatch
bool IsCompatibleMatch(const ArchSpec &rhs) const
Compare an ArchSpec to another ArchSpec, requiring a compatible cpu type match between them.
Definition: ArchSpec.cpp:935
lldb::eStateStopped
@ eStateStopped
Process or thread is stopped and can be examined.
Definition: lldb-enumerations.h:84
Target.h
lldb_private::ModuleSpec::GetUUID
UUID & GetUUID()
Definition: ModuleSpec.h:99
lldb_private::DynamicLoaderDarwin::PrivateProcessStateChanged
void PrivateProcessStateChanged(lldb_private::Process *process, lldb::StateType state)
Definition: DynamicLoaderDarwin.cpp:814
lldb_private::Thread::GetProcess
lldb::ProcessSP GetProcess() const
Definition: Thread.h:153
lldb_private::ModuleList::FindSymbolsMatchingRegExAndType
void FindSymbolsMatchingRegExAndType(const RegularExpression &regex, lldb::SymbolType symbol_type, SymbolContextList &sc_list) const
Definition: ModuleList.cpp:512
lldb_private::DynamicLoaderDarwin::UpdateDYLDImageInfoFromNewImageInfo
void UpdateDYLDImageInfoFromNewImageInfo(ImageInfo &image_info)
Definition: DynamicLoaderDarwin.cpp:590
error
static llvm::raw_ostream & error(Stream &strm)
Definition: CommandReturnObject.cpp:17
lldb_private::SymbolContext::symbol
Symbol * symbol
The Symbol for a given query.
Definition: SymbolContext.h:323
lldb_private::ObjectFile::GetSectionList
virtual SectionList * GetSectionList(bool update_module_section_list=true)
Gets the section list for the currently selected architecture (and object for archives).
Definition: ObjectFile.cpp:588
lldb_private::DynamicLoaderDarwin::DidLaunch
void DidLaunch() override
Called after attaching a process.
Definition: DynamicLoaderDarwin.cpp:80
lldb_private::ModuleList::GetSize
size_t GetSize() const
Gets the size of the module list.
Definition: ModuleList.cpp:630
lldb::eStateCrashed
@ eStateCrashed
Process or thread has crashed and can be examined.
Definition: lldb-enumerations.h:88
lldb_private::DynamicLoaderDarwin::AddModulesUsingImageInfos
bool AddModulesUsingImageInfos(ImageInfo::collection &image_infos)
Definition: DynamicLoaderDarwin.cpp:616
lldb_private::DynamicLoaderDarwin::ImageInfo::Clear
void Clear(bool load_cmd_data_only)
Definition: DynamicLoaderDarwin.h:127
lldb_private::DynamicLoaderDarwin::ImageInfo::address
lldb::addr_t address
Address of mach header for this dylib.
Definition: DynamicLoaderDarwin.h:99
lldb_private::ModuleList::Remove
bool Remove(const lldb::ModuleSP &module_sp, bool notify=true)
Remove a module from the module list.
lldb_private::DynamicLoaderDarwin::UseDYLDSPI
static bool UseDYLDSPI(lldb_private::Process *process)
Definition: DynamicLoaderDarwin.cpp:1139
lldb_private::DynamicLoaderDarwin::m_dyld_image_infos_stop_id
uint32_t m_dyld_image_infos_stop_id
Definition: DynamicLoaderDarwin.h:235
lldb_private::DynamicLoaderDarwin::ImageInfo::load_stop_id
uint32_t load_stop_id
The process stop ID that the sections for this image were loaded.
Definition: DynamicLoaderDarwin.h:116
lldb_private::DataExtractor
Definition: DataExtractor.h:48
lldb_private::ModuleList
Definition: ModuleList.h:81
Log.h
lldb_private::DynamicLoaderDarwin::m_mutex
std::recursive_mutex m_mutex
Definition: DynamicLoaderDarwin.h:238
TypeSystemClang.h
lldb_private::eLoadDependentsNo
@ eLoadDependentsNo
Definition: Target.h:65
lldb_private::DynamicLoaderDarwin::Segment::vmaddr
lldb::addr_t vmaddr
Definition: DynamicLoaderDarwin.h:81
lldb_private::Target::SetSectionLoadAddress
bool SetSectionLoadAddress(const lldb::SectionSP &section, lldb::addr_t load_addr, bool warn_multiple=false)
Definition: Target.cpp:2916
lldb_private::Thread
Definition: Thread.h:61
lldb_private::DynamicLoaderDarwin::Segment::flags
uint32_t flags
Definition: DynamicLoaderDarwin.h:88
lldb_private::DynamicLoaderDarwin::GetStepThroughTrampolinePlan
lldb::ThreadPlanSP GetStepThroughTrampolinePlan(lldb_private::Thread &thread, bool stop_others) override
Provides a plan to step through the dynamic loader trampoline for the current state of thread.
Definition: DynamicLoaderDarwin.cpp:849
lldb::eStateConnected
@ eStateConnected
Process is connected to remote debug services, but not launched or attached to anything yet.
Definition: lldb-enumerations.h:76
lldb_private::DynamicLoaderDarwin::ImageInfo::uuid
lldb_private::UUID uuid
UUID for this dylib if it has one, else all zeros.
Definition: DynamicLoaderDarwin.h:108
lldb_private::StructuredData::ObjectSP
std::shared_ptr< Object > ObjectSP
Definition: StructuredData.h:59
lldb::eExpressionCompleted
@ eExpressionCompleted
Definition: lldb-enumerations.h:271
lldb::eStateLaunching
@ eStateLaunching
Process is in the process of launching.
Definition: lldb-enumerations.h:79
lldb_private::SymbolContext::function
Function * function
The Function for a given query.
Definition: SymbolContext.h:320
lldb_private::Target::ClearAllLoadedSections
void ClearAllLoadedSections()
Definition: Target.cpp:2987
lldb_private::Symbol::GetAddressRef
Address & GetAddressRef()
Definition: Symbol.h:57
lldb_private::Process::GetAddressByteSize
uint32_t GetAddressByteSize() const
Definition: Process.cpp:3345
lldb_private::SymbolContextList::GetSize
uint32_t GetSize() const
Get accessor for a symbol context list size.
Definition: SymbolContext.cpp:1276
lldb_private::ConstString
Definition: ConstString.h:40
lldb_private::DynamicLoaderDarwin::ImageInfo::header
llvm::MachO::mach_header header
The mach header for this image.
Definition: DynamicLoaderDarwin.h:110
lldb_private::DynamicLoaderDarwin::Segment::vmsize
lldb::addr_t vmsize
Definition: DynamicLoaderDarwin.h:82
lldb_private::AddressRange
Definition: AddressRange.h:25
lldb_private::DynamicLoaderDarwin::GetPthreadSetSpecificAddress
lldb_private::Address GetPthreadSetSpecificAddress()
Definition: DynamicLoaderDarwin.cpp:1041
lldb_private::DynamicLoaderDarwin::m_dyld_module_wp
lldb::ModuleWP m_dyld_module_wp
Definition: DynamicLoaderDarwin.h:228
lldb_private::DynamicLoaderDarwin::ImageInfo::PutToLog
void PutToLog(lldb_private::Log *log) const
Definition: DynamicLoaderDarwin.cpp:791
lldb_private::ModuleList::FindFirstModule
lldb::ModuleSP FindFirstModule(const ModuleSpec &module_spec) const
Definition: ModuleList.cpp:618
lldb_private::DynamicLoaderDarwin::NeedToDoInitialImageFetch
virtual bool NeedToDoInitialImageFetch()=0
lldb_private::DynamicLoaderDarwin::Segment::filesize
lldb::addr_t filesize
Definition: DynamicLoaderDarwin.h:84
lldb_private::Range< lldb::addr_t, lldb::addr_t >
lldb_private::DynamicLoader
Definition: DynamicLoader.h:52
lldb_private::FileSystem::GetModificationTime
llvm::sys::TimePoint GetModificationTime(const FileSpec &file_spec) const
Returns the modification time of the given file.
Definition: common/FileSystem.cpp:96
lldb::eStateDetached
@ eStateDetached
Process has been detached and can't be examined.
Definition: lldb-enumerations.h:89
lldb_private::DynamicLoader::m_process
Process * m_process
The process that this dynamic loader plug-in is tracking.
Definition: DynamicLoader.h:317
lldb::eBasicTypeVoid
@ eBasicTypeVoid
Definition: lldb-enumerations.h:749
lldb_private::ObjCLanguageRuntime::IsModuleObjCLibrary
virtual bool IsModuleObjCLibrary(const lldb::ModuleSP &module_sp)=0
HostInfo.h
ThreadPlanRunToAddress.h
string
string(SUBSTRING ${p} 10 -1 pStripped) if($
Definition: Plugins/CMakeLists.txt:40
lldb_private::DynamicLoaderDarwin::Segment::name
lldb_private::ConstString name
Definition: DynamicLoaderDarwin.h:80
Thread.h
lldb_private::DynamicLoaderDarwin::Segment
Definition: DynamicLoaderDarwin.h:76
lldb::eStateUnloaded
@ eStateUnloaded
Process is object is valid, but not currently loaded.
Definition: lldb-enumerations.h:75
lldb_private::Symbol::GetMangled
Mangled & GetMangled()
Definition: Symbol.h:121
lldb_private::LLDBLog::Step
@ Step
ThreadPlanCallFunction.h
lldb_private::DynamicLoaderDarwin::PrivateInitialize
void PrivateInitialize(lldb_private::Process *process)
Definition: DynamicLoaderDarwin.cpp:805
ObjectFile.h
lldb_private::Target::SetExecutableModule
void SetExecutableModule(lldb::ModuleSP &module_sp, LoadDependentFiles load_dependent_files=eLoadDependentsDefault)
Set the main executable module.
Definition: Target.cpp:1411
lldb_private::Section
Definition: Section.h:102
lldb_private::DynamicLoaderDarwin::Clear
void Clear(bool clear_process)
Definition: DynamicLoaderDarwin.cpp:87
lldb_private::DynamicLoaderDarwin::Segment::initprot
uint32_t initprot
Definition: DynamicLoaderDarwin.h:86
lldb_private::Process::AddInvalidMemoryRegion
void AddInvalidMemoryRegion(const LoadRange &region)
Definition: Process.cpp:5545
lldb_private::Symbol::GetName
ConstString GetName() const
Definition: Symbol.cpp:501
lldb::eStateStepping
@ eStateStepping
Process or thread is in the process of stepping and can not be examined.
Definition: lldb-enumerations.h:86
lldb_private::DynamicLoaderDarwin::GetThreadLocalData
lldb::addr_t GetThreadLocalData(const lldb::ModuleSP module, const lldb::ThreadSP thread, lldb::addr_t tls_file_addr) override
Retrieves the per-module TLS block for a given thread.
Definition: DynamicLoaderDarwin.cpp:1059
lldb::eStateSuspended
@ eStateSuspended
Process or thread is in a suspended state as far as the debugger is concerned while other processes o...
Definition: lldb-enumerations.h:91
lldb_private::ModuleSpec::GetFileSpec
FileSpec & GetFileSpec()
Definition: ModuleSpec.h:53
lldb_private::ModuleSpec
Definition: ModuleSpec.h:27
lldb_private::Target::GetArchitecture
const ArchSpec & GetArchitecture() const
Definition: Target.h:989
lldb_private::Target::SetSectionUnloaded
bool SetSectionUnloaded(const lldb::SectionSP &section_sp)
Definition: Target.cpp:2965
lldb_private::SharedCacheImageInfo
Definition: HostInfoBase.h:28
lldb_private::Status
Definition: Status.h:44
lldb_private::DynamicLoaderDarwin::Segment::fileoff
lldb::addr_t fileoff
Definition: DynamicLoaderDarwin.h:83
lldb_private::CompilerType::GetPointerType
CompilerType GetPointerType() const
Return a new CompilerType that is a pointer to this type.
Definition: CompilerType.cpp:407
lldb_private::Process::GetHostOSVersion
virtual llvm::VersionTuple GetHostOSVersion()
Sometimes the connection to a process can detect the host OS version that the process is running on.
Definition: Process.h:1196
lldb_private::Target::ReadMemory
size_t ReadMemory(const Address &addr, void *dst, size_t dst_len, Status &error, bool force_live_memory=false, lldb::addr_t *load_addr_ptr=nullptr)
Definition: Target.cpp:1735
lldb_private::ArchSpec::GetArchitectureName
const char * GetArchitectureName() const
Returns a static string representing the current architecture.
Definition: ArchSpec.cpp:539
lldb_private::DynamicLoaderDarwin::FindTargetModuleForImageInfo
lldb::ModuleSP FindTargetModuleForImageInfo(ImageInfo &image_info, bool can_create, bool *did_create_ptr)
Definition: DynamicLoaderDarwin.cpp:96
uint32_t
lldb_private::LLDBLog::DynamicLoader
@ DynamicLoader
lldb_private::Address
Definition: Address.h:59
lldb_private::Target::ModulesDidLoad
void ModulesDidLoad(ModuleList &module_list)
Definition: Target.cpp:1628
lldb_private::DynamicLoaderDarwin::UnloadAllImages
void UnloadAllImages()
Definition: DynamicLoaderDarwin.cpp:212
lldb_private::ObjectFile::GetFileOffset
virtual lldb::addr_t GetFileOffset() const
Returns the offset into a file at which this object resides.
Definition: ObjectFile.h:283
lldb_private::StructuredData::Object::GetAsDictionary
Dictionary * GetAsDictionary()
Definition: StructuredData.h:91
lldb_private::ModuleList::AppendIfNeeded
bool AppendIfNeeded(const lldb::ModuleSP &new_module, bool notify=true)
Append a module to the module list, if it is not already there.
lldb_private::DynamicLoaderDarwin::UnloadImages
void UnloadImages(const std::vector< lldb::addr_t > &solib_addresses)
Definition: DynamicLoaderDarwin.cpp:164
lldb_private::SharedCacheImageInfo::uuid
UUID uuid
Definition: HostInfoBase.h:29
lldb_private::Address::GetLoadAddress
lldb::addr_t GetLoadAddress(Target *target) const
Get the load address.
Definition: Address.cpp:311
lldb_private::DiagnosticManager
Definition: DiagnosticManager.h:93
lldb_private::SharedCacheImageInfo::data_sp
lldb::DataBufferSP data_sp
Definition: HostInfoBase.h:30
UINT32_MAX
#define UINT32_MAX
Definition: lldb-defines.h:19
lldb_private::StructuredData::Dictionary::HasKey
bool HasKey(llvm::StringRef key) const
Definition: StructuredData.h:498
ObjCLanguageRuntime.h
lldb_private::ScratchTypeSystemClang::GetForTarget
static TypeSystemClang * GetForTarget(Target &target, llvm::Optional< IsolatedASTKind > ast_kind=DefaultAST, bool create_on_demand=true)
Returns the scratch TypeSystemClang for the given target.
Definition: TypeSystemClang.cpp:9797
PluginManager.h
lldb_private::DynamicLoaderDarwin::m_dyld_image_infos
ImageInfo::collection m_dyld_image_infos
Definition: DynamicLoaderDarwin.h:234
LLDB_INVALID_ADDRESS
#define LLDB_INVALID_ADDRESS
Definition: lldb-defines.h:74
lldb_private::ConstString::GetCString
const char * GetCString() const
Get the string value as a C string.
Definition: ConstString.h:216
lldb_private::ModuleSpec::GetArchitecture
ArchSpec & GetArchitecture()
Definition: ModuleSpec.h:89
LLDB_LOG
#define LLDB_LOG(log,...)
The LLDB_LOG* macros defined below are the way to emit log messages.
Definition: Log.h:336
lldb_private::ModuleList::LogUUIDAndPaths
void LogUUIDAndPaths(Log *log, const char *prefix_cstr)
Definition: ModuleList.cpp:645
lldb_private::CompilerType
Generic representation of a type in a programming language.
Definition: CompilerType.h:33
Function.h
lldb_private::FileSystem::Instance
static FileSystem & Instance()
Definition: common/FileSystem.cpp:46
DiagnosticManager.h
lldb_private::ModuleSpec::SetObjectSize
void SetObjectSize(uint64_t object_size)
Definition: ModuleSpec.h:115
lldb::eSymbolTypeReExported
@ eSymbolTypeReExported
Definition: lldb-enumerations.h:649
lldb_private::DynamicLoaderDarwin::SetNotificationBreakpoint
virtual bool SetNotificationBreakpoint()=0
lldb_private::DynamicLoaderDarwin::ImageInfo::slide
lldb::addr_t slide
The amount to slide all segments by if there is a global slide.
Definition: DynamicLoaderDarwin.h:102
lldb_private::DynamicLoader::UnloadSections
virtual void UnloadSections(const lldb::ModuleSP module)
Removes the loaded sections from the target in module.
Definition: DynamicLoader.cpp:119
lldb_private
A class that represents a running process on the host machine.
Definition: SBCommandInterpreterRunOptions.h:16
lldb_private::ObjectFile::GetByteSize
virtual lldb::addr_t GetByteSize() const
Definition: ObjectFile.h:285
lldb_private::DynamicLoaderDarwin::DidSetNotificationBreakpoint
virtual bool DidSetNotificationBreakpoint()=0
lldb_private::Section::GetFileOffset
lldb::offset_t GetFileOffset() const
Definition: Section.h:146
lldb_private::ModuleList::GetModuleAtIndex
lldb::ModuleSP GetModuleAtIndex(size_t idx) const
Get the module shared pointer for the module at index idx.
Definition: ModuleList.cpp:405
lldb_private::TypeSystemClang::GetBasicType
CompilerType GetBasicType(lldb::BasicType type)
Definition: TypeSystemClang.cpp:930
lldb_private::DynamicLoaderDarwin::DidAttach
void DidAttach() override
Called after attaching a process.
Definition: DynamicLoaderDarwin.cpp:70
lldb_private::Symbol::IsTrampoline
bool IsTrampoline() const
Definition: Symbol.cpp:174
lldb_private::ModuleList::FindModules
void FindModules(const ModuleSpec &module_spec, ModuleList &matching_module_list) const
Finds the first module whose file specification matches file_spec.
Definition: ModuleList.cpp:520
lldb::eStateInvalid
@ eStateInvalid
Definition: lldb-enumerations.h:74
lldb_private::TypeSystemClang
A TypeSystem implementation based on Clang.
Definition: TypeSystemClang.h:105
lldb_private::DynamicLoaderDarwin::~DynamicLoaderDarwin
~DynamicLoaderDarwin() override
lldb_private::Address::GetOffset
lldb::addr_t GetOffset() const
Get the section relative offset value.
Definition: Address.h:319
State.h
lldb_private::Address::GetModule
lldb::ModuleSP GetModule() const
Get accessor for the module for this address.
Definition: Address.cpp:283
lldb::StateType
StateType
Process and Thread States.
Definition: lldb-enumerations.h:73
lldb_private::DynamicLoaderDarwin::ImageInfo::GetArchitecture
lldb_private::ArchSpec GetArchitecture() const
Definition: DynamicLoaderDarwin.cpp:756
lldb_private::Process::GetByteOrder
lldb::ByteOrder GetByteOrder() const
Definition: Process.cpp:3341
lldb_private::Log
Definition: Log.h:115
lldb::eSymbolTypeResolver
@ eSymbolTypeResolver
Definition: lldb-enumerations.h:623
lldb_private::StructuredData::Array::GetItemAtIndex
ObjectSP GetItemAtIndex(size_t idx) const
Definition: StructuredData.h:188
lldb_private::Symbol::IsIndirect
bool IsIndirect() const
Definition: Symbol.cpp:176
lldb_private::Thread::GetStackFrameAtIndex
virtual lldb::StackFrameSP GetStackFrameAtIndex(uint32_t idx)
Definition: Thread.h:398
lldb_private::StructuredData::Array::GetSize
size_t GetSize() const
Definition: StructuredData.h:180
lldb_private::DynamicLoaderDarwin::m_libpthread_module_wp
lldb::ModuleWP m_libpthread_module_wp
Definition: DynamicLoaderDarwin.h:230
lldb_private::Process::RunThreadPlan
lldb::ExpressionResults RunThreadPlan(ExecutionContext &exe_ctx, lldb::ThreadPlanSP &thread_plan_sp, const EvaluateExpressionOptions &options, DiagnosticManager &diagnostic_manager)
Definition: Process.cpp:4654
lldb_private::GetLog
Log * GetLog(Cat mask)
Retrieve the Log object for the channel associated with the given log enum.
Definition: Log.h:308
lldb_private::FileSpec::GetPath
size_t GetPath(char *path, size_t max_path_length, bool denormalize=true) const
Extract the full path to the file.
Definition: FileSpec.cpp:347
lldb_private::Process::GetStopID
uint32_t GetStopID() const
Definition: Process.h:1365
DataBuffer.h
lldb_private::StackFrame
Definition: StackFrame.h:40
lldb_private::Symbol::GetType
lldb::SymbolType GetType() const
Definition: Symbol.h:143
lldb
Definition: SBAddress.h:15
lldb_private::DynamicLoaderDarwin::DoInitialImageFetch
virtual void DoInitialImageFetch()=0
lldb_private::DynamicLoaderDarwin::Segment::PutToLog
void PutToLog(lldb_private::Log *log, lldb::addr_t slide) const
Definition: DynamicLoaderDarwin.cpp:741
lldb_private::ModuleList::IsEmpty
bool IsEmpty() const
Definition: ModuleList.h:439
lldb::eStateRunning
@ eStateRunning
Process or thread is running and can't be examined.
Definition: lldb-enumerations.h:85
RegisterContext.h
lldb_private::FileSpec::GetFilename
ConstString & GetFilename()
Filename string get accessor.
Definition: FileSpec.cpp:340
lldb_private::StackFrame::GetSymbolContext
const SymbolContext & GetSymbolContext(lldb::SymbolContextItem resolve_scope)
Provide a SymbolContext for this StackFrame's current pc value.
Definition: StackFrame.cpp:299
LLDBLog.h
lldb_private::Symbol::ResolveReExportedSymbol
Symbol * ResolveReExportedSymbol(Target &target) const
Definition: Symbol.cpp:473
lldb_private::ObjectFile
Definition: ObjectFile.h:60
lldb_private::ModuleList::Append
void Append(const lldb::ModuleSP &module_sp, bool notify=true)
Append a module to the module list.
DataBufferHeap.h
lldb::tid_t
uint64_t tid_t
Definition: lldb-types.h:86
lldb::ByteOrder
ByteOrder
Byte ordering definitions.
Definition: lldb-enumerations.h:138
lldb_private::DynamicLoaderDarwin::Segment::maxprot
uint32_t maxprot
Definition: DynamicLoaderDarwin.h:85
lldb_private::Log::PutCString
void PutCString(const char *cstr)
Definition: Log.cpp:133
lldb_private::Symbol::GetAddress
Address GetAddress() const
Definition: Symbol.h:73