Coverage Report

Created: 2023-09-21 18:56

/Users/buildslave/jenkins/workspace/coverage/llvm-project/lldb/include/lldb/Interpreter/ScriptedProcessInterface.h
Line
Count
Source (jump to first uncovered line)
1
//===-- ScriptedProcessInterface.h ------------------------------*- 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
#ifndef LLDB_INTERPRETER_SCRIPTEDPROCESSINTERFACE_H
10
#define LLDB_INTERPRETER_SCRIPTEDPROCESSINTERFACE_H
11
12
#include "lldb/Core/StructuredDataImpl.h"
13
#include "lldb/Interpreter/ScriptedInterface.h"
14
#include "lldb/Target/MemoryRegionInfo.h"
15
16
#include "lldb/lldb-private.h"
17
18
#include <optional>
19
#include <string>
20
21
namespace lldb_private {
22
class ScriptedProcessInterface : virtual public ScriptedInterface {
23
public:
24
  StructuredData::GenericSP
25
  CreatePluginObject(llvm::StringRef class_name, ExecutionContext &exe_ctx,
26
                     StructuredData::DictionarySP args_sp,
27
0
                     StructuredData::Generic *script_obj = nullptr) override {
28
0
    return {};
29
0
  }
30
31
0
  virtual StructuredData::DictionarySP GetCapabilities() { return {}; }
32
33
0
  virtual Status Attach(const ProcessAttachInfo &attach_info) {
34
0
    return Status("ScriptedProcess did not attach");
35
0
  }
36
37
0
  virtual Status Launch() { return Status("ScriptedProcess did not launch"); }
38
39
0
  virtual Status Resume() { return Status("ScriptedProcess did not resume"); }
40
41
  virtual std::optional<MemoryRegionInfo>
42
0
  GetMemoryRegionContainingAddress(lldb::addr_t address, Status &error) {
43
0
    error.SetErrorString("ScriptedProcess have no memory region.");
44
0
    return {};
45
0
  }
46
47
0
  virtual StructuredData::DictionarySP GetThreadsInfo() { return {}; }
48
49
0
  virtual bool CreateBreakpoint(lldb::addr_t addr, Status &error) {
50
0
    error.SetErrorString("ScriptedProcess don't support creating breakpoints.");
51
0
    return {};
52
0
  }
53
54
  virtual lldb::DataExtractorSP
55
0
  ReadMemoryAtAddress(lldb::addr_t address, size_t size, Status &error) {
56
0
    return {};
57
0
  }
58
59
  virtual lldb::offset_t WriteMemoryAtAddress(lldb::addr_t addr,
60
                                              lldb::DataExtractorSP data_sp,
61
0
                                              Status &error) {
62
0
    return LLDB_INVALID_OFFSET;
63
0
  };
64
65
0
  virtual StructuredData::ArraySP GetLoadedImages() { return {}; }
66
67
0
  virtual lldb::pid_t GetProcessID() { return LLDB_INVALID_PROCESS_ID; }
68
69
0
  virtual bool IsAlive() { return true; }
70
71
0
  virtual std::optional<std::string> GetScriptedThreadPluginName() {
72
0
    return std::nullopt;
73
0
  }
74
75
0
  virtual StructuredData::DictionarySP GetMetadata() { return {}; }
76
77
protected:
78
  friend class ScriptedThread;
79
0
  virtual lldb::ScriptedThreadInterfaceSP CreateScriptedThreadInterface() {
80
0
    return {};
81
0
  }
82
};
83
84
class ScriptedThreadInterface : virtual public ScriptedInterface {
85
public:
86
  StructuredData::GenericSP
87
  CreatePluginObject(llvm::StringRef class_name, ExecutionContext &exe_ctx,
88
                     StructuredData::DictionarySP args_sp,
89
0
                     StructuredData::Generic *script_obj = nullptr) override {
90
0
    return {};
91
0
  }
92
93
0
  virtual lldb::tid_t GetThreadID() { return LLDB_INVALID_THREAD_ID; }
Unexecuted instantiation: lldb_private::ScriptedThreadInterface::GetThreadID()
Unexecuted instantiation: lldb_private::ScriptedThreadInterface::GetThreadID()
94
95
0
  virtual std::optional<std::string> GetName() { return std::nullopt; }
96
97
0
  virtual lldb::StateType GetState() { return lldb::eStateInvalid; }
98
99
0
  virtual std::optional<std::string> GetQueue() { return std::nullopt; }
100
101
0
  virtual StructuredData::DictionarySP GetStopReason() { return {}; }
102
103
0
  virtual StructuredData::ArraySP GetStackFrames() { return {}; }
104
105
0
  virtual StructuredData::DictionarySP GetRegisterInfo() { return {}; }
106
107
0
  virtual std::optional<std::string> GetRegisterContext() {
108
0
    return std::nullopt;
109
0
  }
110
111
0
  virtual StructuredData::ArraySP GetExtendedInfo() { return {}; }
112
};
113
} // namespace lldb_private
114
115
#endif // LLDB_INTERPRETER_SCRIPTEDPROCESSINTERFACE_H