diff options
author | Ed Maste <emaste@freebsd.org> | 2013-12-02 17:49:13 +0000 |
---|---|---|
committer | Ed Maste <emaste@freebsd.org> | 2013-12-02 17:49:13 +0000 |
commit | c113ff8cba7ca03c5ed0639dd1e08b528b5bb819 (patch) | |
tree | 271c2dfc3f1a3d804eae307576f128c669686810 /lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.h | |
parent | c16006fb819c4d326b2f505323456ba37be46a53 (diff) | |
download | bcm5719-llvm-c113ff8cba7ca03c5ed0639dd1e08b528b5bb819.tar.gz bcm5719-llvm-c113ff8cba7ca03c5ed0639dd1e08b528b5bb819.zip |
elf: Move elf note parsing to ObjectFileELF.cpp
Separate ELF note implementations were introduced for core files and
GNU build-id. Move the more general one from elf-core to ObjectFileELF
and use it for build-id as well.
Review: http://llvm-reviews.chandlerc.com/D1902
llvm-svn: 196125
Diffstat (limited to 'lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.h')
-rw-r--r-- | lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.h | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.h b/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.h index ede886fb4f6..a2ab9b8f370 100644 --- a/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.h +++ b/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.h @@ -20,6 +20,34 @@ #include "ELFHeader.h" +struct ELFNote +{ + elf::elf_word n_namesz; + elf::elf_word n_descsz; + elf::elf_word n_type; + + std::string n_name; + + ELFNote() : n_namesz(0), n_descsz(0), n_type(0) + { + } + + /// Parse an ELFNote entry from the given DataExtractor starting at position + /// \p offset. + /// + /// @param[in] data + /// The DataExtractor to read from. + /// + /// @param[in,out] offset + /// Pointer to an offset in the data. On return the offset will be + /// advanced by the number of bytes read. + /// + /// @return + /// True if the ELFRel entry was successfully read and false otherwise. + bool + Parse(const lldb_private::DataExtractor &data, lldb::offset_t *offset); +}; + //------------------------------------------------------------------------------ /// @class ObjectFileELF /// @brief Generic ELF object file reader. |