m_dos_header (),
m_coff_header (),
m_coff_header_opt (),
- m_sect_headers ()
+ m_sect_headers (),
+ m_entry_point_address ()
{
::memset (&m_dos_header, 0, sizeof(m_dos_header));
::memset (&m_coff_header, 0, sizeof(m_coff_header));
return 0;
}
+lldb_private::Address
+ObjectFilePECOFF::GetEntryPointAddress ()
+{
+ if (m_entry_point_address.IsValid())
+ return m_entry_point_address;
+
+ if (!ParseHeader() || !IsExecutable())
+ return m_entry_point_address;
+
+ SectionList *section_list = GetSectionList();
+ addr_t offset = m_coff_header_opt.entry;
+
+ if (!section_list)
+ m_entry_point_address.SetOffset(offset);
+ else
+ m_entry_point_address.ResolveAddressUsingFileSections(offset, section_list);
+ return m_entry_point_address;
+}
+
//----------------------------------------------------------------------
// Dump
uint32_t
GetDependentModules(lldb_private::FileSpecList& files) override;
-// virtual lldb_private::Address
-// GetEntryPointAddress ();
+ virtual lldb_private::Address
+ GetEntryPointAddress () override;
ObjectFile::Type
CalculateType() override;
coff_opt_header_t m_coff_header_opt;
SectionHeaderColl m_sect_headers;
lldb::addr_t m_image_base;
+ lldb_private::Address m_entry_point_address;
};
#endif // liblldb_ObjectFilePECOFF_h_