LLDB mainline
NativeProcessELF.h
Go to the documentation of this file.
1//===-- NativeProcessELF.h ------------------------------------ -*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
9#ifndef liblldb_NativeProcessELF_H_
10#define liblldb_NativeProcessELF_H_
11
16#include "llvm/BinaryFormat/ELF.h"
17#include <optional>
18
19namespace lldb_private {
20
21/// \class NativeProcessELF
22/// Abstract class that extends \a NativeProcessProtocol with ELF specific
23/// logic. Meant to be subclassed by ELF based NativeProcess* implementations.
26
27public:
28 std::optional<uint64_t> GetAuxValue(enum AuxVector::EntryType type);
29 void DoStopIDBumped(uint32_t newBumpId) override;
30
31protected:
32 template <typename T> struct ELFLinkMap {
38 };
39
41
42 template <typename ELF_EHDR, typename ELF_PHDR, typename ELF_DYN>
44
45 llvm::Expected<std::vector<SVR4LibraryInfo>>
46 GetLoadedSVR4Libraries() override;
47
48 template <typename T>
49 llvm::Expected<SVR4LibraryInfo>
50 ReadSVR4LibraryInfo(lldb::addr_t link_map_addr);
51
52 void NotifyDidExec() override;
53
54 std::unique_ptr<AuxVector> m_aux_vector;
55 std::optional<lldb::addr_t> m_shared_library_info_addr;
56 std::vector<std::pair<MemoryRegionInfo, FileSpec>> m_mem_region_cache;
57};
58
59// Explicitly declare the two 32/64 bit templates that NativeProcessELF.cpp will
60// define. This allows us to keep the template definition here and usable
61// elsewhere.
63 llvm::ELF::Elf32_Ehdr, llvm::ELF::Elf32_Phdr, llvm::ELF::Elf32_Dyn>();
65 llvm::ELF::Elf64_Ehdr, llvm::ELF::Elf64_Phdr, llvm::ELF::Elf64_Dyn>();
66
67} // namespace lldb_private
68
69#endif
EntryType
Constants describing the type of entry.
Definition AuxVector.h:26
Abstract class that extends NativeProcessProtocol with ELF specific logic.
std::vector< std::pair< MemoryRegionInfo, FileSpec > > m_mem_region_cache
llvm::Expected< SVR4LibraryInfo > ReadSVR4LibraryInfo(lldb::addr_t link_map_addr)
std::unique_ptr< AuxVector > m_aux_vector
NativeProcessProtocol(lldb::pid_t pid, int terminal_fd, NativeDelegate &delegate)
llvm::Expected< std::vector< SVR4LibraryInfo > > GetLoadedSVR4Libraries() override
lldb::addr_t GetSharedLibraryInfoAddress() override
std::optional< uint64_t > GetAuxValue(enum AuxVector::EntryType type)
void DoStopIDBumped(uint32_t newBumpId) override
void NotifyDidExec() override
Notify the delegate that an exec occurred.
std::optional< lldb::addr_t > m_shared_library_info_addr
NativeProcessProtocol(lldb::pid_t pid, int terminal_fd, NativeDelegate &delegate)
A class that represents a running process on the host machine.
uint64_t addr_t
Definition lldb-types.h:80