39#ifdef ENABLE_DEBUG_PRINTF
41#define DEBUG_PRINTF(fmt, ...) printf(fmt, ##__VA_ARGS__)
43#define DEBUG_PRINTF(fmt, ...)
53 :
DynamicLoader(process), m_dyld_module_wp(), m_libpthread_module_wp(),
54 m_pthread_getspecific_addr(), m_tid_to_tls_map(), m_dyld_image_infos(),
55 m_dyld_image_infos_stop_id(
UINT32_MAX), m_dyld(), m_mutex() {}
82 std::lock_guard<std::recursive_mutex> guard(
m_mutex);
91 ImageInfo &image_info,
bool can_create,
bool *did_create_ptr) {
93 *did_create_ptr =
false;
103 if (target_triple.getOS() == llvm::Triple::IOS &&
104 target_triple.getEnvironment() == llvm::Triple::MacABI) {
114 !module_sp->GetUUID().IsValid()) {
117 if (module_sp->GetModificationTime() !=
122 if (module_sp || !can_create)
125 if (HostInfo::GetArchitecture().IsCompatibleMatch(target.
GetArchitecture())) {
136 if (image_info.
uuid &&
148 if (!module_sp || module_sp->GetObjectFile() ==
nullptr)
153 *did_create_ptr = (bool)module_sp;
159 const std::vector<lldb::addr_t> &solib_addresses) {
160 std::lock_guard<std::recursive_mutex> guard(
m_mutex);
166 LLDB_LOGF(log,
"Removing %" PRId64
" modules.",
167 (uint64_t)solib_addresses.size());
171 for (
addr_t solib_addr : solib_addresses) {
176 if (module_to_remove.get()) {
177 LLDB_LOGF(log,
"Removing module at address 0x%" PRIx64, solib_addr);
185 if (solib_addr == (*pos).address) {
195 if (unloaded_module_list.
GetSize() > 0) {
199 log,
"DynamicLoaderDarwin::UnloadModules");
212 std::lock_guard<std::recursive_mutex> guard(target_modules.
GetMutex());
218 if (module_sp && module_sp != dyld_sp) {
220 unloaded_modules_list.
Append(module_sp);
224 if (unloaded_modules_list.
GetSize() != 0) {
228 log,
"DynamicLoaderDarwin::UnloadAllImages");
240 bool changed =
false;
243 if (image_object_file) {
246 std::vector<uint32_t> inaccessible_segment_indexes;
249 const size_t num_segments = info.
segments.size();
250 for (
size_t i = 0; i < num_segments; ++i) {
256 if (info.
segments[i].maxprot == 0) {
257 inaccessible_segment_indexes.push_back(i);
259 const addr_t new_section_load_addr =
261 static ConstString g_section_name_LINKEDIT(
"__LINKEDIT");
268 const bool warn_multiple =
269 section_sp->GetName() != g_section_name_LINKEDIT;
272 section_sp, new_section_load_addr, warn_multiple);
283 if (changed && !inaccessible_segment_indexes.empty()) {
284 for (uint32_t i = 0; i < inaccessible_segment_indexes.size(); ++i) {
285 const uint32_t seg_idx = inaccessible_segment_indexes[i];
290 static ConstString g_pagezero_section_name(
"__PAGEZERO");
291 if (g_pagezero_section_name == section_sp->GetName()) {
317 bool changed =
false;
320 if (image_object_file) {
323 const size_t num_segments = info.
segments.size();
324 for (
size_t i = 0; i < num_segments; ++i) {
328 const addr_t old_section_load_addr =
331 section_sp, old_section_load_addr))
335 llvm::formatv(
"unable to find and unload segment named "
336 "'{0}' in '{1}' in macosx dynamic loader plug-in",
337 info.
segments[i].name.AsCString(
"<invalid>"),
354 image_details->GetAsDictionary()->GetValueForKey(
"images");
355 if (images_sp.get() ==
nullptr)
358 image_infos.resize(images_sp->GetAsArray()->GetSize());
360 for (
size_t i = 0; i < image_infos.size(); i++) {
362 images_sp->GetAsArray()->GetItemAtIndex(i);
363 if (image_sp.get() ==
nullptr || image_sp->GetAsDictionary() ==
nullptr)
367 if (!image->
HasKey(
"load_address") ||
368 !image->
HasKey(
"pathname") ||
369 !image->
HasKey(
"mach_header") ||
370 image->
GetValueForKey(
"mach_header")->GetAsDictionary() ==
nullptr ||
371 !image->
HasKey(
"segments") ||
377 image_infos[i].address =
379 image_infos[i].file_spec.SetFile(
381 FileSpec::Style::native);
385 image_infos[i].header.magic =
387 image_infos[i].header.cputype =
389 image_infos[i].header.cpusubtype =
391 image_infos[i].header.filetype =
394 if (image->
HasKey(
"min_version_os_name")) {
395 std::string os_name =
399 if (os_name ==
"macosx")
400 image_infos[i].os_type = llvm::Triple::MacOSX;
401 else if (os_name ==
"ios" || os_name ==
"iphoneos")
402 image_infos[i].os_type = llvm::Triple::IOS;
403 else if (os_name ==
"tvos")
404 image_infos[i].os_type = llvm::Triple::TvOS;
405 else if (os_name ==
"watchos")
406 image_infos[i].os_type = llvm::Triple::WatchOS;
407 else if (os_name ==
"bridgeos")
408 image_infos[i].os_type = llvm::Triple::BridgeOS;
409 else if (os_name ==
"maccatalyst") {
410 image_infos[i].os_type = llvm::Triple::IOS;
411 image_infos[i].os_env = llvm::Triple::MacABI;
412 }
else if (os_name ==
"iossimulator") {
413 image_infos[i].os_type = llvm::Triple::IOS;
414 image_infos[i].os_env = llvm::Triple::Simulator;
415 }
else if (os_name ==
"tvossimulator") {
416 image_infos[i].os_type = llvm::Triple::TvOS;
417 image_infos[i].os_env = llvm::Triple::Simulator;
418 }
else if (os_name ==
"watchossimulator") {
419 image_infos[i].os_type = llvm::Triple::WatchOS;
420 image_infos[i].os_env = llvm::Triple::Simulator;
423 if (image->
HasKey(
"min_version_os_sdk")) {
424 image_infos[i].min_version_os_sdk =
434 image_infos[i].header.flags =
437 image_infos[i].header.flags = 0;
440 image_infos[i].header.ncmds =
443 image_infos[i].header.ncmds = 0;
445 if (mh->
HasKey(
"sizeofcmds"))
446 image_infos[i].header.sizeofcmds =
449 image_infos[i].header.sizeofcmds = 0;
453 uint32_t segcount = segments->
GetSize();
454 for (
size_t j = 0; j < segcount; j++) {
472 if (seg->
HasKey(
"initprot"))
483 if (seg->
HasKey(
"nsects"))
489 image_infos[i].segments.push_back(segment);
492 image_infos[i].uuid.SetFromStringRef(
502 const size_t num_sections = image_infos[i].segments.size();
503 for (
size_t k = 0; k < num_sections; ++k) {
506 if ((image_infos[i].segments[k].fileoff == 0 &&
507 image_infos[i].segments[k].filesize > 0) ||
508 (image_infos[i].segments[k].name ==
"__TEXT")) {
509 image_infos[i].slide =
510 image_infos[i].address - image_infos[i].segments[k].vmaddr;
529 const size_t image_infos_size = image_infos.size();
530 for (
size_t i = 0; i < image_infos_size; i++) {
531 if (image_infos[i].header.filetype == llvm::MachO::MH_DYLINKER) {
536 if (target_arch.
GetTriple().getEnvironment() == llvm::Triple::Simulator &&
537 image_infos[i].os_type != llvm::Triple::OSType::MacOSX) {
543 if (image_infos[i].header.filetype == llvm::MachO::MH_EXECUTE) {
550 const bool can_create =
true;
552 can_create,
nullptr));
554 LLDB_LOGF(log,
"Found executable module: %s",
555 exe_module_sp->GetFileSpec().GetPath().c_str());
562 auto exe_triple = exe_module_sp->GetArchitecture().GetTriple();
563 if (target_arch.
GetTriple().isArm64e() &&
564 exe_triple.getArch() == llvm::Triple::aarch64 &&
565 !exe_triple.isArm64e()) {
575 triple.setArchName(exe_triple.getArchName());
584 const bool can_create =
true;
586 can_create,
nullptr);
589 dyld_sp->GetFileSpec().GetPath().c_str());
599 if (image_info.
header.filetype == llvm::MachO::MH_DYLINKER) {
600 const bool can_create =
true;
615 auto log_err = [log](llvm::StringLiteral err_msg) -> std::nullopt_t {
622 return log_err(
"Couldn't retrieve DYLD module. Cannot get `start` symbol.");
625 dyld_sp->FindFirstSymbolWithNameAndType(
ConstString(
"_dyld_start"));
627 return log_err(
"Cannot find `start` symbol in DYLD module.");
645 std::lock_guard<std::recursive_mutex> guard(
m_mutex);
652 for (uint32_t idx = 0; idx < image_infos.size(); ++idx) {
654 LLDB_LOGF(log,
"Adding new image at address=0x%16.16" PRIx64
".",
655 image_infos[idx].address);
656 image_infos[idx].PutToLog(log);
664 if (image_module_sp) {
665 ObjectFile *objfile = image_module_sp->GetObjectFile();
672 if (commpage_section) {
674 image_infos[idx].GetArchitecture());
678 if (!commpage_image_module_sp) {
684 if (!commpage_image_module_sp ||
685 commpage_image_module_sp->GetObjectFile() ==
nullptr) {
687 image_infos[idx].file_spec, image_infos[idx].address);
692 bool changed =
false;
717 ArchSpec dyld_spec = image_infos[idx].GetArchitecture();
718 auto &dyld_triple = dyld_spec.
GetTriple();
719 if ((dyld_triple.getEnvironment() == llvm::Triple::MacABI &&
720 dyld_triple.getOS() == llvm::Triple::IOS) ||
721 (dyld_triple.getEnvironment() == llvm::Triple::Simulator &&
722 (dyld_triple.getOS() == llvm::Triple::IOS ||
723 dyld_triple.getOS() == llvm::Triple::TvOS ||
724 dyld_triple.getOS() == llvm::Triple::WatchOS)))
725 image_module_sp->MergeArchitecture(dyld_spec);
729 if (loaded_module_list.
GetSize() > 0) {
732 "DynamicLoaderDarwin::ModulesDidLoad");
755 if (module_sp.get() ==
nullptr && sym_ctx.
function) {
759 if (module_sp.get() ==
nullptr)
763 return objc_runtime !=
nullptr &&
772 LLDB_LOGF(log,
"\t\t%16s [0x%16.16" PRIx64
" - 0x%16.16" PRIx64
")",
776 "\t\t%16s [0x%16.16" PRIx64
" - 0x%16.16" PRIx64
777 ") slide = 0x%" PRIx64,
787 if (os_env == llvm::Triple::MacABI && os_type == llvm::Triple::IOS) {
789 "-apple-ios" + min_version_os_sdk +
"-macabi");
794 if (os_env == llvm::Triple::Simulator &&
795 (os_type == llvm::Triple::IOS || os_type == llvm::Triple::TvOS ||
796 os_type == llvm::Triple::WatchOS)) {
798 "-apple-" + llvm::Triple::getOSTypeName(os_type) +
799 min_version_os_sdk +
"-simulator");
809 const size_t num_segments = segments.size();
810 for (
size_t i = 0; i < num_segments; ++i) {
811 if (segments[i].name == name)
822 LLDB_LOG(log,
"uuid={1} path='{2}' (UNLOADED)", uuid.GetAsString(),
823 file_spec.GetPath());
825 LLDB_LOG(log,
"address={0:x+16} uuid={1} path='{2}'", address,
826 uuid.GetAsString(), file_spec.GetPath());
827 for (uint32_t i = 0; i < segments.size(); ++i)
828 segments[i].PutToLog(log, slide);
833 DEBUG_PRINTF(
"DynamicLoaderDarwin::%s() process state = %s\n", __FUNCTION__,
843 DEBUG_PRINTF(
"DynamicLoaderDarwin::%s(%s)\n", __FUNCTION__,
886 if (current_symbol !=
nullptr) {
887 std::vector<Address> addresses;
893 if (trampoline_name) {
894 const ModuleList &images = target_sp->GetImages();
901 context.GetAddressRange(eSymbolContextEverything, 0,
false,
908 LLDB_LOGF(log,
"Found a trampoline target symbol at 0x%" PRIx64
".",
917 if (context.symbol) {
922 if (actual_symbol_addr.
IsValid()) {
923 addresses.push_back(actual_symbol_addr);
928 "Found a re-exported symbol: %s at 0x%" PRIx64
".",
942 context.GetAddressRange(eSymbolContextEverything, 0,
false,
949 LLDB_LOGF(log,
"Found an indirect target symbol at 0x%" PRIx64
".",
958 const Symbol *actual_symbol =
965 "Found a re-exported symbol: %s pointing to: %s at 0x%" PRIx64
975 if (addresses.size() > 0) {
978 std::vector<lldb::addr_t> load_addrs;
979 for (
Address address : addresses) {
985 &symbol_address,
error);
986 if (
error.Success()) {
987 load_addrs.push_back(resolved_addr);
989 "ResolveIndirectFunction found resolved target for "
990 "%s at 0x%" PRIx64
".",
994 load_addrs.push_back(address.GetLoadAddress(target_sp.get()));
997 thread_plan_sp = std::make_shared<ThreadPlanRunToAddress>(
998 thread, load_addrs, stop_others);
1001 LLDB_LOGF(log,
"Could not find symbol for step through.");
1004 return thread_plan_sp;
1012 if (!trampoline_name)
1015 static const char *resolver_name_regex =
"(_gc|_non_gc|\\$[A-Za-z0-9\\$]+)$";
1016 std::string equivalent_regex_buf(
"^");
1017 equivalent_regex_buf.append(trampoline_name.
GetCString());
1018 equivalent_regex_buf.append(resolver_name_regex);
1022 equivalent_symbols);
1035 if (module_list.
GetSize() == 1) {
1050 module_sp->FindSymbolsWithNameAndType(
ConstString(
"pthread_getspecific"),
1066 if (!thread_sp || !module_sp)
1069 std::lock_guard<std::recursive_mutex> guard(
m_mutex);
1072 if (!module_sp->ResolveFileAddress(tls_file_addr, tls_addr))
1084 auto evaluate_tls_address = [
this, &thread_sp, &clang_void_ptr_type](
1086 llvm::ArrayRef<addr_t> args) ->
addr_t {
1090 *thread_sp, func_ptr, clang_void_ptr_type, args, options));
1095 exe_ctx, thread_plan_sp, options, execution_errors);
1099 thread_plan_sp->GetReturnValueObject()) {
1123 uint8_t buf[
sizeof(
addr_t) * 3];
1125 const size_t tls_data_size = addr_size * 3;
1127 tls_addr, buf, tls_data_size,
error,
true);
1128 if (bytes_read != tls_data_size ||
error.Fail())
1137 if (tls_thunk != 0) {
1142 const addr_t tls_data = evaluate_tls_address(
1143 thunk_load_addr, llvm::ArrayRef<addr_t>(tls_load_addr));
1145 return tls_data + tls_offset;
1157 auto tls_pos = tid_pos->second.find(key);
1158 if (tls_pos != tid_pos->second.end()) {
1159 return tls_pos->second + tls_offset;
1163 if (pthread_getspecific_addr.
IsValid()) {
1164 const addr_t tls_data = evaluate_tls_address(pthread_getspecific_addr,
1165 llvm::ArrayRef<addr_t>(key));
1167 return tls_data + tls_offset;
1175 bool use_new_spi_interface =
false;
1178 if (!version.empty()) {
1179 const llvm::Triple::OSType os_type =
1183 if (os_type == llvm::Triple::MacOSX &&
1184 version >= llvm::VersionTuple(10, 12))
1185 use_new_spi_interface =
true;
1188 if (os_type == llvm::Triple::IOS && version >= llvm::VersionTuple(10))
1189 use_new_spi_interface =
true;
1192 if (os_type == llvm::Triple::TvOS && version >= llvm::VersionTuple(10))
1193 use_new_spi_interface =
true;
1196 if (os_type == llvm::Triple::WatchOS && version >= llvm::VersionTuple(3))
1197 use_new_spi_interface =
true;
1205 if (use_new_spi_interface)
1207 log,
"DynamicLoaderDarwin::UseDYLDSPI: Use new DynamicLoader plugin");
1210 log,
"DynamicLoaderDarwin::UseDYLDSPI: Use old DynamicLoader plugin");
1212 return use_new_spi_interface;
static llvm::raw_ostream & error(Stream &strm)
#define DEBUG_PRINTF(fmt,...)
#define LLDB_LOG(log,...)
The LLDB_LOG* macros defined below are the way to emit log messages.
#define LLDB_LOGF(log,...)
#define LLDB_LOGV(log,...)
A section + offset based address range class.
Address & GetBaseAddress()
Get accessor for the base address of the range.
A section + offset based address class.
lldb::addr_t GetLoadAddress(Target *target) const
Get the load address.
bool SetLoadAddress(lldb::addr_t load_addr, Target *target, bool allow_section_end=false)
Set the address to represent load_addr.
lldb::ModuleSP GetModule() const
Get accessor for the module for this address.
lldb::addr_t GetOffset() const
Get the section relative offset value.
bool IsValid() const
Check if the object state is valid.
An architecture specification class.
llvm::Triple & GetTriple()
Architecture triple accessor.
bool SetTriple(const llvm::Triple &triple)
Architecture triple setter.
void MergeFrom(const ArchSpec &other)
Merges fields from another ArchSpec into this ArchSpec.
bool IsCompatibleMatch(const ArchSpec &rhs) const
Shorthand for IsMatch(rhs, CompatibleMatch).
const char * GetArchitectureName() const
Returns a static string representing the current architecture.
Generic representation of a type in a programming language.
CompilerType GetPointerType() const
Return a new CompilerType that is a pointer to this type.
A uniqued constant string class.
const char * AsCString(const char *value_if_empty=nullptr) const
Get the string value as a C string.
const char * GetCString() const
Get the string value as a C string.
static void ReportWarning(std::string message, std::optional< lldb::user_id_t > debugger_id=std::nullopt, std::once_flag *once=nullptr)
Report warning events.
lldb_private::ConstString name
void PutToLog(lldb_private::Log *log, lldb::addr_t slide) const
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.
lldb::ModuleSP GetDYLDModule()
void UpdateSpecialBinariesFromNewImageInfos(ImageInfo::collection &image_infos)
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...
virtual bool NeedToDoInitialImageFetch()=0
ImageInfo::collection m_dyld_image_infos
virtual void DoInitialImageFetch()=0
DynamicLoaderDarwin(lldb_private::Process *process)
std::recursive_mutex m_mutex
uint32_t m_dyld_image_infos_stop_id
void UpdateDYLDImageInfoFromNewImageInfo(ImageInfo &image_info)
void PrivateProcessStateChanged(lldb_private::Process *process, lldb::StateType state)
void DidLaunch() override
Called after attaching a process.
lldb::ModuleWP m_dyld_module_wp
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...
virtual bool SetNotificationBreakpoint()=0
bool AddModulesUsingImageInfos(ImageInfo::collection &image_infos)
void DidAttach() override
Called after attaching a process.
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.
lldb::ModuleWP m_libpthread_module_wp
bool JSONImageInformationIntoImageInfo(lldb_private::StructuredData::ObjectSP image_details, ImageInfo::collection &image_infos)
bool UpdateImageLoadAddress(lldb_private::Module *module, ImageInfo &info)
std::optional< lldb_private::Address > GetStartAddress() override
Return the start address in the dynamic loader module.
lldb::ModuleSP FindTargetModuleForImageInfo(ImageInfo &image_info, bool can_create, bool *did_create_ptr)
void PrivateInitialize(lldb_private::Process *process)
~DynamicLoaderDarwin() override
lldb_private::Address GetPthreadSetSpecificAddress()
void Clear(bool clear_process)
void SetDYLDModule(lldb::ModuleSP &dyld_module_sp)
ThreadIDToTLSMap m_tid_to_tls_map
static bool UseDYLDSPI(lldb_private::Process *process)
lldb_private::Address m_pthread_getspecific_addr
bool UnloadModuleSections(lldb_private::Module *module, ImageInfo &info)
lldb::ModuleSP GetPThreadLibraryModule()
void UnloadImages(const std::vector< lldb::addr_t > &solib_addresses)
virtual bool DidSetNotificationBreakpoint()=0
A plug-in interface definition class for dynamic loaders.
Process * m_process
The process that this dynamic loader plug-in is tracking.
virtual void UnloadSections(const lldb::ModuleSP module)
Removes the loaded sections from the target in module.
"lldb/Target/ExecutionContext.h" A class that contains an execution context.
size_t GetPath(char *path, size_t max_path_length, bool denormalize=true) const
Extract the full path to the file.
void SetFilename(ConstString filename)
Filename string set accessor.
llvm::sys::TimePoint GetModificationTime(const FileSpec &file_spec) const
Returns the modification time of the given file.
static FileSystem & Instance()
const AddressRange & GetAddressRange()
void PutCString(const char *cstr)
ConstString GetName(NamePreference preference=ePreferDemangled) const
Best name get accessor.
A collection class for Module objects.
std::recursive_mutex & GetMutex() const
lldb::ModuleSP FindFirstModule(const ModuleSpec &module_spec) const
bool AppendIfNeeded(const lldb::ModuleSP &new_module, bool notify=true)
Append a module to the module list, if it is not already there.
void FindSymbolsWithNameAndType(ConstString name, lldb::SymbolType symbol_type, SymbolContextList &sc_list) const
void FindModules(const ModuleSpec &module_spec, ModuleList &matching_module_list) const
Finds the first module whose file specification matches file_spec.
bool Remove(const lldb::ModuleSP &module_sp, bool notify=true)
Remove a module from the module list.
lldb::ModuleSP GetModuleAtIndex(size_t idx) const
Get the module shared pointer for the module at index idx.
void Append(const lldb::ModuleSP &module_sp, bool notify=true)
Append a module to the module list.
void FindSymbolsMatchingRegExAndType(const RegularExpression ®ex, lldb::SymbolType symbol_type, SymbolContextList &sc_list) const
ModuleIterable Modules() const
size_t GetSize() const
Gets the size of the module list.
void LogUUIDAndPaths(Log *log, const char *prefix_cstr)
void SetObjectSize(uint64_t object_size)
ConstString & GetObjectName()
ArchSpec & GetArchitecture()
void SetObjectOffset(uint64_t object_offset)
A class that describes an executable image and its associated object and symbol files.
virtual ObjectFile * GetObjectFile()
Get the object file representation for the current architecture.
virtual bool IsModuleObjCLibrary(const lldb::ModuleSP &module_sp)=0
static ObjCLanguageRuntime * Get(Process &process)
A plug-in interface definition class for object file parsers.
virtual lldb::addr_t GetFileOffset() const
Returns the offset into a file at which this object resides.
virtual FileSpec & GetFileSpec()
Get accessor to the object file specification.
virtual SectionList * GetSectionList(bool update_module_section_list=true)
Gets the section list for the currently selected architecture (and object for archives).
virtual lldb::addr_t GetByteSize() const
A plug-in interface definition class for debugging a process.
lldb::ExpressionResults RunThreadPlan(ExecutionContext &exe_ctx, lldb::ThreadPlanSP &thread_plan_sp, const EvaluateExpressionOptions &options, DiagnosticManager &diagnostic_manager)
void AddInvalidMemoryRegion(const LoadRange ®ion)
lldb::ByteOrder GetByteOrder() const
lldb::StateType GetState()
Get accessor for the current process state.
virtual llvm::VersionTuple GetHostOSVersion()
Sometimes the connection to a process can detect the host OS version that the process is running on.
virtual bool IsAlive()
Check if a process is still alive.
lldb::addr_t FixCodeAddress(lldb::addr_t pc)
Some targets might use bits in a code address to indicate a mode switch, ARM uses bit zero to signify...
uint32_t GetAddressByteSize() const
uint32_t GetStopID() const
lldb::ModuleSP ReadModuleFromMemory(const FileSpec &file_spec, lldb::addr_t header_addr, size_t size_to_read=512)
Target & GetTarget()
Get the target object pointer for this module.
static lldb::TypeSystemClangSP GetForTarget(Target &target, std::optional< IsolatedASTKind > ast_kind=DefaultAST, bool create_on_demand=true)
Returns the scratch TypeSystemClang for the given target.
lldb::SectionSP FindSectionByName(ConstString section_dstr) const
lldb::offset_t GetFileOffset() const
This base class provides an interface to stack frames.
const SymbolContext & GetSymbolContext(lldb::SymbolContextItem resolve_scope)
Provide a SymbolContext for this StackFrame's current pc value.
ObjectSP GetItemAtIndex(size_t idx) const
ObjectSP GetValueForKey(llvm::StringRef key) const
bool HasKey(llvm::StringRef key) const
Dictionary * GetAsDictionary()
std::shared_ptr< Object > ObjectSP
Defines a list of symbol context objects.
bool GetContextAtIndex(size_t idx, SymbolContext &sc) const
Get accessor for a symbol context at index idx.
Defines a symbol context baton that can be handed other debug core functions.
Function * function
The Function for a given query.
Symbol * symbol
The Symbol for a given query.
bool IsTrampoline() const
Address & GetAddressRef()
ConstString GetName() const
lldb::SymbolType GetType() const
Address GetAddress() const
Symbol * ResolveReExportedSymbol(Target &target) const
Symbol * CalculateSymbolContextSymbol() override
void ModulesDidLoad(ModuleList &module_list)
Module * GetExecutableModulePointer()
void ClearAllLoadedSections()
bool SetSectionUnloaded(const lldb::SectionSP §ion_sp)
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...
virtual 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)
bool SetArchitecture(const ArchSpec &arch_spec, bool set_platform=false, bool merge=true)
Set the architecture for this target.
lldb::ModuleSP GetExecutableModule()
Gets the module for the main executable.
bool ResolveLoadAddress(lldb::addr_t load_addr, Address &so_addr, uint32_t stop_id=SectionLoadHistory::eStopIDNow)
const ModuleList & GetImages() const
Get accessor for the images for this process.
const ArchSpec & GetArchitecture() const
void SetExecutableModule(lldb::ModuleSP &module_sp, LoadDependentFiles load_dependent_files=eLoadDependentsDefault)
Set the main executable module.
bool SetSectionLoadAddress(const lldb::SectionSP §ion, lldb::addr_t load_addr, bool warn_multiple=false)
virtual lldb::StackFrameSP GetStackFrameAtIndex(uint32_t idx)
lldb::TargetSP CalculateTarget() override
lldb::ProcessSP GetProcess() const
#define LLDB_INVALID_ADDRESS
A class that represents a running process on the host machine.
Log * GetLog(Cat mask)
Retrieve the Log object for the channel associated with the given log enum.
const char * StateAsCString(lldb::StateType state)
Converts a StateType to a C string.
std::shared_ptr< lldb_private::ThreadPlan > ThreadPlanSP
std::shared_ptr< lldb_private::Thread > ThreadSP
std::shared_ptr< lldb_private::ValueObject > ValueObjectSP
StateType
Process and Thread States.
@ eStateUnloaded
Process is object is valid, but not currently loaded.
@ eStateConnected
Process is connected to remote debug services, but not launched or attached to anything yet.
@ eStateDetached
Process has been detached and can't be examined.
@ eStateStopped
Process or thread is stopped and can be examined.
@ eStateSuspended
Process or thread is in a suspended state as far as the debugger is concerned while other processes o...
@ eStateRunning
Process or thread is running and can't be examined.
@ eStateLaunching
Process is in the process of launching.
@ eStateAttaching
Process is currently trying to attach.
@ eStateExited
Process has exited and can't be examined.
@ eStateStepping
Process or thread is in the process of stepping and can not be examined.
@ eStateCrashed
Process or thread has crashed and can be examined.
ExpressionResults
The results of expression evaluation.
std::shared_ptr< lldb_private::TypeSystemClang > TypeSystemClangSP
std::shared_ptr< lldb_private::Section > SectionSP
std::shared_ptr< lldb_private::Target > TargetSP
std::shared_ptr< lldb_private::Module > ModuleSP
lldb_private::ArchSpec GetArchitecture() const
std::vector< ImageInfo > collection
lldb_private::UUID uuid
UUID for this dylib if it has one, else all zeros.
lldb::addr_t address
Address of mach header for this dylib.
lldb::addr_t slide
The amount to slide all segments by if there is a global slide.
llvm::MachO::mach_header header
The mach header for this image.
std::vector< Segment > segments
All segment vmaddr and vmsize pairs for this executable (from memory of inferior).
const Segment * FindSegment(lldb_private::ConstString name) const
lldb_private::FileSpec file_spec
Resolved path for this dylib.
void Clear(bool load_cmd_data_only)
uint32_t load_stop_id
The process stop ID that the sections for this image were loaded.
void PutToLog(lldb_private::Log *log) const
lldb::DataBufferSP data_sp