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_INTERFACES_SCRIPTEDPROCESSINTERFACE_H
10#define LLDB_INTERPRETER_INTERFACES_SCRIPTEDPROCESSINTERFACE_H
11
12#include "ScriptedInterface.h"
15
16#include "lldb/lldb-private.h"
17
18#include <optional>
19#include <string>
20
21namespace lldb_private {
23public:
24 virtual llvm::Expected<StructuredData::GenericSP>
25 CreatePluginObject(llvm::StringRef class_name, ExecutionContext &exe_ctx,
27 StructuredData::Generic *script_obj = nullptr) = 0;
28
30
31 virtual Status Attach(const ProcessAttachInfo &attach_info) {
32 return Status::FromErrorString("ScriptedProcess did not attach");
33 }
34
35 virtual Status Launch() {
36 return Status::FromErrorString("ScriptedProcess did not launch");
37 }
38
39 virtual Status Resume() {
40 return Status::FromErrorString("ScriptedProcess did not resume");
41 }
42
43 virtual std::optional<MemoryRegionInfo>
45 error = Status::FromErrorString("ScriptedProcess have no memory region.");
46 return {};
47 }
48
50
53 "ScriptedProcess don't support creating breakpoints.");
54 return {};
55 }
56
58 ReadMemoryAtAddress(lldb::addr_t address, size_t size, Status &error) {
59 return {};
60 }
61
64 Status &error) {
66 };
67
69
71
72 virtual bool IsAlive() { return true; }
73
74 virtual std::optional<std::string> GetScriptedThreadPluginName() {
75 return std::nullopt;
76 }
77
79
80protected:
81 friend class ScriptedThread;
83 return {};
84 }
85};
86} // namespace lldb_private
87
88#endif // LLDB_INTERPRETER_INTERFACES_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 StructuredData::DictionarySP GetCapabilities()
virtual std::optional< std::string > GetScriptedThreadPluginName()
virtual Status Attach(const ProcessAttachInfo &attach_info)
virtual bool CreateBreakpoint(lldb::addr_t addr, Status &error)
virtual StructuredData::DictionarySP GetMetadata()
virtual StructuredData::ArraySP GetLoadedImages()
virtual lldb::offset_t WriteMemoryAtAddress(lldb::addr_t addr, lldb::DataExtractorSP data_sp, Status &error)
virtual llvm::Expected< StructuredData::GenericSP > CreatePluginObject(llvm::StringRef class_name, ExecutionContext &exe_ctx, StructuredData::DictionarySP args_sp, StructuredData::Generic *script_obj=nullptr)=0
virtual std::optional< MemoryRegionInfo > GetMemoryRegionContainingAddress(lldb::addr_t address, Status &error)
An error handling class.
Definition: Status.h:115
static Status FromErrorString(const char *str)
Definition: Status.h:138
std::shared_ptr< Dictionary > DictionarySP
std::shared_ptr< Array > ArraySP
#define LLDB_INVALID_OFFSET
Definition: lldb-defines.h:93
#define LLDB_INVALID_PROCESS_ID
Definition: lldb-defines.h:89
A class that represents a running process on the host machine.
uint64_t offset_t
Definition: lldb-types.h:85
std::shared_ptr< lldb_private::ScriptedThreadInterface > ScriptedThreadInterfaceSP
Definition: lldb-forward.h:415
uint64_t pid_t
Definition: lldb-types.h:83
uint64_t addr_t
Definition: lldb-types.h:80
std::shared_ptr< lldb_private::DataExtractor > DataExtractorSP
Definition: lldb-forward.h:338