xref: /freebsd-src/contrib/llvm-project/lldb/source/Plugins/SymbolLocator/Default/SymbolLocatorDefault.h (revision 5f757f3ff9144b609b3c433dfd370cc6bdc191ad)
1*5f757f3fSDimitry Andric //===-- SymbolLocatorDefault.h ----------------------------------*- C++ -*-===//
2*5f757f3fSDimitry Andric //
3*5f757f3fSDimitry Andric // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4*5f757f3fSDimitry Andric // See https://llvm.org/LICENSE.txt for license information.
5*5f757f3fSDimitry Andric // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6*5f757f3fSDimitry Andric //
7*5f757f3fSDimitry Andric //===----------------------------------------------------------------------===//
8*5f757f3fSDimitry Andric 
9*5f757f3fSDimitry Andric #ifndef LLDB_SOURCE_PLUGINS_SYMBOLLOCATOR_DEFAULT_SYMBOLLOCATORDEFAULT_H
10*5f757f3fSDimitry Andric #define LLDB_SOURCE_PLUGINS_SYMBOLLOCATOR_DEFAULT_SYMBOLLOCATORDEFAULT_H
11*5f757f3fSDimitry Andric 
12*5f757f3fSDimitry Andric #include "lldb/Symbol/SymbolLocator.h"
13*5f757f3fSDimitry Andric #include "lldb/lldb-private.h"
14*5f757f3fSDimitry Andric 
15*5f757f3fSDimitry Andric namespace lldb_private {
16*5f757f3fSDimitry Andric 
17*5f757f3fSDimitry Andric class SymbolLocatorDefault : public SymbolLocator {
18*5f757f3fSDimitry Andric public:
19*5f757f3fSDimitry Andric   SymbolLocatorDefault();
20*5f757f3fSDimitry Andric 
21*5f757f3fSDimitry Andric   static void Initialize();
22*5f757f3fSDimitry Andric   static void Terminate();
23*5f757f3fSDimitry Andric 
GetPluginNameStatic()24*5f757f3fSDimitry Andric   static llvm::StringRef GetPluginNameStatic() { return "Default"; }
25*5f757f3fSDimitry Andric   static llvm::StringRef GetPluginDescriptionStatic();
26*5f757f3fSDimitry Andric 
27*5f757f3fSDimitry Andric   static lldb_private::SymbolLocator *CreateInstance();
28*5f757f3fSDimitry Andric 
29*5f757f3fSDimitry Andric   /// PluginInterface protocol.
30*5f757f3fSDimitry Andric   /// \{
GetPluginName()31*5f757f3fSDimitry Andric   llvm::StringRef GetPluginName() override { return GetPluginNameStatic(); }
32*5f757f3fSDimitry Andric   /// \}
33*5f757f3fSDimitry Andric 
34*5f757f3fSDimitry Andric   // Locate the executable file given a module specification.
35*5f757f3fSDimitry Andric   //
36*5f757f3fSDimitry Andric   // Locating the file should happen only on the local computer or using the
37*5f757f3fSDimitry Andric   // current computers global settings.
38*5f757f3fSDimitry Andric   static std::optional<ModuleSpec>
39*5f757f3fSDimitry Andric   LocateExecutableObjectFile(const ModuleSpec &module_spec);
40*5f757f3fSDimitry Andric 
41*5f757f3fSDimitry Andric   // Locate the symbol file given a module specification.
42*5f757f3fSDimitry Andric   //
43*5f757f3fSDimitry Andric   // Locating the file should happen only on the local computer or using the
44*5f757f3fSDimitry Andric   // current computers global settings.
45*5f757f3fSDimitry Andric   static std::optional<FileSpec>
46*5f757f3fSDimitry Andric   LocateExecutableSymbolFile(const ModuleSpec &module_spec,
47*5f757f3fSDimitry Andric                              const FileSpecList &default_search_paths);
48*5f757f3fSDimitry Andric 
49*5f757f3fSDimitry Andric   // Locate the object and symbol file given a module specification.
50*5f757f3fSDimitry Andric   //
51*5f757f3fSDimitry Andric   // Locating the file can try to download the file from a corporate build
52*5f757f3fSDimitry Andric   // repository, or using any other means necessary to locate both the
53*5f757f3fSDimitry Andric   // unstripped object file and the debug symbols. The force_lookup argument
54*5f757f3fSDimitry Andric   // controls whether the external program is called unconditionally to find
55*5f757f3fSDimitry Andric   // the symbol file, or if the user's settings are checked to see if they've
56*5f757f3fSDimitry Andric   // enabled the external program before calling.
57*5f757f3fSDimitry Andric   static bool DownloadObjectAndSymbolFile(ModuleSpec &module_spec,
58*5f757f3fSDimitry Andric                                           Status &error, bool force_lookup,
59*5f757f3fSDimitry Andric                                           bool copy_executable);
60*5f757f3fSDimitry Andric };
61*5f757f3fSDimitry Andric 
62*5f757f3fSDimitry Andric } // namespace lldb_private
63*5f757f3fSDimitry Andric 
64*5f757f3fSDimitry Andric #endif // LLDB_SOURCE_PLUGINS_SYMBOLLOCATOR_DEFAULT_SYMBOLLOCATORDEFAULT_H
65