Coverage Report

Created: 2022-01-22 13:19

/Users/buildslave/jenkins/workspace/coverage/llvm-project/lldb/source/Plugins/Platform/QemuUser/PlatformQemuUser.h
Line
Count
Source (jump to first uncovered line)
1
//===-- PlatformQemuUser.h ------------------------------------------------===//
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 "lldb/Host/Host.h"
10
#include "lldb/Host/HostInfo.h"
11
#include "lldb/Target/Platform.h"
12
13
namespace lldb_private {
14
15
class PlatformQemuUser : public Platform {
16
public:
17
  static void Initialize();
18
  static void Terminate();
19
20
12.8k
  static llvm::StringRef GetPluginNameStatic() { return "qemu-user"; }
21
  static llvm::StringRef GetPluginDescriptionStatic();
22
23
42
  llvm::StringRef GetPluginName() override { return GetPluginNameStatic(); }
24
0
  llvm::StringRef GetDescription() override {
25
0
    return GetPluginDescriptionStatic();
26
0
  }
27
28
0
  UserIDResolver &GetUserIDResolver() override {
29
0
    return HostInfo::GetUserIDResolver();
30
0
  }
31
32
  std::vector<ArchSpec> GetSupportedArchitectures() override;
33
34
  lldb::ProcessSP DebugProcess(ProcessLaunchInfo &launch_info,
35
                               Debugger &debugger, Target &target,
36
                               Status &error) override;
37
38
  lldb::ProcessSP Attach(ProcessAttachInfo &attach_info, Debugger &debugger,
39
0
                         Target *target, Status &status) override {
40
0
    status.SetErrorString("Not supported");
41
0
    return nullptr;
42
0
  }
43
44
4
  bool IsConnected() const override { return true; }
45
46
0
  void CalculateTrapHandlerSymbolNames() override {}
47
48
  Environment GetEnvironment() override;
49
50
  MmapArgList GetMmapArgumentList(const ArchSpec &arch, lldb::addr_t addr,
51
                                  lldb::addr_t length, unsigned prot,
52
                                  unsigned flags, lldb::addr_t fd,
53
0
                                  lldb::addr_t offset) override {
54
0
    return Platform::GetHostPlatform()->GetMmapArgumentList(
55
0
        arch, addr, length, prot, flags, fd, offset);
56
0
  }
57
58
private:
59
  static lldb::PlatformSP CreateInstance(bool force, const ArchSpec *arch);
60
  static void DebuggerInitialize(Debugger &debugger);
61
62
9
  PlatformQemuUser() : Platform(/*is_host=*/false) {}
63
};
64
65
} // namespace lldb_private