DebugServer2
Loading...
Searching...
No Matches
ELFSupport.h
1//
2// Copyright (c) 2014-present, Facebook, Inc.
3// All rights reserved.
4//
5// This source code is licensed under the University of Illinois/NCSA Open
6// Source License found in the LICENSE file in the root directory of this
7// source tree. An additional grant of patent rights can be found in the
8// PATENTS file in the same directory.
9//
10
11#pragma once
12
13#include "DebugServer2/Types.h"
14
15namespace ds2 {
16namespace Support {
17
19public:
21 uint64_t type;
22 uint64_t value;
23 };
24
25public:
26 static bool MachineTypeToCPUType(uint32_t machineType, bool is64Bit,
27 CPUType &type, CPUSubType &subType);
28 static bool GetELFFileBuildID(std::string const &path, ByteVector &buildID);
29private:
30 template <typename ELFHeader, typename SectionHeader, typename NotesHeader>
31 static bool ReadBuildID(int fd, const ELFHeader &ehdr, SectionHeader &shdr,
32 NotesHeader &nhdr, ByteVector &id);
33
34 template <typename ELFHeader, typename SectionHeader>
35 static bool ReadSectionHeader(int fd, const ELFHeader &ehdr, SectionHeader &shdr,
36 size_t idx);
37};
38} // namespace Support
39} // namespace ds2
Definition ELFSupport.h:18
Definition ELFSupport.h:20