1 //===-- SymbolLocatorDebugSymbols.h -----------------------------*- C++ -*-===//
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
7 //===----------------------------------------------------------------------===//
9 #ifndef LLDB_SOURCE_PLUGINS_SYMBOLLOCATOR_DEBUGSYMBOLS_SYMBOLLOCATORDEBUGSYMBOLS_H
10 #define LLDB_SOURCE_PLUGINS_SYMBOLLOCATOR_DEBUGSYMBOLS_SYMBOLLOCATORDEBUGSYMBOLS_H
12 #include "lldb/Symbol/SymbolLocator.h"
13 #include "lldb/lldb-private.h"
15 namespace lldb_private
{
17 class SymbolLocatorDebugSymbols
: public SymbolLocator
{
19 SymbolLocatorDebugSymbols();
21 static void Initialize();
22 static void Terminate();
24 static llvm::StringRef
GetPluginNameStatic() { return "DebugSymbols"; }
25 static llvm::StringRef
GetPluginDescriptionStatic();
27 static lldb_private::SymbolLocator
*CreateInstance();
29 /// PluginInterface protocol.
31 llvm::StringRef
GetPluginName() override
{ return GetPluginNameStatic(); }
34 // Locate the executable file given a module specification.
36 // Locating the file should happen only on the local computer or using the
37 // current computers global settings.
38 static std::optional
<ModuleSpec
>
39 LocateExecutableObjectFile(const ModuleSpec
&module_spec
);
41 // Locate the symbol file given a module specification.
43 // Locating the file should happen only on the local computer or using the
44 // current computers global settings.
45 static std::optional
<FileSpec
>
46 LocateExecutableSymbolFile(const ModuleSpec
&module_spec
,
47 const FileSpecList
&default_search_paths
);
49 // Locate the object and symbol file given a module specification.
51 // Locating the file can try to download the file from a corporate build
52 // repository, or using any other means necessary to locate both the
53 // unstripped object file and the debug symbols. The force_lookup argument
54 // controls whether the external program is called unconditionally to find
55 // the symbol file, or if the user's settings are checked to see if they've
56 // enabled the external program before calling.
57 static bool DownloadObjectAndSymbolFile(ModuleSpec
&module_spec
,
58 Status
&error
, bool force_lookup
,
59 bool copy_executable
);
61 static std::optional
<FileSpec
>
62 FindSymbolFileInBundle(const FileSpec
&dsym_bundle_fspec
, const UUID
*uuid
,
63 const ArchSpec
*arch
);
66 } // namespace lldb_private
68 #endif // LLDB_SOURCE_PLUGINS_SYMBOLLOCATOR_DEBUGSYMBOLS_SYMBOLLOCATORDEBUGSYMBOLS_H