Coverage Report

Created: 2022-01-18 06:27

/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/ScriptInterpreter.h"
14
#include "lldb/Interpreter/ScriptedInterface.h"
15
#include "lldb/Target/MemoryRegionInfo.h"
16
17
#include "lldb/lldb-private.h"
18
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
0
                     StructuredData::DictionarySP args_sp) override {
27
0
    return nullptr;
28
0
  }
29
30
0
  virtual Status Launch() { return Status("ScriptedProcess did not launch"); }
31
32
0
  virtual Status Resume() { return Status("ScriptedProcess did not resume"); }
33
34
0
  virtual bool ShouldStop() { return true; }
35
36
0
  virtual Status Stop() { return Status("ScriptedProcess did not stop"); }
37
38
  virtual llvm::Optional<MemoryRegionInfo>
39
0
  GetMemoryRegionContainingAddress(lldb::addr_t address, Status &error) {
40
0
    error.SetErrorString("ScriptedProcess have no memory region.");
41
0
    return {};
42
0
  }
43
44
0
  virtual StructuredData::DictionarySP GetThreadWithID(lldb::tid_t tid) {
45
0
    return nullptr;
46
0
  }
47
48
0
  virtual StructuredData::DictionarySP GetRegistersForThread(lldb::tid_t tid) {
49
0
    return nullptr;
50
0
  }
51
52
  virtual lldb::DataExtractorSP
53
0
  ReadMemoryAtAddress(lldb::addr_t address, size_t size, Status &error) {
54
0
    return nullptr;
55
0
  }
56
57
0
  virtual StructuredData::DictionarySP GetLoadedImages() { return nullptr; }
58
59
0
  virtual lldb::pid_t GetProcessID() { return LLDB_INVALID_PROCESS_ID; }
Unexecuted instantiation: lldb_private::ScriptedProcessInterface::GetProcessID()
Unexecuted instantiation: lldb_private::ScriptedProcessInterface::GetProcessID()
60
61
0
  virtual bool IsAlive() { return true; }
62
63
0
  virtual llvm::Optional<std::string> GetScriptedThreadPluginName() {
64
0
    return llvm::None;
65
0
  }
66
67
protected:
68
  friend class ScriptedThread;
69
0
  virtual lldb::ScriptedThreadInterfaceSP GetScriptedThreadInterface() {
70
0
    return nullptr;
71
0
  }
72
73
  lldb::ScriptedThreadInterfaceSP m_scripted_thread_interface_sp = nullptr;
74
};
75
76
class ScriptedThreadInterface : virtual public ScriptedInterface {
77
public:
78
  StructuredData::GenericSP
79
  CreatePluginObject(llvm::StringRef class_name, ExecutionContext &exe_ctx,
80
0
                     StructuredData::DictionarySP args_sp) override {
81
0
    return nullptr;
82
0
  }
83
84
0
  virtual lldb::tid_t GetThreadID() { return LLDB_INVALID_THREAD_ID; }
Unexecuted instantiation: lldb_private::ScriptedThreadInterface::GetThreadID()
Unexecuted instantiation: lldb_private::ScriptedThreadInterface::GetThreadID()
85
86
0
  virtual llvm::Optional<std::string> GetName() { return llvm::None; }
87
88
0
  virtual lldb::StateType GetState() { return lldb::eStateInvalid; }
89
90
0
  virtual llvm::Optional<std::string> GetQueue() { return llvm::None; }
91
92
0
  virtual StructuredData::DictionarySP GetStopReason() { return nullptr; }
93
94
0
  virtual StructuredData::ArraySP GetStackFrames() { return nullptr; }
95
96
0
  virtual StructuredData::DictionarySP GetRegisterInfo() { return nullptr; }
97
98
0
  virtual llvm::Optional<std::string> GetRegisterContext() {
99
0
    return llvm::None;
100
0
  }
101
};
102
} // namespace lldb_private
103
104
#endif // LLDB_INTERPRETER_SCRIPTEDPROCESSINTERFACE_H