LLDB mainline
SymbolLocator.cpp
Go to the documentation of this file.
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//===----------------------------------------------------------------------===//
8
10
11#include "lldb/Core/Debugger.h"
13#include "lldb/Host/Host.h"
14
15#include "llvm/ADT/SmallSet.h"
16#include "llvm/Support/ThreadPool.h"
17
18using namespace lldb;
19using namespace lldb_private;
20
22 static llvm::SmallSet<UUID, 8> g_seen_uuids;
23 static std::mutex g_mutex;
24
25 auto lookup = [=]() {
26 {
27 std::lock_guard<std::mutex> guard(g_mutex);
28 if (g_seen_uuids.count(uuid))
29 return;
30 g_seen_uuids.insert(uuid);
31 }
32
34 ModuleSpec module_spec;
35 module_spec.GetUUID() = uuid;
37 /*force_lookup=*/true,
38 /*copy_executable=*/true))
39 return;
40
41 if (error.Fail())
42 return;
43
45 };
46
47 switch (ModuleList::GetGlobalModuleListProperties().GetSymbolAutoDownload()) {
49 break;
51 Debugger::GetThreadPool().async(lookup);
52 break;
54 lookup();
55 break;
56 };
57}
static llvm::raw_ostream & error(Stream &strm)
static llvm::ThreadPoolInterface & GetThreadPool()
Shared thread pool. Use only with ThreadPoolTaskGroup.
Definition: Debugger.cpp:2235
static void ReportSymbolChange(const ModuleSpec &module_spec)
Definition: Debugger.cpp:1605
static ModuleListProperties & GetGlobalModuleListProperties()
Definition: ModuleList.cpp:763
static bool DownloadObjectAndSymbolFile(ModuleSpec &module_spec, Status &error, bool force_lookup=true, bool copy_executable=true)
An error handling class.
Definition: Status.h:44
static void DownloadSymbolFileAsync(const UUID &uuid)
Locate the symbol file for the given UUID on a background thread.
A class that represents a running process on the host machine.
Definition: SBAddress.h:15
@ eSymbolDownloadBackground
@ eSymbolDownloadForeground
@ eSymbolDownloadOff