1 //===-- LocateSymbolFile.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_SYMBOL_LOCATESYMBOLFILE_H
10 #define LLDB_SYMBOL_LOCATESYMBOLFILE_H
11 
12 #include <cstdint>
13 
14 #include "lldb/Core/FileSpecList.h"
15 #include "lldb/Utility/FileSpec.h"
16 #include "lldb/Utility/Status.h"
17 
18 namespace lldb_private {
19 
20 class ArchSpec;
21 class ModuleSpec;
22 class UUID;
23 
24 class Symbols {
25 public:
26   // Locate the executable file given a module specification.
27   //
28   // Locating the file should happen only on the local computer or using the
29   // current computers global settings.
30   static ModuleSpec LocateExecutableObjectFile(const ModuleSpec &module_spec);
31 
32   // Locate the symbol file given a module specification.
33   //
34   // Locating the file should happen only on the local computer or using the
35   // current computers global settings.
36   static FileSpec
37   LocateExecutableSymbolFile(const ModuleSpec &module_spec,
38                              const FileSpecList &default_search_paths);
39 
40   static FileSpec FindSymbolFileInBundle(const FileSpec &dsym_bundle_fspec,
41                                          const lldb_private::UUID *uuid,
42                                          const ArchSpec *arch);
43 
44   // Locate the object and symbol file given a module specification.
45   //
46   // Locating the file can try to download the file from a corporate build
47   // repository, or using any other means necessary to locate both the
48   // unstripped object file and the debug symbols. The force_lookup argument
49   // controls whether the external program is called unconditionally to find
50   // the symbol file, or if the user's settings are checked to see if they've
51   // enabled the external program before calling.
52   //
53   static bool DownloadObjectAndSymbolFile(ModuleSpec &module_spec,
54                                           Status &error,
55                                           bool force_lookup = true);
56 };
57 
58 } // namespace lldb_private
59 
60 #endif // LLDB_SYMBOL_LOCATESYMBOLFILE_H
61