diff options
Diffstat (limited to 'include/lldb/Symbol/ObjectFile.h')
| -rw-r--r-- | include/lldb/Symbol/ObjectFile.h | 46 |
1 files changed, 25 insertions, 21 deletions
diff --git a/include/lldb/Symbol/ObjectFile.h b/include/lldb/Symbol/ObjectFile.h index 1e9ae8b45417..c6bafcecb6f6 100644 --- a/include/lldb/Symbol/ObjectFile.h +++ b/include/lldb/Symbol/ObjectFile.h @@ -40,7 +40,7 @@ public: virtual void PopulateSectionList(lldb_private::ObjectFile *obj_file, lldb_private::SectionList §ion_list) = 0; - virtual bool GetArchitecture(lldb_private::ArchSpec &arch) = 0; + virtual ArchSpec GetArchitecture() = 0; }; //---------------------------------------------------------------------- @@ -305,19 +305,13 @@ public: virtual const FileSpec &GetFileSpec() const { return m_file; } //------------------------------------------------------------------ - /// Get the name of the cpu, vendor and OS for this object file. - /// - /// This value is a string that represents the target triple where the cpu - /// type, the vendor and the OS are encoded into a string. - /// - /// @param[out] target_triple - /// The string value of the target triple. + /// Get the ArchSpec for this object file. /// /// @return - /// \b True if the target triple was able to be computed, \b - /// false otherwise. + /// The ArchSpec of this object file. In case of error, an invalid + /// ArchSpec object is returned. //------------------------------------------------------------------ - virtual bool GetArchitecture(ArchSpec &arch) = 0; + virtual ArchSpec GetArchitecture() = 0; //------------------------------------------------------------------ /// Gets the section list for the currently selected architecture (and @@ -551,18 +545,16 @@ public: virtual lldb_private::Address GetEntryPointAddress() { return Address(); } //------------------------------------------------------------------ - /// Returns the address that represents the header of this object file. + /// Returns base address of this object file. /// - /// The header address is defined as where the header for the object file is - /// that describes the content of the file. If the header doesn't appear in - /// a section that is defined in the object file, an address with no section - /// is returned that has the file offset set in the m_file_offset member of - /// the lldb_private::Address object. - /// - /// @return - /// Returns the entry address for this module. + /// This also sometimes referred to as the "preferred load address" or the + /// "image base address". Addresses within object files are often expressed + /// relative to this base. If this address corresponds to a specific section + /// (usually the first byte of the first section) then the returned address + /// will have this section set. Otherwise, the address will just have the + /// offset member filled in, indicating that this represents a file address. //------------------------------------------------------------------ - virtual lldb_private::Address GetHeaderAddress() { + virtual lldb_private::Address GetBaseAddress() { return Address(m_memory_addr); } @@ -817,4 +809,16 @@ private: } // namespace lldb_private +namespace llvm { +template <> struct format_provider<lldb_private::ObjectFile::Type> { + static void format(const lldb_private::ObjectFile::Type &type, + raw_ostream &OS, StringRef Style); +}; + +template <> struct format_provider<lldb_private::ObjectFile::Strata> { + static void format(const lldb_private::ObjectFile::Strata &strata, + raw_ostream &OS, StringRef Style); +}; +} // namespace llvm + #endif // liblldb_ObjectFile_h_ |
