diff options
Diffstat (limited to 'lldb/source/Plugins/DynamicLoader/POSIX-DYLD/AuxVector.h')
-rw-r--r-- | lldb/source/Plugins/DynamicLoader/POSIX-DYLD/AuxVector.h | 129 |
1 files changed, 62 insertions, 67 deletions
diff --git a/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/AuxVector.h b/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/AuxVector.h index 2d39eddcacc..9c3e1b002a2 100644 --- a/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/AuxVector.h +++ b/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/AuxVector.h @@ -19,7 +19,7 @@ namespace lldb_private { class DataExtractor; -} +} /// @class AuxVector /// @brief Represents a processes auxiliary vector. @@ -31,85 +31,80 @@ class DataExtractor; class AuxVector { public: - AuxVector(lldb_private::Process *process); - - struct Entry { - uint64_t type; - uint64_t value; - - Entry() : type(0), value(0) { } - }; - - /// Constants describing the type of entry. - /// On Linux, running "LD_SHOW_AUXV=1 ./executable" will spew AUX information. - enum EntryType { - AT_NULL = 0, ///< End of auxv. - AT_IGNORE = 1, ///< Ignore entry. - AT_EXECFD = 2, ///< File descriptor of program. - AT_PHDR = 3, ///< Program headers. - AT_PHENT = 4, ///< Size of program header. - AT_PHNUM = 5, ///< Number of program headers. - AT_PAGESZ = 6, ///< Page size. - AT_BASE = 7, ///< Interpreter base address. - AT_FLAGS = 8, ///< Flags. - AT_ENTRY = 9, ///< Program entry point. - AT_NOTELF = 10, ///< Set if program is not an ELF. - AT_UID = 11, ///< UID. - AT_EUID = 12, ///< Effective UID. - AT_GID = 13, ///< GID. - AT_EGID = 14, ///< Effective GID. - AT_CLKTCK = 17, ///< Clock frequency (e.g. times(2)). - AT_PLATFORM = 15, ///< String identifying platform. - AT_HWCAP = 16, ///< Machine dependent hints about processor capabilities. - AT_FPUCW = 18, ///< Used FPU control word. - AT_DCACHEBSIZE = 19, ///< Data cache block size. - AT_ICACHEBSIZE = 20, ///< Instruction cache block size. - AT_UCACHEBSIZE = 21, ///< Unified cache block size. - AT_IGNOREPPC = 22, ///< Entry should be ignored. - AT_SECURE = 23, ///< Boolean, was exec setuid-like? - AT_BASE_PLATFORM = 24, ///< String identifying real platforms. - AT_RANDOM = 25, ///< Address of 16 random bytes. - AT_EXECFN = 31, ///< Filename of executable. - AT_SYSINFO = 32, ///< Pointer to the global system page used for system calls and other nice things. - AT_SYSINFO_EHDR = 33, - AT_L1I_CACHESHAPE = 34, ///< Shapes of the caches. - AT_L1D_CACHESHAPE = 35, - AT_L2_CACHESHAPE = 36, - AT_L3_CACHESHAPE = 37, - }; + AuxVector(lldb_private::Process *process); + + struct Entry { + uint64_t type; + uint64_t value; + + Entry() : type(0), value(0) {} + }; + + /// Constants describing the type of entry. + /// On Linux, running "LD_SHOW_AUXV=1 ./executable" will spew AUX information. + enum EntryType { + AT_NULL = 0, ///< End of auxv. + AT_IGNORE = 1, ///< Ignore entry. + AT_EXECFD = 2, ///< File descriptor of program. + AT_PHDR = 3, ///< Program headers. + AT_PHENT = 4, ///< Size of program header. + AT_PHNUM = 5, ///< Number of program headers. + AT_PAGESZ = 6, ///< Page size. + AT_BASE = 7, ///< Interpreter base address. + AT_FLAGS = 8, ///< Flags. + AT_ENTRY = 9, ///< Program entry point. + AT_NOTELF = 10, ///< Set if program is not an ELF. + AT_UID = 11, ///< UID. + AT_EUID = 12, ///< Effective UID. + AT_GID = 13, ///< GID. + AT_EGID = 14, ///< Effective GID. + AT_CLKTCK = 17, ///< Clock frequency (e.g. times(2)). + AT_PLATFORM = 15, ///< String identifying platform. + AT_HWCAP = 16, ///< Machine dependent hints about processor capabilities. + AT_FPUCW = 18, ///< Used FPU control word. + AT_DCACHEBSIZE = 19, ///< Data cache block size. + AT_ICACHEBSIZE = 20, ///< Instruction cache block size. + AT_UCACHEBSIZE = 21, ///< Unified cache block size. + AT_IGNOREPPC = 22, ///< Entry should be ignored. + AT_SECURE = 23, ///< Boolean, was exec setuid-like? + AT_BASE_PLATFORM = 24, ///< String identifying real platforms. + AT_RANDOM = 25, ///< Address of 16 random bytes. + AT_EXECFN = 31, ///< Filename of executable. + AT_SYSINFO = 32, ///< Pointer to the global system page used for system + ///calls and other nice things. + AT_SYSINFO_EHDR = 33, + AT_L1I_CACHESHAPE = 34, ///< Shapes of the caches. + AT_L1D_CACHESHAPE = 35, + AT_L2_CACHESHAPE = 36, + AT_L3_CACHESHAPE = 37, + }; private: - typedef std::vector<Entry> EntryVector; + typedef std::vector<Entry> EntryVector; public: - typedef EntryVector::const_iterator iterator; + typedef EntryVector::const_iterator iterator; - iterator begin() const { return m_auxv.begin(); } - iterator end() const { return m_auxv.end(); } + iterator begin() const { return m_auxv.begin(); } + iterator end() const { return m_auxv.end(); } - iterator - FindEntry(EntryType type) const; + iterator FindEntry(EntryType type) const; - static const char * - GetEntryName(const Entry &entry) { - return GetEntryName(static_cast<EntryType>(entry.type)); - } + static const char *GetEntryName(const Entry &entry) { + return GetEntryName(static_cast<EntryType>(entry.type)); + } - static const char * - GetEntryName(EntryType type); + static const char *GetEntryName(EntryType type); - void - DumpToLog(lldb_private::Log *log) const; + void DumpToLog(lldb_private::Log *log) const; private: - lldb_private::Process *m_process; - EntryVector m_auxv; + lldb_private::Process *m_process; + EntryVector m_auxv; - lldb::DataBufferSP - GetAuxvData(); + lldb::DataBufferSP GetAuxvData(); - void - ParseAuxv(lldb_private::DataExtractor &data); + void ParseAuxv(lldb_private::DataExtractor &data); }; #endif |