Coverage Report

Created: 2022-01-25 06:29

/Users/buildslave/jenkins/workspace/coverage/llvm-project/lldb/source/Plugins/ObjectFile/Breakpad/ObjectFileBreakpad.h
Line
Count
Source (jump to first uncovered line)
1
//===-- ObjectFileBreakpad.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 LLDB_SOURCE_PLUGINS_OBJECTFILE_BREAKPAD_OBJECTFILEBREAKPAD_H
10
#define LLDB_SOURCE_PLUGINS_OBJECTFILE_BREAKPAD_OBJECTFILEBREAKPAD_H
11
12
#include "lldb/Symbol/ObjectFile.h"
13
#include "lldb/Utility/ArchSpec.h"
14
15
namespace lldb_private {
16
namespace breakpad {
17
18
class ObjectFileBreakpad : public ObjectFile {
19
public:
20
  // Static Functions
21
  static void Initialize();
22
  static void Terminate();
23
24
3.44k
  static llvm::StringRef GetPluginNameStatic() { return "breakpad"; }
25
3.44k
  static const char *GetPluginDescriptionStatic() {
26
3.44k
    return "Breakpad object file reader.";
27
3.44k
  }
28
29
  static ObjectFile *
30
  CreateInstance(const lldb::ModuleSP &module_sp, lldb::DataBufferSP &data_sp,
31
                 lldb::offset_t data_offset, const FileSpec *file,
32
                 lldb::offset_t file_offset, lldb::offset_t length);
33
34
  static ObjectFile *CreateMemoryInstance(const lldb::ModuleSP &module_sp,
35
                                          lldb::DataBufferSP &data_sp,
36
                                          const lldb::ProcessSP &process_sp,
37
                                          lldb::addr_t header_addr);
38
39
  static size_t GetModuleSpecifications(const FileSpec &file,
40
                                        lldb::DataBufferSP &data_sp,
41
                                        lldb::offset_t data_offset,
42
                                        lldb::offset_t file_offset,
43
                                        lldb::offset_t length,
44
                                        ModuleSpecList &specs);
45
46
  // PluginInterface protocol
47
7
  llvm::StringRef GetPluginName() override { return GetPluginNameStatic(); }
48
49
  // LLVM RTTI support
50
  static char ID;
51
69
  bool isA(const void *ClassID) const override {
52
69
    return ClassID == &ID || 
ObjectFile::isA(ClassID)45
;
53
69
  }
54
144k
  static bool classof(const ObjectFile *obj) { return obj->isA(&ID); }
55
56
  // ObjectFile Protocol.
57
58
  bool ParseHeader() override;
59
60
0
  lldb::ByteOrder GetByteOrder() const override {
61
0
    return m_arch.GetByteOrder();
62
0
  }
63
64
7
  bool IsExecutable() const override { return false; }
65
66
0
  uint32_t GetAddressByteSize() const override {
67
0
    return m_arch.GetAddressByteSize();
68
0
  }
69
70
0
  AddressClass GetAddressClass(lldb::addr_t file_addr) override {
71
0
    return AddressClass::eInvalid;
72
0
  }
73
74
  void ParseSymtab(lldb_private::Symtab &symtab) override;
75
76
31
  bool IsStripped() override { return false; }
77
78
  void CreateSections(SectionList &unified_section_list) override;
79
80
0
  void Dump(Stream *s) override {}
81
82
92
  ArchSpec GetArchitecture() override { return m_arch; }
83
84
11
  UUID GetUUID() override { return m_uuid; }
85
86
0
  uint32_t GetDependentModules(FileSpecList &files) override { return 0; }
87
88
17
  Type CalculateType() override { return eTypeDebugInfo; }
89
90
7
  Strata CalculateStrata() override { return eStrataUser; }
91
92
private:
93
  ArchSpec m_arch;
94
  UUID m_uuid;
95
96
  ObjectFileBreakpad(const lldb::ModuleSP &module_sp,
97
                     lldb::DataBufferSP &data_sp, lldb::offset_t data_offset,
98
                     const FileSpec *file, lldb::offset_t offset,
99
                     lldb::offset_t length, ArchSpec arch, UUID uuid);
100
};
101
102
} // namespace breakpad
103
} // namespace lldb_private
104
#endif // LLDB_SOURCE_PLUGINS_OBJECTFILE_BREAKPAD_OBJECTFILEBREAKPAD_H