LLDB  mainline
DynamicLoaderPOSIXDYLD.cpp
Go to the documentation of this file.
1 //===-- DynamicLoaderPOSIXDYLD.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 // Main header include
10 #include "DynamicLoaderPOSIXDYLD.h"
11 
13 #include "lldb/Core/Module.h"
14 #include "lldb/Core/ModuleSpec.h"
16 #include "lldb/Core/Section.h"
17 #include "lldb/Symbol/Function.h"
18 #include "lldb/Symbol/ObjectFile.h"
20 #include "lldb/Target/Platform.h"
21 #include "lldb/Target/Target.h"
22 #include "lldb/Target/Thread.h"
24 #include "lldb/Utility/Log.h"
26 
27 #include <memory>
28 
29 using namespace lldb;
30 using namespace lldb_private;
31 
32 LLDB_PLUGIN_DEFINE_ADV(DynamicLoaderPOSIXDYLD, DynamicLoaderPosixDYLD)
33 
34 void DynamicLoaderPOSIXDYLD::Initialize() {
35  PluginManager::RegisterPlugin(GetPluginNameStatic(),
36  GetPluginDescriptionStatic(), CreateInstance);
37 }
38 
40 
42  return "Dynamic loader plug-in that watches for shared library "
43  "loads/unloads in POSIX processes.";
44 }
45 
47  bool force) {
48  bool create = force;
49  if (!create) {
50  const llvm::Triple &triple_ref =
51  process->GetTarget().GetArchitecture().GetTriple();
52  if (triple_ref.getOS() == llvm::Triple::FreeBSD ||
53  triple_ref.getOS() == llvm::Triple::Linux ||
54  triple_ref.getOS() == llvm::Triple::NetBSD)
55  create = true;
56  }
57 
58  if (create)
59  return new DynamicLoaderPOSIXDYLD(process);
60  return nullptr;
61 }
62 
64  : DynamicLoader(process), m_rendezvous(process),
65  m_load_offset(LLDB_INVALID_ADDRESS), m_entry_point(LLDB_INVALID_ADDRESS),
66  m_auxv(), m_dyld_bid(LLDB_INVALID_BREAK_ID),
67  m_vdso_base(LLDB_INVALID_ADDRESS),
68  m_interpreter_base(LLDB_INVALID_ADDRESS), m_initial_modules_added(false) {
69 }
70 
75  }
76 }
77 
80  LLDB_LOGF(log, "DynamicLoaderPOSIXDYLD::%s() pid %" PRIu64, __FUNCTION__,
82  m_auxv = std::make_unique<AuxVector>(m_process->GetAuxvData());
83 
84  LLDB_LOGF(
85  log, "DynamicLoaderPOSIXDYLD::%s pid %" PRIu64 " reloaded auxv data",
86  __FUNCTION__, m_process ? m_process->GetID() : LLDB_INVALID_PROCESS_ID);
87 
88  // ask the process if it can load any of its own modules
89  auto error = m_process->LoadModules();
90  LLDB_LOG_ERROR(log, std::move(error), "Couldn't load modules: {0}");
91 
92  ModuleSP executable_sp = GetTargetExecutable();
93  ResolveExecutableModule(executable_sp);
95 
96  // find the main process load offset
97  addr_t load_offset = ComputeLoadOffset();
98  LLDB_LOGF(log,
99  "DynamicLoaderPOSIXDYLD::%s pid %" PRIu64
100  " executable '%s', load_offset 0x%" PRIx64,
101  __FUNCTION__,
103  executable_sp ? executable_sp->GetFileSpec().GetPath().c_str()
104  : "<null executable>",
105  load_offset);
106 
108 
109  // if we dont have a load address we cant re-base
110  bool rebase_exec = load_offset != LLDB_INVALID_ADDRESS;
111 
112  // if we have a valid executable
113  if (executable_sp.get()) {
114  lldb_private::ObjectFile *obj = executable_sp->GetObjectFile();
115  if (obj) {
116  // don't rebase if the module already has a load address
117  Target &target = m_process->GetTarget();
118  Address addr = obj->GetImageInfoAddress(&target);
119  if (addr.GetLoadAddress(&target) != LLDB_INVALID_ADDRESS)
120  rebase_exec = false;
121  }
122  } else {
123  // no executable, nothing to re-base
124  rebase_exec = false;
125  }
126 
127  // if the target executable should be re-based
128  if (rebase_exec) {
129  ModuleList module_list;
130 
131  module_list.Append(executable_sp);
132  LLDB_LOGF(log,
133  "DynamicLoaderPOSIXDYLD::%s pid %" PRIu64
134  " added executable '%s' to module load list",
135  __FUNCTION__,
137  executable_sp->GetFileSpec().GetPath().c_str());
138 
139  UpdateLoadedSections(executable_sp, LLDB_INVALID_ADDRESS, load_offset,
140  true);
141 
143 
144  m_process->GetTarget().ModulesDidLoad(module_list);
145  if (log) {
146  LLDB_LOGF(log,
147  "DynamicLoaderPOSIXDYLD::%s told the target about the "
148  "modules that loaded:",
149  __FUNCTION__);
150  for (auto module_sp : module_list.Modules()) {
151  LLDB_LOGF(log, "-- [module] %s (pid %" PRIu64 ")",
152  module_sp ? module_sp->GetFileSpec().GetPath().c_str()
153  : "<null>",
155  }
156  }
157  }
158 
159  if (executable_sp.get()) {
160  if (!SetRendezvousBreakpoint()) {
161  // If we cannot establish rendezvous breakpoint right now we'll try again
162  // at entry point.
163  ProbeEntry();
164  }
165  }
166 }
167 
170  LLDB_LOGF(log, "DynamicLoaderPOSIXDYLD::%s()", __FUNCTION__);
171 
172  ModuleSP executable;
173  addr_t load_offset;
174 
175  m_auxv = std::make_unique<AuxVector>(m_process->GetAuxvData());
176 
177  executable = GetTargetExecutable();
178  load_offset = ComputeLoadOffset();
180 
181  if (executable.get() && load_offset != LLDB_INVALID_ADDRESS) {
182  ModuleList module_list;
183  module_list.Append(executable);
184  UpdateLoadedSections(executable, LLDB_INVALID_ADDRESS, load_offset, true);
185 
186  LLDB_LOGF(log, "DynamicLoaderPOSIXDYLD::%s about to call ProbeEntry()",
187  __FUNCTION__);
188 
189  if (!SetRendezvousBreakpoint()) {
190  // If we cannot establish rendezvous breakpoint right now we'll try again
191  // at entry point.
192  ProbeEntry();
193  }
194 
195  LoadVDSO();
196  m_process->GetTarget().ModulesDidLoad(module_list);
197  }
198 }
199 
201 
203  addr_t link_map_addr,
204  addr_t base_addr,
205  bool base_addr_is_offset) {
206  m_loaded_modules[module] = link_map_addr;
207  UpdateLoadedSectionsCommon(module, base_addr, base_addr_is_offset);
208 }
209 
210 void DynamicLoaderPOSIXDYLD::UnloadSections(const ModuleSP module) {
211  m_loaded_modules.erase(module);
212 
213  UnloadSectionsCommon(module);
214 }
215 
218 
219  const addr_t entry = GetEntryPoint();
220  if (entry == LLDB_INVALID_ADDRESS) {
221  LLDB_LOGF(
222  log,
223  "DynamicLoaderPOSIXDYLD::%s pid %" PRIu64
224  " GetEntryPoint() returned no address, not setting entry breakpoint",
225  __FUNCTION__, m_process ? m_process->GetID() : LLDB_INVALID_PROCESS_ID);
226  return;
227  }
228 
229  LLDB_LOGF(log,
230  "DynamicLoaderPOSIXDYLD::%s pid %" PRIu64
231  " GetEntryPoint() returned address 0x%" PRIx64
232  ", setting entry breakpoint",
233  __FUNCTION__,
235 
236  if (m_process) {
237  Breakpoint *const entry_break =
238  m_process->GetTarget().CreateBreakpoint(entry, true, false).get();
239  entry_break->SetCallback(EntryBreakpointHit, this, true);
240  entry_break->SetBreakpointKind("shared-library-event");
241 
242  // Shoudn't hit this more than once.
243  entry_break->SetOneShot(true);
244  }
245 }
246 
247 // The runtime linker has run and initialized the rendezvous structure once the
248 // process has hit its entry point. When we hit the corresponding breakpoint
249 // we interrogate the rendezvous structure to get the load addresses of all
250 // dependent modules for the process. Similarly, we can discover the runtime
251 // linker function and setup a breakpoint to notify us of any dynamically
252 // loaded modules (via dlopen).
254  void *baton, StoppointCallbackContext *context, user_id_t break_id,
255  user_id_t break_loc_id) {
256  assert(baton && "null baton");
257  if (!baton)
258  return false;
259 
261  DynamicLoaderPOSIXDYLD *const dyld_instance =
262  static_cast<DynamicLoaderPOSIXDYLD *>(baton);
263  LLDB_LOGF(log, "DynamicLoaderPOSIXDYLD::%s called for pid %" PRIu64,
264  __FUNCTION__,
265  dyld_instance->m_process ? dyld_instance->m_process->GetID()
267 
268  // Disable the breakpoint --- if a stop happens right after this, which we've
269  // seen on occasion, we don't want the breakpoint stepping thread-plan logic
270  // to show a breakpoint instruction at the disassembled entry point to the
271  // program. Disabling it prevents it. (One-shot is not enough - one-shot
272  // removal logic only happens after the breakpoint goes public, which wasn't
273  // happening in our scenario).
274  if (dyld_instance->m_process) {
275  BreakpointSP breakpoint_sp =
276  dyld_instance->m_process->GetTarget().GetBreakpointByID(break_id);
277  if (breakpoint_sp) {
278  LLDB_LOGF(log,
279  "DynamicLoaderPOSIXDYLD::%s pid %" PRIu64
280  " disabling breakpoint id %" PRIu64,
281  __FUNCTION__, dyld_instance->m_process->GetID(), break_id);
282  breakpoint_sp->SetEnabled(false);
283  } else {
284  LLDB_LOGF(log,
285  "DynamicLoaderPOSIXDYLD::%s pid %" PRIu64
286  " failed to find breakpoint for breakpoint id %" PRIu64,
287  __FUNCTION__, dyld_instance->m_process->GetID(), break_id);
288  }
289  } else {
290  LLDB_LOGF(log,
291  "DynamicLoaderPOSIXDYLD::%s breakpoint id %" PRIu64
292  " no Process instance! Cannot disable breakpoint",
293  __FUNCTION__, break_id);
294  }
295 
296  dyld_instance->LoadAllCurrentModules();
297  dyld_instance->SetRendezvousBreakpoint();
298  return false; // Continue running.
299 }
300 
304  LLDB_LOG(log,
305  "Rendezvous breakpoint breakpoint id {0} for pid {1}"
306  "is already set.",
307  m_dyld_bid,
309  return true;
310  }
311 
312  addr_t break_addr;
313  Target &target = m_process->GetTarget();
314  BreakpointSP dyld_break;
315  if (m_rendezvous.IsValid()) {
316  break_addr = m_rendezvous.GetBreakAddress();
317  LLDB_LOG(log, "Setting rendezvous break address for pid {0} at {1:x}",
319  break_addr);
320  dyld_break = target.CreateBreakpoint(break_addr, true, false);
321  } else {
322  LLDB_LOG(log, "Rendezvous structure is not set up yet. "
323  "Trying to locate rendezvous breakpoint in the interpreter "
324  "by symbol name.");
325  // Function names from different dynamic loaders that are known to be
326  // used as rendezvous between the loader and debuggers.
327  static std::vector<std::string> DebugStateCandidates{
328  "_dl_debug_state", "rtld_db_dlactivity", "__dl_rtld_db_dlactivity",
329  "r_debug_state", "_r_debug_state", "_rtld_debug_state",
330  };
331 
332  ModuleSP interpreter = LoadInterpreterModule();
333  if (!interpreter) {
334  FileSpecList containingModules;
335  containingModules.Append(
337 
338  dyld_break = target.CreateBreakpoint(
339  &containingModules, /*containingSourceFiles=*/nullptr,
340  DebugStateCandidates, eFunctionNameTypeFull, eLanguageTypeC,
341  /*offset=*/0,
342  /*skip_prologue=*/eLazyBoolNo,
343  /*internal=*/true,
344  /*request_hardware=*/false);
345  } else {
346  FileSpecList containingModules;
347  containingModules.Append(interpreter->GetFileSpec());
348  dyld_break = target.CreateBreakpoint(
349  &containingModules, /*containingSourceFiles=*/nullptr,
350  DebugStateCandidates, eFunctionNameTypeFull, eLanguageTypeC,
351  /*offset=*/0,
352  /*skip_prologue=*/eLazyBoolNo,
353  /*internal=*/true,
354  /*request_hardware=*/false);
355  }
356  }
357 
358  if (dyld_break->GetNumResolvedLocations() != 1) {
359  LLDB_LOG(
360  log,
361  "Rendezvous breakpoint has abnormal number of"
362  " resolved locations ({0}) in pid {1}. It's supposed to be exactly 1.",
363  dyld_break->GetNumResolvedLocations(),
365 
366  target.RemoveBreakpointByID(dyld_break->GetID());
367  return false;
368  }
369 
370  BreakpointLocationSP location = dyld_break->GetLocationAtIndex(0);
371  LLDB_LOG(log,
372  "Successfully set rendezvous breakpoint at address {0:x} "
373  "for pid {1}",
374  location->GetLoadAddress(),
376 
377  dyld_break->SetCallback(RendezvousBreakpointHit, this, true);
378  dyld_break->SetBreakpointKind("shared-library-event");
379  m_dyld_bid = dyld_break->GetID();
380  return true;
381 }
382 
384  void *baton, StoppointCallbackContext *context, user_id_t break_id,
385  user_id_t break_loc_id) {
386  assert(baton && "null baton");
387  if (!baton)
388  return false;
389 
391  DynamicLoaderPOSIXDYLD *const dyld_instance =
392  static_cast<DynamicLoaderPOSIXDYLD *>(baton);
393  LLDB_LOGF(log, "DynamicLoaderPOSIXDYLD::%s called for pid %" PRIu64,
394  __FUNCTION__,
395  dyld_instance->m_process ? dyld_instance->m_process->GetID()
397 
398  dyld_instance->RefreshModules();
399 
400  // Return true to stop the target, false to just let the target run.
401  const bool stop_when_images_change = dyld_instance->GetStopWhenImagesChange();
402  LLDB_LOGF(log,
403  "DynamicLoaderPOSIXDYLD::%s pid %" PRIu64
404  " stop_when_images_change=%s",
405  __FUNCTION__,
406  dyld_instance->m_process ? dyld_instance->m_process->GetID()
408  stop_when_images_change ? "true" : "false");
409  return stop_when_images_change;
410 }
411 
413  if (!m_rendezvous.Resolve())
414  return;
415 
418 
419  ModuleList &loaded_modules = m_process->GetTarget().GetImages();
420 
422  ModuleList new_modules;
423 
424  // If this is the first time rendezvous breakpoint fires, we need
425  // to take care of adding all the initial modules reported by
426  // the loader. This is necessary to list ld-linux.so on Linux,
427  // and all DT_NEEDED entries on *BSD.
430  E = m_rendezvous.loaded_end();
431  } else {
432  I = m_rendezvous.begin();
433  E = m_rendezvous.end();
435  }
436  for (; I != E; ++I) {
437  ModuleSP module_sp =
438  LoadModuleAtAddress(I->file_spec, I->link_addr, I->base_addr, true);
439  if (module_sp.get()) {
440  if (module_sp->GetObjectFile()->GetBaseAddress().GetLoadAddress(
442  module_sp != m_interpreter_module.lock()) {
443  if (m_interpreter_module.lock() == nullptr) {
444  m_interpreter_module = module_sp;
445  } else {
446  // If this is a duplicate instance of ld.so, unload it. We may end
447  // up with it if we load it via a different path than before
448  // (symlink vs real path).
449  // TODO: remove this once we either fix library matching or avoid
450  // loading the interpreter when setting the rendezvous breakpoint.
451  UnloadSections(module_sp);
452  loaded_modules.Remove(module_sp);
453  continue;
454  }
455  }
456 
457  loaded_modules.AppendIfNeeded(module_sp);
458  new_modules.Append(module_sp);
459  }
460  }
461  m_process->GetTarget().ModulesDidLoad(new_modules);
462  }
463 
465  ModuleList old_modules;
466 
468  for (I = m_rendezvous.unloaded_begin(); I != E; ++I) {
469  ModuleSpec module_spec{I->file_spec};
470  ModuleSP module_sp = loaded_modules.FindFirstModule(module_spec);
471 
472  if (module_sp.get()) {
473  old_modules.Append(module_sp);
474  UnloadSections(module_sp);
475  }
476  }
477  loaded_modules.Remove(old_modules);
478  m_process->GetTarget().ModulesDidUnload(old_modules, false);
479  }
480 }
481 
482 ThreadPlanSP
484  bool stop) {
485  ThreadPlanSP thread_plan_sp;
486 
487  StackFrame *frame = thread.GetStackFrameAtIndex(0).get();
488  const SymbolContext &context = frame->GetSymbolContext(eSymbolContextSymbol);
489  Symbol *sym = context.symbol;
490 
491  if (sym == nullptr || !sym->IsTrampoline())
492  return thread_plan_sp;
493 
494  ConstString sym_name = sym->GetName();
495  if (!sym_name)
496  return thread_plan_sp;
497 
498  SymbolContextList target_symbols;
499  Target &target = thread.GetProcess()->GetTarget();
500  const ModuleList &images = target.GetImages();
501 
502  images.FindSymbolsWithNameAndType(sym_name, eSymbolTypeCode, target_symbols);
503  size_t num_targets = target_symbols.GetSize();
504  if (!num_targets)
505  return thread_plan_sp;
506 
507  typedef std::vector<lldb::addr_t> AddressVector;
508  AddressVector addrs;
509  for (size_t i = 0; i < num_targets; ++i) {
510  SymbolContext context;
511  AddressRange range;
512  if (target_symbols.GetContextAtIndex(i, context)) {
513  context.GetAddressRange(eSymbolContextEverything, 0, false, range);
514  lldb::addr_t addr = range.GetBaseAddress().GetLoadAddress(&target);
515  if (addr != LLDB_INVALID_ADDRESS)
516  addrs.push_back(addr);
517  }
518  }
519 
520  if (addrs.size() > 0) {
521  AddressVector::iterator start = addrs.begin();
522  AddressVector::iterator end = addrs.end();
523 
524  llvm::sort(start, end);
525  addrs.erase(std::unique(start, end), end);
526  thread_plan_sp =
527  std::make_shared<ThreadPlanRunToAddress>(thread, addrs, stop);
528  }
529 
530  return thread_plan_sp;
531 }
532 
535  return;
536 
537  FileSpec file("[vdso]");
538 
539  MemoryRegionInfo info;
541  if (status.Fail()) {
543  LLDB_LOG(log, "Failed to get vdso region info: {0}", status);
544  return;
545  }
546 
547  if (ModuleSP module_sp = m_process->ReadModuleFromMemory(
548  file, m_vdso_base, info.GetRange().GetByteSize())) {
551  }
552 }
553 
556  return nullptr;
557 
558  MemoryRegionInfo info;
559  Target &target = m_process->GetTarget();
561  if (status.Fail() || info.GetMapped() != MemoryRegionInfo::eYes ||
562  info.GetName().IsEmpty()) {
564  LLDB_LOG(log, "Failed to get interpreter region info: {0}", status);
565  return nullptr;
566  }
567 
568  FileSpec file(info.GetName().GetCString());
569  ModuleSpec module_spec(file, target.GetArchitecture());
570 
571  if (ModuleSP module_sp = target.GetOrCreateModule(module_spec,
572  true /* notify */)) {
574  false);
575  m_interpreter_module = module_sp;
576  return module_sp;
577  }
578  return nullptr;
579 }
580 
584  ModuleList module_list;
586 
587  LoadVDSO();
588 
589  if (!m_rendezvous.Resolve()) {
590  LLDB_LOGF(log,
591  "DynamicLoaderPOSIXDYLD::%s unable to resolve POSIX DYLD "
592  "rendezvous address",
593  __FUNCTION__);
594  return;
595  }
596 
597  // The rendezvous class doesn't enumerate the main module, so track that
598  // ourselves here.
599  ModuleSP executable = GetTargetExecutable();
601 
602  std::vector<FileSpec> module_names;
603  for (I = m_rendezvous.begin(), E = m_rendezvous.end(); I != E; ++I)
604  module_names.push_back(I->file_spec);
606  module_names, m_process->GetTarget().GetArchitecture().GetTriple());
607 
608  for (I = m_rendezvous.begin(), E = m_rendezvous.end(); I != E; ++I) {
609  ModuleSP module_sp =
610  LoadModuleAtAddress(I->file_spec, I->link_addr, I->base_addr, true);
611  if (module_sp.get()) {
612  LLDB_LOG(log, "LoadAllCurrentModules loading module: {0}",
613  I->file_spec.GetFilename());
614  module_list.Append(module_sp);
615  } else {
617  LLDB_LOGF(
618  log,
619  "DynamicLoaderPOSIXDYLD::%s failed loading module %s at 0x%" PRIx64,
620  __FUNCTION__, I->file_spec.GetCString(), I->base_addr);
621  }
622  }
623 
624  m_process->GetTarget().ModulesDidLoad(module_list);
626 }
627 
629  addr_t virt_entry;
630 
632  return m_load_offset;
633 
634  if ((virt_entry = GetEntryPoint()) == LLDB_INVALID_ADDRESS)
635  return LLDB_INVALID_ADDRESS;
636 
637  ModuleSP module = m_process->GetTarget().GetExecutableModule();
638  if (!module)
639  return LLDB_INVALID_ADDRESS;
640 
641  ObjectFile *exe = module->GetObjectFile();
642  if (!exe)
643  return LLDB_INVALID_ADDRESS;
644 
645  Address file_entry = exe->GetEntryPointAddress();
646 
647  if (!file_entry.IsValid())
648  return LLDB_INVALID_ADDRESS;
649 
650  m_load_offset = virt_entry - file_entry.GetFileAddress();
651  return m_load_offset;
652 }
653 
655  if (llvm::Optional<uint64_t> vdso_base =
657  m_vdso_base = *vdso_base;
658 
659  if (llvm::Optional<uint64_t> interpreter_base =
660  m_auxv->GetAuxValue(AuxVector::AUXV_AT_BASE))
661  m_interpreter_base = *interpreter_base;
662 }
663 
666  return m_entry_point;
667 
668  if (m_auxv == nullptr)
669  return LLDB_INVALID_ADDRESS;
670 
671  llvm::Optional<uint64_t> entry_point =
672  m_auxv->GetAuxValue(AuxVector::AUXV_AT_ENTRY);
673  if (!entry_point)
674  return LLDB_INVALID_ADDRESS;
675 
676  m_entry_point = static_cast<addr_t>(*entry_point);
677 
678  const ArchSpec &arch = m_process->GetTarget().GetArchitecture();
679 
680  // On ppc64, the entry point is actually a descriptor. Dereference it.
681  if (arch.GetMachine() == llvm::Triple::ppc64)
683 
684  return m_entry_point;
685 }
686 
688 DynamicLoaderPOSIXDYLD::GetThreadLocalData(const lldb::ModuleSP module_sp,
689  const lldb::ThreadSP thread,
690  lldb::addr_t tls_file_addr) {
691  auto it = m_loaded_modules.find(module_sp);
692  if (it == m_loaded_modules.end())
693  return LLDB_INVALID_ADDRESS;
694 
695  addr_t link_map = it->second;
696  if (link_map == LLDB_INVALID_ADDRESS)
697  return LLDB_INVALID_ADDRESS;
698 
700  if (!metadata.valid)
701  return LLDB_INVALID_ADDRESS;
702 
703  // Get the thread pointer.
704  addr_t tp = thread->GetThreadPointer();
705  if (tp == LLDB_INVALID_ADDRESS)
706  return LLDB_INVALID_ADDRESS;
707 
708  // Find the module's modid.
709  int modid_size = 4; // FIXME(spucci): This isn't right for big-endian 64-bit
710  int64_t modid = ReadUnsignedIntWithSizeInBytes(
711  link_map + metadata.modid_offset, modid_size);
712  if (modid == -1)
713  return LLDB_INVALID_ADDRESS;
714 
715  // Lookup the DTV structure for this thread.
716  addr_t dtv_ptr = tp + metadata.dtv_offset;
717  addr_t dtv = ReadPointer(dtv_ptr);
718  if (dtv == LLDB_INVALID_ADDRESS)
719  return LLDB_INVALID_ADDRESS;
720 
721  // Find the TLS block for this module.
722  addr_t dtv_slot = dtv + metadata.dtv_slot_size * modid;
723  addr_t tls_block = ReadPointer(dtv_slot + metadata.tls_offset);
724 
726  LLDB_LOGF(log,
727  "DynamicLoaderPOSIXDYLD::Performed TLS lookup: "
728  "module=%s, link_map=0x%" PRIx64 ", tp=0x%" PRIx64
729  ", modid=%" PRId64 ", tls_block=0x%" PRIx64 "\n",
730  module_sp->GetObjectName().AsCString(""), link_map, tp,
731  (int64_t)modid, tls_block);
732 
733  if (tls_block == LLDB_INVALID_ADDRESS)
734  return LLDB_INVALID_ADDRESS;
735  else
736  return tls_block + tls_file_addr;
737 }
738 
740  lldb::ModuleSP &module_sp) {
742 
743  if (m_process == nullptr)
744  return;
745 
746  auto &target = m_process->GetTarget();
747  const auto platform_sp = target.GetPlatform();
748 
749  ProcessInstanceInfo process_info;
750  if (!m_process->GetProcessInfo(process_info)) {
751  LLDB_LOGF(log,
752  "DynamicLoaderPOSIXDYLD::%s - failed to get process info for "
753  "pid %" PRIu64,
754  __FUNCTION__, m_process->GetID());
755  return;
756  }
757 
758  LLDB_LOGF(
759  log, "DynamicLoaderPOSIXDYLD::%s - got executable by pid %" PRIu64 ": %s",
760  __FUNCTION__, m_process->GetID(),
761  process_info.GetExecutableFile().GetPath().c_str());
762 
763  ModuleSpec module_spec(process_info.GetExecutableFile(),
764  process_info.GetArchitecture());
765  if (module_sp && module_sp->MatchesModuleSpec(module_spec))
766  return;
767 
768  const auto executable_search_paths(Target::GetDefaultExecutableSearchPaths());
769  auto error = platform_sp->ResolveExecutable(
770  module_spec, module_sp,
771  !executable_search_paths.IsEmpty() ? &executable_search_paths : nullptr);
772  if (error.Fail()) {
773  StreamString stream;
774  module_spec.Dump(stream);
775 
776  LLDB_LOGF(log,
777  "DynamicLoaderPOSIXDYLD::%s - failed to resolve executable "
778  "with module spec \"%s\": %s",
779  __FUNCTION__, stream.GetData(), error.AsCString());
780  return;
781  }
782 
783  target.SetExecutableModule(module_sp, eLoadDependentsNo);
784 }
785 
787  lldb_private::SymbolContext &sym_ctx) {
788  ModuleSP module_sp;
789  if (sym_ctx.symbol)
790  module_sp = sym_ctx.symbol->GetAddressRef().GetModule();
791  if (!module_sp && sym_ctx.function)
792  module_sp =
794  if (!module_sp)
795  return false;
796 
797  return module_sp->GetFileSpec().GetPath() == "[vdso]";
798 }
DYLDRendezvous::ModulesDidLoad
bool ModulesDidLoad() const
Definition: DYLDRendezvous.h:119
AuxVector::AUXV_AT_SYSINFO_EHDR
@ AUXV_AT_SYSINFO_EHDR
Definition: AuxVector.h:57
DYLDRendezvous::ThreadInfo
Definition: DYLDRendezvous.h:59
lldb_private::AddressRange::GetBaseAddress
Address & GetBaseAddress()
Get accessor for the base address of the range.
Definition: AddressRange.h:209
lldb_private::Process::LoadModules
virtual llvm::Error LoadModules()
Sometimes processes know how to retrieve and load shared libraries.
Definition: Process.h:675
lldb_private::ProcessInstanceInfo
Definition: ProcessInfo.h:108
DYLDRendezvous::loaded_begin
iterator loaded_begin() const
Iterators over all modules loaded into the inferior since the last call to Resolve().
Definition: DYLDRendezvous.h:175
DYLDRendezvous::UpdateExecutablePath
void UpdateExecutablePath()
Update the cached executable path.
Definition: DYLDRendezvous.cpp:114
DynamicLoaderPOSIXDYLD::DidLaunch
void DidLaunch() override
Called after launching a process.
Definition: DynamicLoaderPOSIXDYLD.cpp:168
lldb_private::ArchSpec
Definition: ArchSpec.h:33
LIBLLDB_LOG_DYNAMIC_LOADER
#define LIBLLDB_LOG_DYNAMIC_LOADER
Definition: Logging.h:17
lldb_private::StoppointCallbackContext
General Outline: When we hit a breakpoint we need to package up whatever information is needed to eva...
Definition: StoppointCallbackContext.h:26
lldb_private::Address::IsValid
bool IsValid() const
Check if the object state is valid.
Definition: Address.h:336
lldb_private::Breakpoint::SetOneShot
void SetOneShot(bool one_shot)
If one_shot is true, breakpoint will be deleted on first hit.
Definition: Breakpoint.cpp:332
lldb::eSymbolTypeCode
@ eSymbolTypeCode
Definition: lldb-enumerations.h:616
DynamicLoaderPOSIXDYLD::m_initial_modules_added
bool m_initial_modules_added
Indicates whether the initial set of modules was reported added.
Definition: DynamicLoaderPOSIXDYLD.h:100
lldb_private::ModuleList::Modules
ModuleIterable Modules() const
Definition: ModuleList.h:482
LLDB_INVALID_PROCESS_ID
#define LLDB_INVALID_PROCESS_ID
Definition: lldb-defines.h:93
lldb_private::ArchSpec::GetMachine
llvm::Triple::ArchType GetMachine() const
Returns a machine family for the current architecture.
Definition: ArchSpec.cpp:667
ModuleSpec.h
DynamicLoaderPOSIXDYLD::Terminate
static void Terminate()
Definition: DynamicLoaderPOSIXDYLD.cpp:39
lldb_private::Function::GetAddressRange
const AddressRange & GetAddressRange()
Definition: Function.h:461
lldb_private::Symbol
Definition: Symbol.h:20
DYLDRendezvous::end
iterator end() const
Definition: DYLDRendezvous.h:171
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:1977
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:379
lldb_private::Breakpoint::SetBreakpointKind
void SetBreakpointKind(const char *kind)
Set the "kind" description for a breakpoint.
Definition: Breakpoint.h:442
DynamicLoaderPOSIXDYLD::GetEntryPoint
lldb::addr_t GetEntryPoint()
Computes a value for m_entry_point returning the computed address on success and LLDB_INVALID_ADDRESS...
Definition: DynamicLoaderPOSIXDYLD.cpp:664
DYLDRendezvous::ThreadInfo::modid_offset
uint32_t modid_offset
Definition: DYLDRendezvous.h:63
DynamicLoaderPOSIXDYLD::m_load_offset
lldb::addr_t m_load_offset
Virtual load address of the inferior process.
Definition: DynamicLoaderPOSIXDYLD.h:63
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:2400
lldb_private::ModuleSpec::Dump
void Dump(Stream &strm) const
Definition: ModuleSpec.h:167
DYLDRendezvous::iterator
SOEntryList::const_iterator iterator
Definition: DYLDRendezvous.h:167
LLDB_LOGF
#define LLDB_LOGF(log,...)
Definition: Log.h:249
lldb_private::Process
Definition: Process.h:341
lldb_private::Target::GetExecutableModulePointer
Module * GetExecutableModulePointer()
Definition: Target.cpp:1359
DYLDRendezvous::begin
iterator begin() const
Iterators over all currently loaded modules.
Definition: DYLDRendezvous.h:170
DYLDRendezvous::ThreadInfo::dtv_slot_size
uint32_t dtv_slot_size
Definition: DYLDRendezvous.h:62
lldb_private::Target::GetExecutableModule
lldb::ModuleSP GetExecutableModule()
Gets the module for the main executable.
Definition: Target.cpp:1345
Module.h
BreakpointLocation.h
lldb_private::Process::GetTarget
Target & GetTarget()
Get the target object pointer for this module.
Definition: Process.h:1209
DynamicLoaderPOSIXDYLD
Definition: DynamicLoaderPOSIXDYLD.h:23
lldb_private::SymbolContextList
Definition: SymbolContext.h:379
lldb_private::SymbolContextList::GetContextAtIndex
bool GetContextAtIndex(size_t idx, SymbolContext &sc) const
Get accessor for a symbol context at index idx.
Definition: SymbolContext.cpp:1262
lldb_private::DynamicLoader::UnloadSectionsCommon
void UnloadSectionsCommon(const lldb::ModuleSP module)
Definition: DynamicLoader.cpp:123
lldb_private::MemoryRegionInfo
Definition: MemoryRegionInfo.h:21
DYLDRendezvous::ThreadInfo::dtv_offset
uint32_t dtv_offset
Definition: DYLDRendezvous.h:61
AuxVector::AUXV_AT_BASE
@ AUXV_AT_BASE
Interpreter base address.
Definition: AuxVector.h:33
lldb_private::Target::CreateBreakpoint
lldb::BreakpointSP CreateBreakpoint(const FileSpecList *containingModules, const FileSpec &file, uint32_t line_no, uint32_t column, lldb::addr_t offset, LazyBool check_inlines, LazyBool skip_prologue, bool internal, bool request_hardware, LazyBool move_to_nearest_code)
Definition: Target.cpp:328
lldb_private::ArchSpec::GetTriple
llvm::Triple & GetTriple()
Architecture triple accessor.
Definition: ArchSpec.h:444
lldb::addr_t
uint64_t addr_t
Definition: lldb-types.h:83
DynamicLoaderPOSIXDYLD::RefreshModules
void RefreshModules()
Helper method for RendezvousBreakpointHit.
Definition: DynamicLoaderPOSIXDYLD.cpp:412
lldb_private::SymbolContext
Definition: SymbolContext.h:33
lldb_private::Target
Definition: Target.h:451
Section.h
LLDB_PLUGIN_DEFINE_ADV
LLDB_PLUGIN_DEFINE_ADV(ObjectContainerUniversalMachO, ObjectContainerMachOArchive) void ObjectContainerUniversalMachO
Definition: ObjectContainerUniversalMachO.cpp:23
lldb_private::Target::GetImages
const ModuleList & GetImages() const
Get accessor for the images for this process.
Definition: Target.h:925
lldb_private::Process::PrefetchModuleSpecs
virtual void PrefetchModuleSpecs(llvm::ArrayRef< FileSpec > module_file_specs, const llvm::Triple &triple)
Definition: Process.h:2426
DYLDRendezvous::ModulesDidUnload
bool ModulesDidUnload() const
Definition: DYLDRendezvous.h:123
lldb_private::ModuleList::FindSymbolsWithNameAndType
void FindSymbolsWithNameAndType(ConstString name, lldb::SymbolType symbol_type, SymbolContextList &sc_list) const
Definition: ModuleList.cpp:462
Target.h
lldb_private::Target::GetPlatform
lldb::PlatformSP GetPlatform()
Definition: Target.h:1342
lldb_private::Module::GetFileSpec
const FileSpec & GetFileSpec() const
Get const accessor for the module file specification.
Definition: Module.h:477
lldb_private::Thread::GetProcess
lldb::ProcessSP GetProcess() const
Definition: Thread.h:152
Platform.h
lldb_private::FileSpec
Definition: FileSpec.h:56
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
DYLDRendezvous::GetThreadInfo
const ThreadInfo & GetThreadInfo()
Definition: DYLDRendezvous.cpp:622
ProcessInfo.h
DynamicLoaderPOSIXDYLD::LoadVDSO
void LoadVDSO()
Definition: DynamicLoaderPOSIXDYLD.cpp:533
lldb_private::ModuleList::Remove
bool Remove(const lldb::ModuleSP &module_sp, bool notify=true)
Remove a module from the module list.
DYLDRendezvous::ThreadInfo::valid
bool valid
Definition: DYLDRendezvous.h:60
lldb_private::ModuleList
Definition: ModuleList.h:72
Log.h
lldb_private::ConstString::IsEmpty
bool IsEmpty() const
Test for empty string.
Definition: ConstString.h:304
lldb_private::ModuleList::AppendIfNeeded
bool AppendIfNeeded(const lldb::ModuleSP &module_sp, bool notify=true)
Append a module to the module list, if it is not already there.
lldb_private::eLoadDependentsNo
@ eLoadDependentsNo
Definition: Target.h:64
MemoryRegionInfo.h
DYLDRendezvous::GetBreakAddress
lldb::addr_t GetBreakAddress() const
A breakpoint should be set at this address and Resolve called on each hit.
Definition: DYLDRendezvous.h:105
lldb_private::Thread
Definition: Thread.h:60
DYLDRendezvous::unloaded_end
iterator unloaded_end() const
Definition: DYLDRendezvous.h:181
lldb_private::Status::Fail
bool Fail() const
Test for error condition.
Definition: Status.cpp:182
lldb_private::StreamString::GetData
const char * GetData() const
Definition: StreamString.h:43
lldb_private::Process::GetMemoryRegionInfo
virtual Status GetMemoryRegionInfo(lldb::addr_t load_addr, MemoryRegionInfo &range_info)
Locate the memory region that contains load_addr.
Definition: Process.h:1815
DynamicLoaderPOSIXDYLD::m_loaded_modules
std::map< lldb::ModuleWP, lldb::addr_t, std::owner_less< lldb::ModuleWP > > m_loaded_modules
Loaded module list. (link map for each module)
Definition: DynamicLoaderPOSIXDYLD.h:87
lldb_private::DynamicLoader::ReadUnsignedIntWithSizeInBytes
int64_t ReadUnsignedIntWithSizeInBytes(lldb::addr_t addr, int size_in_bytes)
Definition: DynamicLoader.cpp:216
lldb_private::ObjectFile::GetImageInfoAddress
virtual lldb_private::Address GetImageInfoAddress(Target *target)
Similar to Process::GetImageInfoAddress().
Definition: ObjectFile.h:461
lldb_private::SymbolContext::function
Function * function
The Function for a given query.
Definition: SymbolContext.h:320
lldb_private::Address::GetFileAddress
lldb::addr_t GetFileAddress() const
Get the file address.
Definition: Address.cpp:290
lldb_private::Symbol::GetAddressRef
Address & GetAddressRef()
Definition: Symbol.h:57
DynamicLoaderPOSIXDYLD::m_interpreter_base
lldb::addr_t m_interpreter_base
Contains AT_BASE, which means a dynamic loader has been mapped to the address space.
Definition: DynamicLoaderPOSIXDYLD.h:80
lldb_private::DynamicLoader::ReadPointer
lldb::addr_t ReadPointer(lldb::addr_t addr)
Definition: DynamicLoader.cpp:227
lldb_private::SymbolContextList::GetSize
uint32_t GetSize() const
Get accessor for a symbol context list size.
Definition: SymbolContext.cpp:1278
DynamicLoaderPOSIXDYLD::m_vdso_base
lldb::addr_t m_vdso_base
Contains AT_SYSINFO_EHDR, which means a vDSO has been mapped to the address space.
Definition: DynamicLoaderPOSIXDYLD.h:76
lldb_private::ConstString
Definition: ConstString.h:40
lldb_private::Process::GetAuxvData
virtual DataExtractor GetAuxvData()
Definition: Process.cpp:2663
lldb_private::StreamString
Definition: StreamString.h:23
DynamicLoaderPOSIXDYLD::EntryBreakpointHit
static bool EntryBreakpointHit(void *baton, lldb_private::StoppointCallbackContext *context, lldb::user_id_t break_id, lldb::user_id_t break_loc_id)
Callback routine invoked when we hit the breakpoint on process entry.
Definition: DynamicLoaderPOSIXDYLD.cpp:253
lldb_private::AddressRange
Definition: AddressRange.h:25
DynamicLoaderPOSIXDYLD::DynamicLoaderPOSIXDYLD
DynamicLoaderPOSIXDYLD(lldb_private::Process *process)
Definition: DynamicLoaderPOSIXDYLD.cpp:63
lldb_private::ModuleList::FindFirstModule
lldb::ModuleSP FindFirstModule(const ModuleSpec &module_spec) const
Definition: ModuleList.cpp:582
lldb_private::DynamicLoader
Definition: DynamicLoader.h:52
lldb_private::DynamicLoader::m_process
Process * m_process
The process that this dynamic loader plug-in is tracking.
Definition: DynamicLoader.h:313
lldb_private::MemoryRegionInfo::GetName
ConstString GetName() const
Definition: MemoryRegionInfo.h:50
ThreadPlanRunToAddress.h
lldb_private::DynamicLoader::UpdateLoadedSectionsCommon
void UpdateLoadedSectionsCommon(lldb::ModuleSP module, lldb::addr_t base_addr, bool base_addr_is_offset)
Definition: DynamicLoader.cpp:111
DYLDRendezvous::IsValid
bool IsValid()
Definition: DYLDRendezvous.cpp:187
DYLDRendezvous::unloaded_begin
iterator unloaded_begin() const
Iterators over all modules unloaded from the inferior since the last call to Resolve().
Definition: DYLDRendezvous.h:180
Thread.h
AuxVector::AUXV_AT_ENTRY
@ AUXV_AT_ENTRY
Program entry point.
Definition: AuxVector.h:35
ObjectFile.h
DynamicLoaderPOSIXDYLD::RendezvousBreakpointHit
static bool RendezvousBreakpointHit(void *baton, lldb_private::StoppointCallbackContext *context, lldb::user_id_t break_id, lldb::user_id_t break_loc_id)
Callback routine which updates the current list of loaded modules based on the information supplied b...
Definition: DynamicLoaderPOSIXDYLD.cpp:383
LLDB_INVALID_BREAK_ID
#define LLDB_INVALID_BREAK_ID
Definition: lldb-defines.h:49
lldb_private::Symbol::GetName
ConstString GetName() const
Definition: Symbol.cpp:500
DynamicLoaderPOSIXDYLD::ComputeLoadOffset
lldb::addr_t ComputeLoadOffset()
Computes a value for m_load_offset returning the computed address on success and LLDB_INVALID_ADDRESS...
Definition: DynamicLoaderPOSIXDYLD.cpp:628
DynamicLoaderPOSIXDYLD::ResolveExecutableModule
void ResolveExecutableModule(lldb::ModuleSP &module_sp)
Loads Module from inferior process.
Definition: DynamicLoaderPOSIXDYLD.cpp:739
lldb_private::ModuleSpec
Definition: ModuleSpec.h:26
lldb_private::Target::GetArchitecture
const ArchSpec & GetArchitecture() const
Definition: Target.h:967
lldb_private::Status
Definition: Status.h:44
DynamicLoaderPOSIXDYLD::SetRendezvousBreakpoint
bool SetRendezvousBreakpoint()
If possible sets a breakpoint on a function called by the runtime linker each time a module is loaded...
Definition: DynamicLoaderPOSIXDYLD.cpp:301
DynamicLoaderPOSIXDYLD::GetPluginDescriptionStatic
static llvm::StringRef GetPluginDescriptionStatic()
Definition: DynamicLoaderPOSIXDYLD.cpp:41
lldb_private::eLazyBoolNo
@ eLazyBoolNo
Definition: lldb-private-enumerations.h:115
DynamicLoaderPOSIXDYLD::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: DynamicLoaderPOSIXDYLD.cpp:483
DynamicLoaderPOSIXDYLD::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: DynamicLoaderPOSIXDYLD.cpp:786
DynamicLoaderPOSIXDYLD::EvalSpecialModulesStatus
void EvalSpecialModulesStatus()
Evaluate if Aux vectors contain vDSO and LD information in case they do, read and assign the address ...
Definition: DynamicLoaderPOSIXDYLD.cpp:654
lldb_private::Address
Definition: Address.h:59
lldb_private::Target::ModulesDidLoad
void ModulesDidLoad(ModuleList &module_list)
Definition: Target.cpp:1611
DynamicLoaderPOSIXDYLD::m_auxv
std::unique_ptr< AuxVector > m_auxv
Auxiliary vector of the inferior process.
Definition: DynamicLoaderPOSIXDYLD.h:69
lldb_private::DynamicLoader::LoadModuleAtAddress
virtual lldb::ModuleSP LoadModuleAtAddress(const lldb_private::FileSpec &file, lldb::addr_t link_map_addr, lldb::addr_t base_addr, bool base_addr_is_offset)
Locates or creates a module given by file and updates/loads the resulting module at the virtual base ...
Definition: DynamicLoader.cpp:148
DynamicLoaderPOSIXDYLD.h
DYLDRendezvous::GetLinkMapAddress
lldb::addr_t GetLinkMapAddress() const
Definition: DYLDRendezvous.h:96
lldb_private::Breakpoint::SetCallback
void SetCallback(BreakpointHitCallback callback, void *baton, bool is_synchronous=false)
Set the callback action invoked when the breakpoint is hit.
Definition: Breakpoint.cpp:412
DynamicLoaderPOSIXDYLD::UnloadSections
void UnloadSections(const lldb::ModuleSP module) override
Removes the loaded sections from the target in module.
Definition: DynamicLoaderPOSIXDYLD.cpp:210
lldb_private::Address::GetLoadAddress
lldb::addr_t GetLoadAddress(Target *target) const
Get the load address.
Definition: Address.cpp:310
DYLDRendezvous::loaded_end
iterator loaded_end() const
Definition: DYLDRendezvous.h:176
lldb_private::Range::GetByteSize
SizeType GetByteSize() const
Definition: RangeMap.h:71
lldb_private::DynamicLoader::GetStopWhenImagesChange
bool GetStopWhenImagesChange() const
Get whether the process should stop when images change.
Definition: DynamicLoader.cpp:64
DynamicLoaderPOSIXDYLD::m_entry_point
lldb::addr_t m_entry_point
Virtual entry address of the inferior process.
Definition: DynamicLoaderPOSIXDYLD.h:66
DynamicLoaderPOSIXDYLD::CreateInstance
static lldb_private::DynamicLoader * CreateInstance(lldb_private::Process *process, bool force)
Definition: DynamicLoaderPOSIXDYLD.cpp:46
PluginManager.h
lldb_private::DynamicLoader::GetTargetExecutable
lldb::ModuleSP GetTargetExecutable()
Checks to see if the target module has changed, updates the target accordingly and returns the target...
Definition: DynamicLoader.cpp:72
lldb_private::Target::RemoveBreakpointByID
bool RemoveBreakpointByID(lldb::break_id_t break_id)
Definition: Target.cpp:931
LLDB_INVALID_ADDRESS
#define LLDB_INVALID_ADDRESS
Definition: lldb-defines.h:86
lldb_private::ConstString::GetCString
const char * GetCString() const
Get the string value as a C string.
Definition: ConstString.h:216
DYLDRendezvous::ThreadInfo::tls_offset
uint32_t tls_offset
Definition: DYLDRendezvous.h:64
LLDB_LOG
#define LLDB_LOG(log,...)
The LLDB_LOG* macros defined below are the way to emit log messages.
Definition: Log.h:242
DynamicLoaderPOSIXDYLD::m_rendezvous
DYLDRendezvous m_rendezvous
Runtime linker rendezvous structure.
Definition: DynamicLoaderPOSIXDYLD.h:60
Function.h
lldb_private::Process::GetID
lldb::pid_t GetID() const
Returns the pid of the process or LLDB_INVALID_PROCESS_ID if there is no known pid.
Definition: Process.h:541
lldb_private::MemoryRegionInfo::GetRange
RangeType & GetRange()
Definition: MemoryRegionInfo.h:36
lldb::user_id_t
uint64_t user_id_t
Definition: lldb-types.h:84
lldb::eLanguageTypeC
@ eLanguageTypeC
Non-standardized C, such as K&R.
Definition: lldb-enumerations.h:439
lldb_private::ProcessInfo::GetArchitecture
ArchSpec & GetArchitecture()
Definition: ProcessInfo.h:61
lldb_private
A class that represents a running process on the host machine.
Definition: SBCommandInterpreterRunOptions.h:16
DYLDRendezvous::Resolve
bool Resolve()
Update the internal snapshot of runtime linker rendezvous and recompute the currently loaded modules.
Definition: DYLDRendezvous.cpp:131
DynamicLoaderPOSIXDYLD::UpdateLoadedSections
void UpdateLoadedSections(lldb::ModuleSP module, lldb::addr_t link_map_addr, lldb::addr_t base_addr, bool base_addr_is_offset) override
Updates the load address of every allocatable section in module.
Definition: DynamicLoaderPOSIXDYLD.cpp:202
DynamicLoaderPOSIXDYLD::CanLoadImage
lldb_private::Status CanLoadImage() override
Ask if it is ok to try and load or unload an shared library (image).
Definition: DynamicLoaderPOSIXDYLD.cpp:200
DynamicLoaderPOSIXDYLD::LoadInterpreterModule
lldb::ModuleSP LoadInterpreterModule()
Definition: DynamicLoaderPOSIXDYLD.cpp:554
lldb_private::ProcessInfo::GetExecutableFile
FileSpec & GetExecutableFile()
Definition: ProcessInfo.h:42
DynamicLoaderPOSIXDYLD::LoadAllCurrentModules
virtual void LoadAllCurrentModules()
Helper for the entry breakpoint callback.
Definition: DynamicLoaderPOSIXDYLD.cpp:581
lldb_private::Symbol::IsTrampoline
bool IsTrampoline() const
Definition: Symbol.cpp:173
DynamicLoaderPOSIXDYLD::~DynamicLoaderPOSIXDYLD
~DynamicLoaderPOSIXDYLD() override
Definition: DynamicLoaderPOSIXDYLD.cpp:71
DynamicLoaderPOSIXDYLD::m_dyld_bid
lldb::break_id_t m_dyld_bid
Rendezvous breakpoint.
Definition: DynamicLoaderPOSIXDYLD.h:72
lldb_private::Address::GetModule
lldb::ModuleSP GetModule() const
Get accessor for the module for this address.
Definition: Address.cpp:282
lldb_private::Log
Definition: Log.h:49
DynamicLoaderPOSIXDYLD::ProbeEntry
void ProbeEntry()
Resolves the entry point for the current inferior process and sets a breakpoint at that address.
Definition: DynamicLoaderPOSIXDYLD.cpp:216
lldb_private::Target::GetBreakpointByID
lldb::BreakpointSP GetBreakpointByID(lldb::break_id_t break_id)
Definition: Target.cpp:300
lldb_private::Thread::GetStackFrameAtIndex
virtual lldb::StackFrameSP GetStackFrameAtIndex(uint32_t idx)
Definition: Thread.h:397
lldb_private::Target::ModulesDidUnload
void ModulesDidUnload(ModuleList &module_list, bool delete_locations)
Definition: Target.cpp:1643
lldb_private::GetLogIfAnyCategoriesSet
Log * GetLogIfAnyCategoriesSet(uint32_t mask)
Definition: Logging.cpp:62
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:348
lldb_private::StackFrame
Definition: StackFrame.h:40
DynamicLoaderPOSIXDYLD::DidAttach
void DidAttach() override
Called after attaching a process.
Definition: DynamicLoaderPOSIXDYLD.cpp:78
lldb_private::MemoryRegionInfo::GetMapped
OptionalBool GetMapped() const
Definition: MemoryRegionInfo.h:48
lldb
Definition: SBAddress.h:15
DynamicLoaderPOSIXDYLD::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: DynamicLoaderPOSIXDYLD.cpp:688
LLDB_LOG_ERROR
#define LLDB_LOG_ERROR(log, error,...)
Definition: Log.h:265
DynamicLoaderPOSIXDYLD::m_interpreter_module
std::weak_ptr< lldb_private::Module > m_interpreter_module
Contains the pointer to the interpret module, if loaded.
Definition: DynamicLoaderPOSIXDYLD.h:83
lldb_private::StackFrame::GetSymbolContext
const SymbolContext & GetSymbolContext(lldb::SymbolContextItem resolve_scope)
Provide a SymbolContext for this StackFrame's current pc value.
Definition: StackFrame.cpp:298
lldb_private::ObjectFile::GetEntryPointAddress
virtual lldb_private::Address GetEntryPointAddress()
Returns the address of the Entry Point in this object file - if the object file doesn't have an entry...
Definition: ObjectFile.h:471
lldb_private::ObjectFile
Definition: ObjectFile.h:58
lldb_private::Process::GetProcessInfo
virtual bool GetProcessInfo(ProcessInstanceInfo &info)
Definition: Process.cpp:5790
lldb_private::ModuleList::Append
void Append(const lldb::ModuleSP &module_sp, bool notify=true)
Append a module to the module list.
lldb_private::Breakpoint
General Outline: A breakpoint has four main parts, a filter, a resolver, the list of breakpoint locat...
Definition: Breakpoint.h:79