本文整理汇总了C++中lldb::ModuleSP::get方法的典型用法代码示例。如果您正苦于以下问题:C++ ModuleSP::get方法的具体用法?C++ ModuleSP::get怎么用?C++ ModuleSP::get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类lldb::ModuleSP
的用法示例。
在下文中一共展示了ModuleSP::get方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ModuleChild
ObjectFile::ObjectFile (const lldb::ModuleSP &module_sp,
const FileSpec *file_spec_ptr,
lldb::offset_t file_offset,
lldb::offset_t length,
lldb::DataBufferSP& data_sp,
lldb::offset_t data_offset
) :
ModuleChild (module_sp),
m_file (), // This file could be different from the original module's file
m_type (eTypeInvalid),
m_strata (eStrataInvalid),
m_file_offset (file_offset),
m_length (length),
m_data (),
m_unwind_table (*this),
m_process_wp(),
m_memory_addr (LLDB_INVALID_ADDRESS),
m_sections_ap (),
m_symtab_ap (),
m_symtab_unified_ap (),
m_symtab_unified_revisionid (0)
{
if (file_spec_ptr)
m_file = *file_spec_ptr;
if (data_sp)
m_data.SetData (data_sp, data_offset, length);
Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_OBJECT));
if (log)
{
if (m_file)
{
log->Printf ("%p ObjectFile::ObjectFile() module = %p (%s), file = %s, file_offset = 0x%8.8" PRIx64 ", size = %" PRIu64,
this,
module_sp.get(),
module_sp->GetSpecificationDescription().c_str(),
m_file.GetPath().c_str(),
m_file_offset,
m_length);
}
else
{
log->Printf ("%p ObjectFile::ObjectFile() module = %p (%s), file = <NULL>, file_offset = 0x%8.8" PRIx64 ", size = %" PRIu64,
this,
module_sp.get(),
module_sp->GetSpecificationDescription().c_str(),
m_file_offset,
m_length);
}
}
}
示例2: FIXME
lldb::addr_t
DynamicLoaderPOSIXDYLD::GetThreadLocalData (const lldb::ModuleSP module, const lldb::ThreadSP thread)
{
auto it = m_loaded_modules.find (module);
if (it == m_loaded_modules.end())
return LLDB_INVALID_ADDRESS;
addr_t link_map = it->second;
if (link_map == LLDB_INVALID_ADDRESS)
return LLDB_INVALID_ADDRESS;
const DYLDRendezvous::ThreadInfo &metadata = m_rendezvous.GetThreadInfo();
if (!metadata.valid)
return LLDB_INVALID_ADDRESS;
// Get the thread pointer.
addr_t tp = thread->GetThreadPointer ();
if (tp == LLDB_INVALID_ADDRESS)
return LLDB_INVALID_ADDRESS;
// Find the module's modid.
int modid_size = 4; // FIXME(spucci): This isn't right for big-endian 64-bit
int64_t modid = ReadUnsignedIntWithSizeInBytes (link_map + metadata.modid_offset, modid_size);
if (modid == -1)
return LLDB_INVALID_ADDRESS;
// Lookup the DTV structure for this thread.
addr_t dtv_ptr = tp + metadata.dtv_offset;
addr_t dtv = ReadPointer (dtv_ptr);
if (dtv == LLDB_INVALID_ADDRESS)
return LLDB_INVALID_ADDRESS;
// Find the TLS block for this module.
addr_t dtv_slot = dtv + metadata.dtv_slot_size*modid;
addr_t tls_block = ReadPointer (dtv_slot + metadata.tls_offset);
Module *mod = module.get();
Log *log(GetLogIfAnyCategoriesSet(LIBLLDB_LOG_DYNAMIC_LOADER));
if (log)
log->Printf("DynamicLoaderPOSIXDYLD::Performed TLS lookup: "
"module=%s, link_map=0x%" PRIx64 ", tp=0x%" PRIx64 ", modid=%" PRId64 ", tls_block=0x%" PRIx64 "\n",
mod->GetObjectName().AsCString(""), link_map, tp, (int64_t)modid, tls_block);
return tls_block;
}
示例3: resolved_exe_file
Error
PlatformDarwin::ResolveExecutable (const FileSpec &exe_file,
const ArchSpec &exe_arch,
lldb::ModuleSP &exe_module_sp,
const FileSpecList *module_search_paths_ptr)
{
Error error;
// Nothing special to do here, just use the actual file and architecture
char exe_path[PATH_MAX];
FileSpec resolved_exe_file (exe_file);
if (IsHost())
{
// If we have "ls" as the exe_file, resolve the executable loation based on
// the current path variables
if (!resolved_exe_file.Exists())
{
exe_file.GetPath (exe_path, sizeof(exe_path));
resolved_exe_file.SetFile(exe_path, true);
}
if (!resolved_exe_file.Exists())
resolved_exe_file.ResolveExecutableLocation ();
// Resolve any executable within a bundle on MacOSX
Host::ResolveExecutableInBundle (resolved_exe_file);
if (resolved_exe_file.Exists())
error.Clear();
else
{
exe_file.GetPath (exe_path, sizeof(exe_path));
error.SetErrorStringWithFormat ("unable to find executable for '%s'", exe_path);
}
}
else
{
if (m_remote_platform_sp)
{
error = m_remote_platform_sp->ResolveExecutable (exe_file,
exe_arch,
exe_module_sp,
module_search_paths_ptr);
}
else
{
// We may connect to a process and use the provided executable (Don't use local $PATH).
// Resolve any executable within a bundle on MacOSX
Host::ResolveExecutableInBundle (resolved_exe_file);
if (resolved_exe_file.Exists())
error.Clear();
else
error.SetErrorStringWithFormat("the platform is not currently connected, and '%s' doesn't exist in the system root.", resolved_exe_file.GetFilename().AsCString(""));
}
}
if (error.Success())
{
ModuleSpec module_spec (resolved_exe_file, exe_arch);
if (module_spec.GetArchitecture().IsValid())
{
error = ModuleList::GetSharedModule (module_spec,
exe_module_sp,
module_search_paths_ptr,
NULL,
NULL);
if (error.Fail() || exe_module_sp.get() == NULL || exe_module_sp->GetObjectFile() == NULL)
{
exe_module_sp.reset();
error.SetErrorStringWithFormat ("'%s%s%s' doesn't contain the architecture %s",
exe_file.GetDirectory().AsCString(""),
exe_file.GetDirectory() ? "/" : "",
exe_file.GetFilename().AsCString(""),
exe_arch.GetArchitectureName());
}
}
else
{
// No valid architecture was specified, ask the platform for
// the architectures that we should be using (in the correct order)
// and see if we can find a match that way
StreamString arch_names;
for (uint32_t idx = 0; GetSupportedArchitectureAtIndex (idx, module_spec.GetArchitecture()); ++idx)
{
error = ModuleList::GetSharedModule (module_spec,
exe_module_sp,
module_search_paths_ptr,
NULL,
NULL);
// Did we find an executable using one of the
if (error.Success())
{
if (exe_module_sp && exe_module_sp->GetObjectFile())
break;
else
//.........这里部分代码省略.........