Coverage Report

Created: 2022-01-18 06:27

/Users/buildslave/jenkins/workspace/coverage/llvm-project/lldb/tools/lldb-test/SystemInitializerTest.cpp
Line
Count
Source (jump to first uncovered line)
1
//===-- SystemInitializerTest.cpp -------------------------------*- 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
#include "SystemInitializerTest.h"
10
#include "lldb/Core/Debugger.h"
11
#include "lldb/Core/PluginManager.h"
12
#include "lldb/Host/Host.h"
13
#include "lldb/Initialization/SystemInitializerCommon.h"
14
#include "lldb/Interpreter/CommandInterpreter.h"
15
#include "lldb/Utility/Timer.h"
16
#include "llvm/Support/TargetSelect.h"
17
18
#include <string>
19
20
#define LLDB_PLUGIN(p) LLDB_PLUGIN_DECLARE(p)
21
#include "Plugins/Plugins.def"
22
23
using namespace lldb_private;
24
25
SystemInitializerTest::SystemInitializerTest()
26
91
    : SystemInitializerCommon(nullptr) {}
27
91
SystemInitializerTest::~SystemInitializerTest() = default;
28
29
91
llvm::Error SystemInitializerTest::Initialize() {
30
91
  if (auto e = SystemInitializerCommon::Initialize())
31
0
    return e;
32
33
  // Initialize LLVM and Clang
34
91
  llvm::InitializeAllTargets();
35
91
  llvm::InitializeAllAsmPrinters();
36
91
  llvm::InitializeAllTargetMCs();
37
91
  llvm::InitializeAllDisassemblers();
38
39
91
#define LLDB_SCRIPT_PLUGIN(p)
40
6.55k
#define LLDB_PLUGIN(p) LLDB_PLUGIN_INITIALIZE(p);
41
91
#include "Plugins/Plugins.def"
42
43
  // We ignored all the script interpreter earlier, so initialize
44
  // ScriptInterpreterNone explicitly.
45
91
  LLDB_PLUGIN_INITIALIZE(ScriptInterpreterNone);
46
47
  // Scan for any system or user LLDB plug-ins
48
91
  PluginManager::Initialize();
49
50
  // The process settings need to know about installed plug-ins, so the
51
  // Settings must be initialized AFTER PluginManager::Initialize is called.
52
91
  Debugger::SettingsInitialize();
53
54
91
  return llvm::Error::success();
55
91
}
56
57
91
void SystemInitializerTest::Terminate() {
58
91
  Debugger::SettingsTerminate();
59
60
  // Terminate and unload and loaded system or user LLDB plug-ins
61
91
  PluginManager::Terminate();
62
63
91
#define LLDB_SCRIPT_PLUGIN(p)
64
6.55k
#define LLDB_PLUGIN(p) LLDB_PLUGIN_TERMINATE(p);
65
91
#include "Plugins/Plugins.def"
66
67
  // We ignored all the script interpreter earlier, so terminate
68
  // ScriptInterpreterNone explicitly.
69
91
  LLDB_PLUGIN_INITIALIZE(ScriptInterpreterNone);
70
71
  // Now shutdown the common parts, in reverse order.
72
91
  SystemInitializerCommon::Terminate();
73
91
}