1 //===-- SymbolVendor.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_SymbolVendor_h_
10 #define liblldb_SymbolVendor_h_
11 
12 #include <vector>
13 
14 #include "lldb/Core/ModuleChild.h"
15 #include "lldb/Core/PluginInterface.h"
16 #include "lldb/Symbol/SourceModule.h"
17 #include "lldb/Symbol/TypeMap.h"
18 #include "lldb/lldb-private.h"
19 #include "llvm/ADT/DenseSet.h"
20 
21 namespace lldb_private {
22 
23 // The symbol vendor class is designed to abstract the process of searching for
24 // debug information for a given module. Platforms can subclass this class and
25 // provide extra ways to find debug information. Examples would be a subclass
26 // that would allow for locating a stand alone debug file, parsing debug maps,
27 // or runtime data in the object files. A symbol vendor can use multiple
28 // sources (SymbolFile objects) to provide the information and only parse as
29 // deep as needed in order to provide the information that is requested.
30 class SymbolVendor : public ModuleChild, public PluginInterface {
31 public:
32   static SymbolVendor *FindPlugin(const lldb::ModuleSP &module_sp,
33                                   Stream *feedback_strm);
34 
35   // Constructors and Destructors
36   SymbolVendor(const lldb::ModuleSP &module_sp);
37 
38   ~SymbolVendor() override;
39 
40   void AddSymbolFileRepresentation(const lldb::ObjectFileSP &objfile_sp);
41 
42   SymbolFile *GetSymbolFile() { return m_sym_file_up.get(); }
43 
44   // PluginInterface protocol
45   ConstString GetPluginName() override;
46 
47   uint32_t GetPluginVersion() override;
48 
49 protected:
50   std::unique_ptr<SymbolFile> m_sym_file_up; // A single symbol file. Subclasses
51                                              // can add more of these if needed.
52 
53 private:
54   // For SymbolVendor only
55   DISALLOW_COPY_AND_ASSIGN(SymbolVendor);
56 };
57 
58 } // namespace lldb_private
59 
60 #endif // liblldb_SymbolVendor_h_
61