[mlir][int-range] Limit xor int range inference to i1 (#116968)
[llvm-project.git] / lldb / source / Symbol / SymbolLocator.cpp
blob93a5bc428b61406b9ec2e68279d7cf399670f86a
1 //===-- symbolLocator.cpp -------------------------------------------------===//
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 //===----------------------------------------------------------------------===//
9 #include "lldb/Symbol/SymbolLocator.h"
11 #include "lldb/Core/Debugger.h"
12 #include "lldb/Core/PluginManager.h"
13 #include "lldb/Host/Host.h"
15 #include "llvm/ADT/SmallSet.h"
16 #include "llvm/Support/ThreadPool.h"
18 using namespace lldb;
19 using namespace lldb_private;
21 void SymbolLocator::DownloadSymbolFileAsync(const UUID &uuid) {
22 static llvm::SmallSet<UUID, 8> g_seen_uuids;
23 static std::mutex g_mutex;
25 auto lookup = [=]() {
27 std::lock_guard<std::mutex> guard(g_mutex);
28 if (g_seen_uuids.count(uuid))
29 return;
30 g_seen_uuids.insert(uuid);
33 Status error;
34 ModuleSpec module_spec;
35 module_spec.GetUUID() = uuid;
36 if (!PluginManager::DownloadObjectAndSymbolFile(module_spec, error,
37 /*force_lookup=*/true,
38 /*copy_executable=*/true))
39 return;
41 if (error.Fail())
42 return;
44 Debugger::ReportSymbolChange(module_spec);
47 switch (ModuleList::GetGlobalModuleListProperties().GetSymbolAutoDownload()) {
48 case eSymbolDownloadOff:
49 break;
50 case eSymbolDownloadBackground:
51 Debugger::GetThreadPool().async(lookup);
52 break;
53 case eSymbolDownloadForeground:
54 lookup();
55 break;