LLDB mainline
ScriptedProcessInterface.h
Go to the documentation of this file.
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
15
16#include "lldb/lldb-private.h"
17
18#include <optional>
19#include <string>
20
21namespace lldb_private {
23public:
25 CreatePluginObject(llvm::StringRef class_name, ExecutionContext &exe_ctx,
27 StructuredData::Generic *script_obj = nullptr) override {
28 return {};
29 }
30
31 virtual Status Launch() { return Status("ScriptedProcess did not launch"); }
32
33 virtual Status Resume() { return Status("ScriptedProcess did not resume"); }
34
35 virtual bool ShouldStop() { return true; }
36
37 virtual Status Stop() { return Status("ScriptedProcess did not stop"); }
38
39 virtual std::optional<MemoryRegionInfo>
41 error.SetErrorString("ScriptedProcess have no memory region.");
42 return {};
43 }
44
46
48 return {};
49 }
50
52 return {};
53 }
54
55 virtual lldb::DataExtractorSP
56 ReadMemoryAtAddress(lldb::addr_t address, size_t size, Status &error) {
57 return {};
58 }
59
61
63
64 virtual bool IsAlive() { return true; }
65
66 virtual std::optional<std::string> GetScriptedThreadPluginName() {
67 return std::nullopt;
68 }
69
71
72protected:
73 friend class ScriptedThread;
74 virtual lldb::ScriptedThreadInterfaceSP CreateScriptedThreadInterface() {
75 return {};
76 }
77};
78
80public:
82 CreatePluginObject(llvm::StringRef class_name, ExecutionContext &exe_ctx,
84 StructuredData::Generic *script_obj = nullptr) override {
85 return {};
86 }
87
89
90 virtual std::optional<std::string> GetName() { return std::nullopt; }
91
93
94 virtual std::optional<std::string> GetQueue() { return std::nullopt; }
95
97
98 virtual StructuredData::ArraySP GetStackFrames() { return {}; }
99
101
102 virtual std::optional<std::string> GetRegisterContext() {
103 return std::nullopt;
104 }
105
107};
108} // namespace lldb_private
109
110#endif // LLDB_INTERPRETER_SCRIPTEDPROCESSINTERFACE_H
static llvm::raw_ostream & error(Stream &strm)
"lldb/Target/ExecutionContext.h" A class that contains an execution context.
virtual lldb::DataExtractorSP ReadMemoryAtAddress(lldb::addr_t address, size_t size, Status &error)
virtual lldb::ScriptedThreadInterfaceSP CreateScriptedThreadInterface()
virtual StructuredData::DictionarySP GetThreadsInfo()
virtual std::optional< std::string > GetScriptedThreadPluginName()
virtual StructuredData::DictionarySP GetMetadata()
virtual StructuredData::ArraySP GetLoadedImages()
virtual StructuredData::DictionarySP GetThreadWithID(lldb::tid_t tid)
StructuredData::GenericSP CreatePluginObject(llvm::StringRef class_name, ExecutionContext &exe_ctx, StructuredData::DictionarySP args_sp, StructuredData::Generic *script_obj=nullptr) override
virtual StructuredData::DictionarySP GetRegistersForThread(lldb::tid_t tid)
virtual std::optional< MemoryRegionInfo > GetMemoryRegionContainingAddress(lldb::addr_t address, Status &error)
virtual StructuredData::DictionarySP GetStopReason()
virtual std::optional< std::string > GetRegisterContext()
virtual StructuredData::ArraySP GetExtendedInfo()
virtual StructuredData::ArraySP GetStackFrames()
virtual std::optional< std::string > GetName()
virtual std::optional< std::string > GetQueue()
virtual StructuredData::DictionarySP GetRegisterInfo()
StructuredData::GenericSP CreatePluginObject(llvm::StringRef class_name, ExecutionContext &exe_ctx, StructuredData::DictionarySP args_sp, StructuredData::Generic *script_obj=nullptr) override
An error handling class.
Definition: Status.h:44
std::shared_ptr< Generic > GenericSP
std::shared_ptr< Dictionary > DictionarySP
std::shared_ptr< Array > ArraySP
#define LLDB_INVALID_THREAD_ID
Definition: lldb-defines.h:82
#define LLDB_INVALID_PROCESS_ID
Definition: lldb-defines.h:81
A class that represents a running process on the host machine.
StateType
Process and Thread States.
uint64_t pid_t
Definition: lldb-types.h:85
uint64_t addr_t
Definition: lldb-types.h:83
uint64_t tid_t
Definition: lldb-types.h:86