LLDB mainline
DYLDRendezvous.cpp
Go to the documentation of this file.
1//===-- DYLDRendezvous.cpp ------------------------------------------------===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
9#include "lldb/Core/Module.h"
11#include "lldb/Symbol/Symbol.h"
14#include "lldb/Target/Process.h"
15#include "lldb/Target/Target.h"
18#include "lldb/Utility/Log.h"
19#include "lldb/Utility/Status.h"
20
21#include "llvm/Support/Path.h"
22
23#include "DYLDRendezvous.h"
24
25using namespace lldb;
26using namespace lldb_private;
27
29 : m_process(process), m_rendezvous_addr(LLDB_INVALID_ADDRESS),
30 m_executable_interpreter(false), m_current(), m_previous(),
31 m_loaded_modules(), m_soentries(), m_added_soentries(),
32 m_removed_soentries() {
33 m_thread_info.valid = false;
35}
36
38 Log *log = GetLog(LLDBLog::DynamicLoader);
39 addr_t info_location;
40 addr_t info_addr;
42
43 if (!m_process) {
44 LLDB_LOGF(log, "%s null process provided", __FUNCTION__);
46 }
47
48 // Try to get it from our process. This might be a remote process and might
49 // grab it via some remote-specific mechanism.
50 info_location = m_process->GetImageInfoAddress();
51 LLDB_LOGF(log, "%s info_location = 0x%" PRIx64, __FUNCTION__, info_location);
52
53 // If the process fails to return an address, fall back to seeing if the
54 // local object file can help us find it.
55 if (info_location == LLDB_INVALID_ADDRESS) {
56 Target *target = &m_process->GetTarget();
57 if (target) {
58 ObjectFile *obj_file = target->GetExecutableModule()->GetObjectFile();
59 Address addr = obj_file->GetImageInfoAddress(target);
60
61 if (addr.IsValid()) {
62 info_location = addr.GetLoadAddress(target);
63 LLDB_LOGF(log,
64 "%s resolved via direct object file approach to 0x%" PRIx64,
65 __FUNCTION__, info_location);
66 } else {
67 const Symbol *_r_debug =
68 target->GetExecutableModule()->FindFirstSymbolWithNameAndType(
69 ConstString("_r_debug"));
70 if (_r_debug) {
71 info_addr = _r_debug->GetAddress().GetLoadAddress(target);
72 if (info_addr != LLDB_INVALID_ADDRESS) {
73 LLDB_LOGF(log,
74 "%s resolved by finding symbol '_r_debug' whose value is "
75 "0x%" PRIx64,
76 __FUNCTION__, info_addr);
78 return info_addr;
79 }
80 }
81 LLDB_LOGF(log,
82 "%s FAILED - direct object file approach did not yield a "
83 "valid address",
84 __FUNCTION__);
85 }
86 }
87 }
88
89 if (info_location == LLDB_INVALID_ADDRESS) {
90 LLDB_LOGF(log, "%s FAILED - invalid info address", __FUNCTION__);
92 }
93
94 LLDB_LOGF(log, "%s reading pointer (%" PRIu32 " bytes) from 0x%" PRIx64,
95 __FUNCTION__, m_process->GetAddressByteSize(), info_location);
96
97 info_addr = m_process->ReadPointerFromMemory(info_location, error);
98 if (error.Fail()) {
99 LLDB_LOGF(log, "%s FAILED - could not read from the info location: %s",
100 __FUNCTION__, error.AsCString());
102 }
103
104 if (info_addr == 0) {
105 LLDB_LOGF(log,
106 "%s FAILED - the rendezvous address contained at 0x%" PRIx64
107 " returned a null value",
108 __FUNCTION__, info_location);
110 }
111
112 return info_addr;
113}
114
116 if (m_process) {
117 Log *log = GetLog(LLDBLog::DynamicLoader);
119 if (exe_mod) {
121 LLDB_LOGF(log, "DYLDRendezvous::%s exe module executable path set: '%s'",
122 __FUNCTION__, m_exe_file_spec.GetPath().c_str());
123 } else {
124 LLDB_LOGF(log,
125 "DYLDRendezvous::%s cannot cache exe module path: null "
126 "executable module pointer",
127 __FUNCTION__);
128 }
129 }
130}
131
133 Log *log = GetLog(LLDBLog::DynamicLoader);
134
135 const size_t word_size = 4;
136 Rendezvous info;
137 size_t address_size;
138 size_t padding;
139 addr_t info_addr;
140 addr_t cursor;
141
142 address_size = m_process->GetAddressByteSize();
143 padding = address_size - word_size;
144 LLDB_LOGF(log,
145 "DYLDRendezvous::%s address size: %" PRIu64 ", padding %" PRIu64,
146 __FUNCTION__, uint64_t(address_size), uint64_t(padding));
147
149 cursor = info_addr =
151 else
152 cursor = info_addr = m_rendezvous_addr;
153 LLDB_LOGF(log, "DYLDRendezvous::%s cursor = 0x%" PRIx64, __FUNCTION__,
154 cursor);
155
156 if (cursor == LLDB_INVALID_ADDRESS)
157 return false;
158
159 if (!(cursor = ReadWord(cursor, &info.version, word_size)))
160 return false;
161
162 if (!(cursor = ReadPointer(cursor + padding, &info.map_addr)))
163 return false;
164
165 if (!(cursor = ReadPointer(cursor, &info.brk)))
166 return false;
167
168 if (!(cursor = ReadWord(cursor, &info.state, word_size)))
169 return false;
170
171 if (!(cursor = ReadPointer(cursor + padding, &info.ldbase)))
172 return false;
173
174 // The rendezvous was successfully read. Update our internal state.
175 m_rendezvous_addr = info_addr;
177 m_current = info;
178
179 if (m_current.map_addr == 0)
180 return false;
181
183 return true;
184
185 return UpdateSOEntries();
186}
187
190}
191
193 // If we have a core file, we will read the current rendezvous state
194 // from the core file's memory into m_current which can be in an inconsistent
195 // state, so we can't rely on its state to determine what we should do. We
196 // always need it to load all of the shared libraries one time when we attach
197 // to a core file.
198 if (IsCoreFile())
199 return eTakeSnapshot;
200
201 switch (m_current.state) {
202
203 case eConsistent:
204 switch (m_previous.state) {
205 // When the previous and current states are consistent this is the first
206 // time we have been asked to update. Just take a snapshot of the
207 // currently loaded modules.
208 case eConsistent:
209 return eTakeSnapshot;
210 // If we are about to add or remove a shared object clear out the current
211 // state and take a snapshot of the currently loaded images.
212 case eAdd:
213 return eAddModules;
214 case eDelete:
215 return eRemoveModules;
216 }
217 break;
218
219 case eAdd:
220 case eDelete:
221 return eNoAction;
222 }
223
224 return eNoAction;
225}
226
228 auto action = GetAction();
229
230 if (action == eNoAction)
231 return false;
232
233 m_added_soentries.clear();
234 m_removed_soentries.clear();
235 if (action == eTakeSnapshot) {
236 // We already have the loaded list from the previous update so no need to
237 // find all the modules again.
238 if (!m_loaded_modules.m_list.empty())
239 return true;
240 }
241
242 llvm::Expected<LoadedModuleInfoList> module_list =
244 if (!module_list) {
245 llvm::consumeError(module_list.takeError());
246 return false;
247 }
248
249 switch (action) {
250 case eTakeSnapshot:
251 m_soentries.clear();
252 return SaveSOEntriesFromRemote(*module_list);
253 case eAddModules:
254 return AddSOEntriesFromRemote(*module_list);
255 case eRemoveModules:
256 return RemoveSOEntriesFromRemote(*module_list);
257 case eNoAction:
258 return false;
259 }
260 llvm_unreachable("Fully covered switch above!");
261}
262
264 m_added_soentries.clear();
265 m_removed_soentries.clear();
266 switch (GetAction()) {
267 case eTakeSnapshot:
268 m_soentries.clear();
270 case eAddModules:
271 return AddSOEntries();
272 case eRemoveModules:
273 return RemoveSOEntries();
274 case eNoAction:
275 return false;
276 }
277 llvm_unreachable("Fully covered switch above!");
278}
279
281 LoadedModuleInfoList::LoadedModuleInfo const &modInfo, SOEntry &entry) {
282 addr_t link_map_addr;
283 addr_t base_addr;
284 addr_t dyn_addr;
285 std::string name;
286
287 if (!modInfo.get_link_map(link_map_addr) || !modInfo.get_base(base_addr) ||
288 !modInfo.get_dynamic(dyn_addr) || !modInfo.get_name(name))
289 return false;
290
291 entry.link_addr = link_map_addr;
292 entry.base_addr = base_addr;
293 entry.dyn_addr = dyn_addr;
294
295 entry.file_spec.SetFile(name, FileSpec::Style::native);
296
297 UpdateBaseAddrIfNecessary(entry, name);
298
299 // not needed if we're using ModuleInfos
300 entry.next = 0;
301 entry.prev = 0;
302 entry.path_addr = 0;
303
304 return true;
305}
306
308 const LoadedModuleInfoList &module_list) {
309 for (auto const &modInfo : module_list.m_list) {
310 SOEntry entry;
311 if (!FillSOEntryFromModuleInfo(modInfo, entry))
312 return false;
313
314 // Only add shared libraries and not the executable.
315 if (!SOEntryIsMainExecutable(entry)) {
317 m_soentries.push_back(entry);
318 }
319 }
320
321 m_loaded_modules = module_list;
322 return true;
323}
324
326 const LoadedModuleInfoList &module_list) {
327 for (auto const &modInfo : module_list.m_list) {
328 bool found = false;
329 for (auto const &existing : m_loaded_modules.m_list) {
330 if (modInfo == existing) {
331 found = true;
332 break;
333 }
334 }
335
336 if (found)
337 continue;
338
339 SOEntry entry;
340 if (!FillSOEntryFromModuleInfo(modInfo, entry))
341 return false;
342
343 // Only add shared libraries and not the executable.
344 if (!SOEntryIsMainExecutable(entry)) {
346 m_soentries.push_back(entry);
347 m_added_soentries.push_back(entry);
348 }
349 }
350
351 m_loaded_modules = module_list;
352 return true;
353}
354
356 const LoadedModuleInfoList &module_list) {
357 for (auto const &existing : m_loaded_modules.m_list) {
358 bool found = false;
359 for (auto const &modInfo : module_list.m_list) {
360 if (modInfo == existing) {
361 found = true;
362 break;
363 }
364 }
365
366 if (found)
367 continue;
368
369 SOEntry entry;
370 if (!FillSOEntryFromModuleInfo(existing, entry))
371 return false;
372
373 // Only add shared libraries and not the executable.
374 if (!SOEntryIsMainExecutable(entry)) {
375 auto pos = std::find(m_soentries.begin(), m_soentries.end(), entry);
376 if (pos == m_soentries.end())
377 return false;
378
379 m_soentries.erase(pos);
380 m_removed_soentries.push_back(entry);
381 }
382 }
383
384 m_loaded_modules = module_list;
385 return true;
386}
387
389 SOEntry entry;
390 iterator pos;
391
392 assert(m_previous.state == eAdd);
393
394 if (m_current.map_addr == 0)
395 return false;
396
397 for (addr_t cursor = m_current.map_addr; cursor != 0; cursor = entry.next) {
398 if (!ReadSOEntryFromMemory(cursor, entry))
399 return false;
400
401 // Only add shared libraries and not the executable.
402 if (SOEntryIsMainExecutable(entry))
403 continue;
404
406
407 if (!llvm::is_contained(m_soentries, entry)) {
408 m_soentries.push_back(entry);
409 m_added_soentries.push_back(entry);
410 }
411 }
412
413 return true;
414}
415
417 SOEntryList entry_list;
418 iterator pos;
419
420 assert(m_previous.state == eDelete);
421
422 if (!TakeSnapshot(entry_list))
423 return false;
424
425 for (iterator I = begin(); I != end(); ++I) {
426 if (!llvm::is_contained(entry_list, *I))
427 m_removed_soentries.push_back(*I);
428 }
429
430 m_soentries = entry_list;
431 return true;
432}
433
435 // On some systes the executable is indicated by an empty path in the entry.
436 // On others it is the full path to the executable.
437
438 auto triple = m_process->GetTarget().GetArchitecture().GetTriple();
439 switch (triple.getOS()) {
440 case llvm::Triple::FreeBSD:
441 case llvm::Triple::NetBSD:
442 return entry.file_spec == m_exe_file_spec;
443 case llvm::Triple::Linux:
444 if (triple.isAndroid())
445 return entry.file_spec == m_exe_file_spec;
446 // If we are debugging ld.so, then all SOEntries should be treated as
447 // libraries, including the "main" one (denoted by an empty string).
449 return false;
450 return !entry.file_spec;
451 default:
452 return false;
453 }
454}
455
457 SOEntry entry;
458
459 if (m_current.map_addr == 0)
460 return false;
461
462 // Clear previous entries since we are about to obtain an up to date list.
463 entry_list.clear();
464
465 for (addr_t cursor = m_current.map_addr; cursor != 0; cursor = entry.next) {
466 if (!ReadSOEntryFromMemory(cursor, entry))
467 return false;
468
469 // Only add shared libraries and not the executable.
470 if (SOEntryIsMainExecutable(entry))
471 continue;
472
474
475 entry_list.push_back(entry);
476 }
477
478 return true;
479}
480
481addr_t DYLDRendezvous::ReadWord(addr_t addr, uint64_t *dst, size_t size) {
483
484 *dst = m_process->ReadUnsignedIntegerFromMemory(addr, size, 0, error);
485 if (error.Fail())
486 return 0;
487
488 return addr + size;
489}
490
493
495 if (error.Fail())
496 return 0;
497
498 return addr + m_process->GetAddressByteSize();
499}
500
502 std::string str;
504
505 if (addr == LLDB_INVALID_ADDRESS)
506 return std::string();
507
509
510 return str;
511}
512
513// Returns true if the load bias reported by the linker is incorrect for the
514// given entry. This function is used to handle cases where we want to work
515// around a bug in the system linker.
516static bool isLoadBiasIncorrect(Target &target, const std::string &file_path) {
517 // On Android L (API 21, 22) the load address of the "/system/bin/linker"
518 // isn't filled in correctly.
519 unsigned os_major = target.GetPlatform()->GetOSVersion().getMajor();
520 return target.GetArchitecture().GetTriple().isAndroid() &&
521 (os_major == 21 || os_major == 22) &&
522 (file_path == "/system/bin/linker" ||
523 file_path == "/system/bin/linker64");
524}
525
527 std::string const &file_path) {
528 // If the load bias reported by the linker is incorrect then fetch the load
529 // address of the file from the proc file system.
530 if (isLoadBiasIncorrect(m_process->GetTarget(), file_path)) {
532 bool is_loaded = false;
533 Status error =
534 m_process->GetFileLoadAddress(entry.file_spec, is_loaded, load_addr);
535 if (error.Success() && is_loaded)
536 entry.base_addr = load_addr;
537 }
538}
539
541 // Updates filename if empty. It is useful while debugging ld.so,
542 // when the link map returns empty string for the main executable.
543 if (!entry.file_spec) {
544 MemoryRegionInfo region;
545 Status region_status =
546 m_process->GetMemoryRegionInfo(entry.dyn_addr, region);
547 if (!region.GetName().IsEmpty())
548 entry.file_spec.SetFile(region.GetName().AsCString(),
549 FileSpec::Style::native);
550 }
551}
552
554 entry.clear();
555
556 entry.link_addr = addr;
557
558 if (!(addr = ReadPointer(addr, &entry.base_addr)))
559 return false;
560
561 // mips adds an extra load offset field to the link map struct on FreeBSD and
562 // NetBSD (need to validate other OSes).
563 // http://svnweb.freebsd.org/base/head/sys/sys/link_elf.h?revision=217153&view=markup#l57
564 const ArchSpec &arch = m_process->GetTarget().GetArchitecture();
565 if ((arch.GetTriple().getOS() == llvm::Triple::FreeBSD ||
566 arch.GetTriple().getOS() == llvm::Triple::NetBSD) &&
567 arch.IsMIPS()) {
568 addr_t mips_l_offs;
569 if (!(addr = ReadPointer(addr, &mips_l_offs)))
570 return false;
571 if (mips_l_offs != 0 && mips_l_offs != entry.base_addr)
572 return false;
573 }
574
575 if (!(addr = ReadPointer(addr, &entry.path_addr)))
576 return false;
577
578 if (!(addr = ReadPointer(addr, &entry.dyn_addr)))
579 return false;
580
581 if (!(addr = ReadPointer(addr, &entry.next)))
582 return false;
583
584 if (!(addr = ReadPointer(addr, &entry.prev)))
585 return false;
586
587 std::string file_path = ReadStringFromMemory(entry.path_addr);
588 entry.file_spec.SetFile(file_path, FileSpec::Style::native);
589
590 UpdateBaseAddrIfNecessary(entry, file_path);
591
592 return true;
593}
594
595bool DYLDRendezvous::FindMetadata(const char *name, PThreadField field,
596 uint32_t &value) {
597 Target &target = m_process->GetTarget();
598
601 eSymbolTypeAny, list);
602 if (list.IsEmpty())
603 return false;
604
605 Address address = list[0].symbol->GetAddress();
606 addr_t addr = address.GetLoadAddress(&target);
607 if (addr == LLDB_INVALID_ADDRESS)
608 return false;
609
612 addr + field * sizeof(uint32_t), sizeof(uint32_t), 0, error);
613 if (error.Fail())
614 return false;
615
616 if (field == eSize)
617 value /= 8; // convert bits to bytes
618
619 return true;
620}
621
623 if (!m_thread_info.valid) {
624 bool ok = true;
625
626 ok &= FindMetadata("_thread_db_pthread_dtvp", eOffset,
628 ok &=
629 FindMetadata("_thread_db_dtv_dtv", eSize, m_thread_info.dtv_slot_size);
630 ok &= FindMetadata("_thread_db_link_map_l_tls_modid", eOffset,
632 ok &= FindMetadata("_thread_db_dtv_t_pointer_val", eOffset,
634
635 if (ok)
636 m_thread_info.valid = true;
637 }
638
639 return m_thread_info;
640}
641
643 int state = GetState();
644
645 if (!log)
646 return;
647
648 log->PutCString("DYLDRendezvous:");
649 LLDB_LOGF(log, " Address: %" PRIx64, GetRendezvousAddress());
650 LLDB_LOGF(log, " Version: %" PRIu64, GetVersion());
651 LLDB_LOGF(log, " Link : %" PRIx64, GetLinkMapAddress());
652 LLDB_LOGF(log, " Break : %" PRIx64, GetBreakAddress());
653 LLDB_LOGF(log, " LDBase : %" PRIx64, GetLDBase());
654 LLDB_LOGF(log, " State : %s",
655 (state == eConsistent)
656 ? "consistent"
657 : (state == eAdd) ? "add"
658 : (state == eDelete) ? "delete" : "unknown");
659
660 iterator I = begin();
661 iterator E = end();
662
663 if (I != E)
664 log->PutCString("DYLDRendezvous SOEntries:");
665
666 for (int i = 1; I != E; ++I, ++i) {
667 LLDB_LOGF(log, "\n SOEntry [%d] %s", i, I->file_spec.GetPath().c_str());
668 LLDB_LOGF(log, " Base : %" PRIx64, I->base_addr);
669 LLDB_LOGF(log, " Path : %" PRIx64, I->path_addr);
670 LLDB_LOGF(log, " Dyn : %" PRIx64, I->dyn_addr);
671 LLDB_LOGF(log, " Next : %" PRIx64, I->next);
672 LLDB_LOGF(log, " Prev : %" PRIx64, I->prev);
673 }
674}
675
677 return !m_process->IsLiveDebugSession();
678}
static const size_t word_size
static llvm::raw_ostream & error(Stream &strm)
static bool isLoadBiasIncorrect(Target &target, const std::string &file_path)
#define LLDB_LOGF(log,...)
Definition: Log.h:344
bool FindMetadata(const char *name, PThreadField field, uint32_t &value)
lldb::addr_t ReadPointer(lldb::addr_t addr, lldb::addr_t *dst)
Reads an address from the inferior's address space starting at addr.
std::string ReadStringFromMemory(lldb::addr_t addr)
Reads a null-terminated C string from the memory location starting at addr.
std::list< SOEntry > SOEntryList
bool ReadSOEntryFromMemory(lldb::addr_t addr, SOEntry &entry)
Reads an SOEntry starting at addr.
lldb::addr_t GetBreakAddress() const
A breakpoint should be set at this address and Resolve called on each hit.
lldb_private::Process * m_process
void UpdateExecutablePath()
Update the cached executable path.
bool UpdateSOEntries()
Updates the current set of SOEntries, the set of added entries, and the set of removed entries.
bool m_executable_interpreter
uint64_t GetState() const
Returns the current state of the rendezvous structure.
lldb::addr_t GetLinkMapAddress() const
DYLDRendezvous(lldb_private::Process *process)
LoadedModuleInfoList m_loaded_modules
List of currently loaded SO modules.
bool UpdateSOEntriesFromRemote()
Same as UpdateSOEntries but it gets the list of loaded modules from the remote debug server (faster w...
bool IsCoreFile() const
bool Resolve()
Update the internal snapshot of runtime linker rendezvous and recompute the currently loaded modules.
RendezvousAction GetAction() const
Returns the current action to be taken given the current and previous state.
bool AddSOEntriesFromRemote(const LoadedModuleInfoList &module_list)
SOEntryList m_added_soentries
List of SOEntry's added to the link map since the last call to Resolve().
lldb::addr_t ResolveRendezvousAddress()
Locates the address of the rendezvous structure.
bool FillSOEntryFromModuleInfo(LoadedModuleInfoList::LoadedModuleInfo const &modInfo, SOEntry &entry)
lldb::addr_t m_rendezvous_addr
Location of the r_debug structure in the inferiors address space.
iterator begin() const
Iterators over all currently loaded modules.
SOEntryList m_soentries
List of SOEntry objects corresponding to the current link map state.
void DumpToLog(lldb_private::Log *log) const
uint64_t GetVersion() const
lldb_private::FileSpec m_exe_file_spec
const ThreadInfo & GetThreadInfo()
void UpdateBaseAddrIfNecessary(SOEntry &entry, std::string const &file_path)
Rendezvous m_previous
lldb::addr_t GetLDBase() const
bool TakeSnapshot(SOEntryList &entry_list)
Reads the current list of shared objects according to the link map supplied by the runtime linker.
void UpdateFileSpecIfNecessary(SOEntry &entry)
bool SOEntryIsMainExecutable(const SOEntry &entry)
lldb::addr_t GetRendezvousAddress() const
lldb::addr_t ReadWord(lldb::addr_t addr, uint64_t *dst, size_t size)
Reads an unsigned integer of size bytes from the inferior's address space starting at addr.
Rendezvous m_current
Current and previous snapshots of the rendezvous structure.
bool RemoveSOEntriesFromRemote(const LoadedModuleInfoList &module_list)
SOEntryList m_removed_soentries
List of SOEntry's removed from the link map since the last call to Resolve().
bool SaveSOEntriesFromRemote(const LoadedModuleInfoList &module_list)
SOEntryList::const_iterator iterator
ThreadInfo m_thread_info
Threading metadata read from the inferior.
iterator end() const
A section + offset based address class.
Definition: Address.h:59
lldb::addr_t GetLoadAddress(Target *target) const
Get the load address.
Definition: Address.cpp:311
bool IsValid() const
Check if the object state is valid.
Definition: Address.h:345
An architecture specification class.
Definition: ArchSpec.h:32
llvm::Triple & GetTriple()
Architecture triple accessor.
Definition: ArchSpec.h:463
bool IsMIPS() const
if MIPS architecture return true.
Definition: ArchSpec.cpp:554
A uniqued constant string class.
Definition: ConstString.h:39
const char * AsCString(const char *value_if_empty=nullptr) const
Get the string value as a C string.
Definition: ConstString.h:192
bool IsEmpty() const
Test for empty string.
Definition: ConstString.h:303
void SetFile(llvm::StringRef path, Style style)
Change the file specified with a new path.
Definition: FileSpec.cpp:173
size_t GetPath(char *path, size_t max_path_length, bool denormalize=true) const
Extract the full path to the file.
Definition: FileSpec.cpp:366
std::vector< LoadedModuleInfo > m_list
void PutCString(const char *cstr)
Definition: Log.cpp:134
void FindSymbolsWithNameAndType(ConstString name, lldb::SymbolType symbol_type, SymbolContextList &sc_list) const
Definition: ModuleList.cpp:509
A class that describes an executable image and its associated object and symbol files.
Definition: Module.h:88
const FileSpec & GetPlatformFileSpec() const
Get accessor for the module platform file specification.
Definition: Module.h:512
A plug-in interface definition class for object file parsers.
Definition: ObjectFile.h:62
virtual lldb_private::Address GetImageInfoAddress(Target *target)
Similar to Process::GetImageInfoAddress().
Definition: ObjectFile.h:477
A plug-in interface definition class for debugging a process.
Definition: Process.h:343
size_t ReadCStringFromMemory(lldb::addr_t vm_addr, char *cstr, size_t cstr_max_len, Status &error)
Read a NULL terminated C string from memory.
Definition: Process.cpp:1991
virtual llvm::Expected< LoadedModuleInfoList > GetLoadedModuleList()
Query remote GDBServer for a detailed loaded library list.
Definition: Process.h:671
uint64_t ReadUnsignedIntegerFromMemory(lldb::addr_t load_addr, size_t byte_size, uint64_t fail_value, Status &error)
Reads an unsigned integer of the specified byte size from process memory.
Definition: Process.cpp:2066
virtual lldb::addr_t GetImageInfoAddress()
Get the image information address for the current process.
Definition: Process.cpp:1484
lldb::addr_t ReadPointerFromMemory(lldb::addr_t vm_addr, Status &error)
Definition: Process.cpp:2088
virtual Status GetFileLoadAddress(const FileSpec &file, bool &is_loaded, lldb::addr_t &load_addr)
Try to find the load address of a file.
Definition: Process.h:2446
uint32_t GetAddressByteSize() const
Definition: Process.cpp:3383
virtual bool IsLiveDebugSession() const
Definition: Process.h:1426
Status GetMemoryRegionInfo(lldb::addr_t load_addr, MemoryRegionInfo &range_info)
Locate the memory region that contains load_addr.
Definition: Process.cpp:5893
Target & GetTarget()
Get the target object pointer for this module.
Definition: Process.h:1220
An error handling class.
Definition: Status.h:44
Defines a list of symbol context objects.
Address GetAddress() const
Definition: Symbol.h:87
Module * GetExecutableModulePointer()
Definition: Target.cpp:1385
lldb::ModuleSP GetExecutableModule()
Gets the module for the main executable.
Definition: Target.cpp:1371
lldb::PlatformSP GetPlatform()
Definition: Target.h:1405
const ModuleList & GetImages() const
Get accessor for the images for this process.
Definition: Target.h:948
const ArchSpec & GetArchitecture() const
Definition: Target.h:990
#define LLDB_INVALID_ADDRESS
Definition: lldb-defines.h:74
A class that represents a running process on the host machine.
Definition: SBAttachInfo.h:14
Log * GetLog(Cat mask)
Retrieve the Log object for the channel associated with the given log enum.
Definition: Log.h:309
Definition: SBAddress.h:15
uint64_t addr_t
Definition: lldb-types.h:79
Structure representing the shared objects currently loaded into the inferior process.
lldb::addr_t path_addr
String naming the shared object.
lldb::addr_t base_addr
Base address of the loaded object.
lldb::addr_t link_addr
Address of this link_map.
lldb_private::FileSpec file_spec
File spec of shared object.
lldb::addr_t prev
Address of previous so_entry.
lldb::addr_t next
Address of next so_entry.
lldb::addr_t dyn_addr
Dynamic section of shared object.