Skip to content

Commit 745e8bf

Browse files
authored
[lldb] Remove LocateSymbolFile (#71301)
This completes the conversion of LocateSymbolFile into a SymbolLocator plugin. The only remaining function is DownloadSymbolFileAsync which doesn't really fit into the plugin model, and therefore moves into the SymbolLocator class, while still relying on the plugins to do the underlying work.
1 parent b26b1ce commit 745e8bf

File tree

23 files changed

+14
-40
lines changed

23 files changed

+14
-40
lines changed

lldb/include/lldb/Symbol/SymbolLocator.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,20 @@
1010
#define LLDB_SYMBOL_SYMBOLLOCATOR_H
1111

1212
#include "lldb/Core/PluginInterface.h"
13+
#include "lldb/Utility/UUID.h"
1314

1415
namespace lldb_private {
1516

1617
class SymbolLocator : public PluginInterface {
1718
public:
1819
SymbolLocator() = default;
20+
21+
/// Locate the symbol file for the given UUID on a background thread. This
22+
/// function returns immediately. Under the hood it uses the debugger's
23+
/// thread pool to call DownloadObjectAndSymbolFile. If a symbol file is
24+
/// found, this will notify all target which contain the module with the
25+
/// given UUID.
26+
static void DownloadSymbolFileAsync(const UUID &uuid);
1927
};
2028

2129
} // namespace lldb_private

lldb/source/API/SBTarget.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
//===----------------------------------------------------------------------===//
88

99
#include "lldb/API/SBTarget.h"
10-
#include "lldb/Symbol/LocateSymbolFile.h"
1110
#include "lldb/Utility/Instrumentation.h"
1211
#include "lldb/Utility/LLDBLog.h"
1312
#include "lldb/lldb-public.h"

lldb/source/Commands/CommandObjectTarget.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636
#include "lldb/Symbol/CompileUnit.h"
3737
#include "lldb/Symbol/FuncUnwinders.h"
3838
#include "lldb/Symbol/LineTable.h"
39-
#include "lldb/Symbol/LocateSymbolFile.h"
4039
#include "lldb/Symbol/ObjectFile.h"
4140
#include "lldb/Symbol/SymbolFile.h"
4241
#include "lldb/Symbol/UnwindPlan.h"

lldb/source/Core/DynamicLoader.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
#include "lldb/Core/ModuleSpec.h"
1515
#include "lldb/Core/PluginManager.h"
1616
#include "lldb/Core/Section.h"
17-
#include "lldb/Symbol/LocateSymbolFile.h"
1817
#include "lldb/Symbol/ObjectFile.h"
1918
#include "lldb/Target/MemoryRegionInfo.h"
2019
#include "lldb/Target/Platform.h"

lldb/source/Core/Module.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@
2323
#include "lldb/Interpreter/ScriptInterpreter.h"
2424
#include "lldb/Symbol/CompileUnit.h"
2525
#include "lldb/Symbol/Function.h"
26-
#include "lldb/Symbol/LocateSymbolFile.h"
2726
#include "lldb/Symbol/ObjectFile.h"
2827
#include "lldb/Symbol/Symbol.h"
2928
#include "lldb/Symbol/SymbolContext.h"
3029
#include "lldb/Symbol/SymbolFile.h"
30+
#include "lldb/Symbol/SymbolLocator.h"
3131
#include "lldb/Symbol/SymbolVendor.h"
3232
#include "lldb/Symbol/Symtab.h"
3333
#include "lldb/Symbol/Type.h"
@@ -1314,7 +1314,7 @@ UnwindTable &Module::GetUnwindTable() {
13141314
if (!m_unwind_table) {
13151315
m_unwind_table.emplace(*this);
13161316
if (!m_symfile_spec)
1317-
Symbols::DownloadSymbolFileAsync(GetUUID());
1317+
SymbolLocator::DownloadSymbolFileAsync(GetUUID());
13181318
}
13191319
return *m_unwind_table;
13201320
}

lldb/source/Core/ModuleList.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
#include "lldb/Interpreter/OptionValueFileSpecList.h"
1616
#include "lldb/Interpreter/OptionValueProperties.h"
1717
#include "lldb/Interpreter/Property.h"
18-
#include "lldb/Symbol/LocateSymbolFile.h"
1918
#include "lldb/Symbol/ObjectFile.h"
2019
#include "lldb/Symbol/SymbolContext.h"
2120
#include "lldb/Symbol/TypeList.h"

lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
#include "lldb/Core/PluginManager.h"
1616
#include "lldb/Core/Section.h"
1717
#include "lldb/Interpreter/OptionValueProperties.h"
18-
#include "lldb/Symbol/LocateSymbolFile.h"
1918
#include "lldb/Symbol/ObjectFile.h"
2019
#include "lldb/Target/OperatingSystem.h"
2120
#include "lldb/Target/RegisterContext.h"

lldb/source/Plugins/DynamicLoader/FreeBSD-Kernel/DynamicLoaderFreeBSDKernel.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
#include "lldb/Core/Section.h"
1616
#include "lldb/Host/StreamFile.h"
1717
#include "lldb/Interpreter/OptionValueProperties.h"
18-
#include "lldb/Symbol/LocateSymbolFile.h"
1918
#include "lldb/Symbol/ObjectFile.h"
2019
#include "lldb/Target/OperatingSystem.h"
2120
#include "lldb/Target/RegisterContext.h"

lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
#include "lldb/Core/Section.h"
2222
#include "lldb/Host/Host.h"
2323
#include "lldb/Symbol/DWARFCallFrameInfo.h"
24-
#include "lldb/Symbol/LocateSymbolFile.h"
2524
#include "lldb/Symbol/ObjectFile.h"
2625
#include "lldb/Target/DynamicLoader.h"
2726
#include "lldb/Target/MemoryRegionInfo.h"

lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
#include "lldb/Interpreter/OptionValueProperties.h"
3030
#include "lldb/Interpreter/OptionValueString.h"
3131
#include "lldb/Interpreter/Options.h"
32-
#include "lldb/Symbol/LocateSymbolFile.h"
3332
#include "lldb/Symbol/ObjectFile.h"
3433
#include "lldb/Symbol/SymbolFile.h"
3534
#include "lldb/Symbol/SymbolVendor.h"

lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
#include "lldb/Interpreter/OptionGroupString.h"
2828
#include "lldb/Interpreter/OptionGroupUInt64.h"
2929
#include "lldb/Interpreter/OptionValueProperties.h"
30-
#include "lldb/Symbol/LocateSymbolFile.h"
3130
#include "lldb/Symbol/ObjectFile.h"
3231
#include "lldb/Target/RegisterContext.h"
3332
#include "lldb/Target/Target.h"

lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@
4848
#include "lldb/Interpreter/OptionValueProperties.h"
4949
#include "lldb/Interpreter/Options.h"
5050
#include "lldb/Interpreter/Property.h"
51-
#include "lldb/Symbol/LocateSymbolFile.h"
5251
#include "lldb/Symbol/ObjectFile.h"
5352
#include "lldb/Target/ABI.h"
5453
#include "lldb/Target/DynamicLoader.h"

lldb/source/Plugins/Process/mach-core/ProcessMachCore.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
#include "lldb/Core/PluginManager.h"
1919
#include "lldb/Core/Section.h"
2020
#include "lldb/Host/Host.h"
21-
#include "lldb/Symbol/LocateSymbolFile.h"
2221
#include "lldb/Symbol/ObjectFile.h"
2322
#include "lldb/Target/MemoryRegionInfo.h"
2423
#include "lldb/Target/SectionLoadList.h"

lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@
4646
#include "lldb/Symbol/CompilerDeclContext.h"
4747
#include "lldb/Symbol/DebugMacros.h"
4848
#include "lldb/Symbol/LineTable.h"
49-
#include "lldb/Symbol/LocateSymbolFile.h"
5049
#include "lldb/Symbol/ObjectFile.h"
5150
#include "lldb/Symbol/SymbolFile.h"
5251
#include "lldb/Symbol/TypeMap.h"

lldb/source/Plugins/SymbolLocator/DebugSymbols/SymbolLocatorDebugSymbols.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
#include "lldb/Host/FileSystem.h"
2020
#include "lldb/Host/Host.h"
2121
#include "lldb/Host/HostInfo.h"
22-
#include "lldb/Symbol/LocateSymbolFile.h"
2322
#include "lldb/Symbol/ObjectFile.h"
2423
#include "lldb/Target/Target.h"
2524
#include "lldb/Utility/ArchSpec.h"

lldb/source/Plugins/SymbolLocator/Default/SymbolLocatorDefault.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
#include "lldb/Core/Section.h"
2222
#include "lldb/Host/FileSystem.h"
2323
#include "lldb/Host/Host.h"
24-
#include "lldb/Symbol/LocateSymbolFile.h"
2524
#include "lldb/Symbol/ObjectFile.h"
2625
#include "lldb/Target/Target.h"
2726
#include "lldb/Utility/ArchSpec.h"

lldb/source/Plugins/SymbolVendor/ELF/SymbolVendorELF.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
#include "lldb/Core/PluginManager.h"
1717
#include "lldb/Core/Section.h"
1818
#include "lldb/Host/Host.h"
19-
#include "lldb/Symbol/LocateSymbolFile.h"
2019
#include "lldb/Symbol/ObjectFile.h"
2120
#include "lldb/Target/Target.h"
2221
#include "lldb/Utility/StreamString.h"

lldb/source/Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
#include "lldb/Core/Section.h"
1818
#include "lldb/Host/Host.h"
1919
#include "lldb/Host/XML.h"
20-
#include "lldb/Symbol/LocateSymbolFile.h"
2120
#include "lldb/Symbol/ObjectFile.h"
2221
#include "lldb/Target/Target.h"
2322
#include "lldb/Utility/StreamString.h"

lldb/source/Plugins/SymbolVendor/PECOFF/SymbolVendorPECOFF.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
#include "lldb/Core/PluginManager.h"
1717
#include "lldb/Core/Section.h"
1818
#include "lldb/Host/Host.h"
19-
#include "lldb/Symbol/LocateSymbolFile.h"
2019
#include "lldb/Symbol/ObjectFile.h"
2120
#include "lldb/Target/Target.h"
2221
#include "lldb/Utility/StreamString.h"

lldb/source/Plugins/SymbolVendor/wasm/SymbolVendorWasm.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
#include "lldb/Core/PluginManager.h"
1818
#include "lldb/Core/Section.h"
1919
#include "lldb/Host/Host.h"
20-
#include "lldb/Symbol/LocateSymbolFile.h"
2120
#include "lldb/Symbol/ObjectFile.h"
2221
#include "lldb/Target/Target.h"
2322
#include "lldb/Utility/StreamString.h"

lldb/source/Symbol/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@ add_lldb_library(lldbSymbol NO_PLUGIN_DEPENDENCIES
1313
Function.cpp
1414
LineEntry.cpp
1515
LineTable.cpp
16-
LocateSymbolFile.cpp
1716
ObjectContainer.cpp
1817
ObjectFile.cpp
1918
PostfixExpression.cpp
2019
Symbol.cpp
2120
SymbolContext.cpp
2221
SymbolFile.cpp
2322
SymbolFileOnDemand.cpp
23+
SymbolLocator.cpp
2424
SymbolVendor.cpp
2525
Symtab.cpp
2626
Type.cpp

lldb/source/Symbol/LocateSymbolFile.cpp renamed to lldb/source/Symbol/SymbolLocator.cpp

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,23 @@
1-
//===-- LocateSymbolFile.cpp ----------------------------------------------===//
1+
//===-- symbolLocator.cpp -------------------------------------------------===//
22
//
33
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
44
// See https://llvm.org/LICENSE.txt for license information.
55
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
66
//
77
//===----------------------------------------------------------------------===//
88

9-
#include "lldb/Symbol/LocateSymbolFile.h"
9+
#include "lldb/Symbol/SymbolLocator.h"
1010

1111
#include "lldb/Core/Debugger.h"
12-
#include "lldb/Core/Module.h"
13-
#include "lldb/Core/ModuleList.h"
14-
#include "lldb/Core/ModuleSpec.h"
1512
#include "lldb/Core/PluginManager.h"
16-
#include "lldb/Core/Progress.h"
17-
#include "lldb/Host/FileSystem.h"
18-
#include "lldb/Symbol/ObjectFile.h"
19-
#include "lldb/Utility/ArchSpec.h"
20-
#include "lldb/Utility/DataBuffer.h"
21-
#include "lldb/Utility/DataExtractor.h"
22-
#include "lldb/Utility/LLDBLog.h"
23-
#include "lldb/Utility/Log.h"
24-
#include "lldb/Utility/StreamString.h"
25-
#include "lldb/Utility/Timer.h"
26-
#include "lldb/Utility/UUID.h"
2713

2814
#include "llvm/ADT/SmallSet.h"
29-
#include "llvm/Support/FileSystem.h"
3015
#include "llvm/Support/ThreadPool.h"
3116

3217
using namespace lldb;
3318
using namespace lldb_private;
3419

35-
void Symbols::DownloadSymbolFileAsync(const UUID &uuid) {
20+
void SymbolLocator::DownloadSymbolFileAsync(const UUID &uuid) {
3621
if (!ModuleList::GetGlobalModuleListProperties().GetEnableBackgroundLookup())
3722
return;
3823

lldb/unittests/Symbol/LocateSymbolFileTest.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
#include "lldb/Core/PluginManager.h"
1414
#include "lldb/Host/FileSystem.h"
1515
#include "lldb/Host/HostInfo.h"
16-
#include "lldb/Symbol/LocateSymbolFile.h"
1716
#include "lldb/Target/Target.h"
1817

1918
using namespace lldb_private;

0 commit comments

Comments
 (0)