Пример #1
0
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
0
ObjectFile::ObjectFile (const lldb::ModuleSP &module_sp, 
                        const ProcessSP &process_sp,
                        lldb::addr_t header_addr, 
                        DataBufferSP& header_data_sp) :
    ModuleChild (module_sp),
    m_file (),
    m_type (eTypeInvalid),
    m_strata (eStrataInvalid),
    m_file_offset (0),
    m_length (0),
    m_data (),
    m_unwind_table (*this),
    m_process_wp (process_sp),
    m_memory_addr (header_addr),
    m_sections_ap (),
    m_symtab_ap (),
    m_symtab_unified_ap (),
    m_symtab_unified_revisionid (0)
{
    if (header_data_sp)
        m_data.SetData (header_data_sp, 0, header_data_sp->GetByteSize());
    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_OBJECT));
    if (log)
    {
        log->Printf ("%p ObjectFile::ObjectFile() module = %p (%s), process = %p, header_addr = 0x%" PRIx64,
                     this,
                     module_sp.get(),
                     module_sp->GetSpecificationDescription().c_str(),
                     process_sp.get(),
                     m_memory_addr);
    }
}