aboutsummaryrefslogtreecommitdiff
path: root/lldb/include/lldb/Symbol/SymbolVendor.h
blob: c9c59a3fc1be5239315c7bd1df349cefe3879e6f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
//===-- SymbolVendor.h ------------------------------------------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

#ifndef LLDB_SYMBOL_SYMBOLVENDOR_H
#define LLDB_SYMBOL_SYMBOLVENDOR_H

#include <vector>

#include "lldb/Core/ModuleChild.h"
#include "lldb/Core/PluginInterface.h"
#include "lldb/Symbol/SourceModule.h"
#include "lldb/Symbol/TypeMap.h"
#include "lldb/lldb-private.h"
#include "llvm/ADT/DenseSet.h"

namespace lldb_private {

// The symbol vendor class is designed to abstract the process of searching for
// debug information for a given module. Platforms can subclass this class and
// provide extra ways to find debug information. Examples would be a subclass
// that would allow for locating a stand alone debug file, parsing debug maps,
// or runtime data in the object files. A symbol vendor can use multiple
// sources (SymbolFile objects) to provide the information and only parse as
// deep as needed in order to provide the information that is requested.
class SymbolVendor : public ModuleChild, public PluginInterface {
public:
  static SymbolVendor *FindPlugin(const lldb::ModuleSP &module_sp,
                                  Stream *feedback_strm);

  // Constructors and Destructors
  SymbolVendor(const lldb::ModuleSP &module_sp);

  ~SymbolVendor() override;

  void AddSymbolFileRepresentation(const lldb::ObjectFileSP &objfile_sp);

  SymbolFile *GetSymbolFile() { return m_sym_file_up.get(); }

  // PluginInterface protocol
  ConstString GetPluginName() override;

  uint32_t GetPluginVersion() override;

protected:
  std::unique_ptr<SymbolFile> m_sym_file_up; // A single symbol file. Subclasses
                                             // can add more of these if needed.

private:
  // For SymbolVendor only
  SymbolVendor(const SymbolVendor &) = delete;
  const SymbolVendor &operator=(const SymbolVendor &) = delete;
};

} // namespace lldb_private

#endif // LLDB_SYMBOL_SYMBOLVENDOR_H