1 //===-- SymbolsTest.cpp ---------------------------------------------------===//
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 #include "gtest/gtest.h"
11 #include "TestingSupport/SubsystemRAII.h"
12 #include "lldb/Core/ModuleSpec.h"
13 #include "lldb/Host/FileSystem.h"
14 #include "lldb/Host/HostInfo.h"
15 #include "lldb/Symbol/LocateSymbolFile.h"
16 #include "lldb/Target/Target.h"
18 using namespace lldb_private
;
21 class SymbolsTest
: public ::testing::Test
{
23 SubsystemRAII
<FileSystem
, HostInfo
> subsystems
;
29 TerminateLocateExecutableSymbolFileForUnknownExecutableAndUnknownSymbolFile
) {
30 ModuleSpec module_spec
;
31 FileSpecList search_paths
= Target::GetDefaultDebugFileSearchPaths();
32 FileSpec symbol_file_spec
=
33 Symbols::LocateExecutableSymbolFile(module_spec
, search_paths
);
34 EXPECT_TRUE(symbol_file_spec
.GetFilename().IsEmpty());
38 LocateExecutableSymbolFileForUnknownExecutableAndMissingSymbolFile
) {
39 ModuleSpec module_spec
;
40 // using a GUID here because the symbol file shouldn't actually exist on disk
41 module_spec
.GetSymbolFileSpec().SetFile(
42 "4A524676-B24B-4F4E-968A-551D465EBAF1.so", FileSpec::Style::native
);
43 FileSpecList search_paths
= Target::GetDefaultDebugFileSearchPaths();
44 FileSpec symbol_file_spec
=
45 Symbols::LocateExecutableSymbolFile(module_spec
, search_paths
);
46 EXPECT_TRUE(symbol_file_spec
.GetFilename().IsEmpty());