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("ScriptedProcess did not attach");
33 }
34
35 virtual Status Launch() { return Status("ScriptedProcess did not launch"); }
36
37 virtual Status Resume() { return Status("ScriptedProcess did not resume"); }
38
39 virtual std::optional<MemoryRegionInfo>
41 error.SetErrorString("ScriptedProcess have no memory region.");
42 return {};
43 }
44
46
48 error.SetErrorString("ScriptedProcess don't support creating breakpoints.");
49 return {};
50 }
51
53 ReadMemoryAtAddress(lldb::addr_t address, size_t size, Status &error) {
54 return {};
55 }
56
59 Status &error) {
61 };
62
64
66
67 virtual bool IsAlive() { return true; }
68
69 virtual std::optional<std::string> GetScriptedThreadPluginName() {
70 return std::nullopt;
71 }
72
74
75protected:
76 friend class ScriptedThread;
78 return {};
79 }
80};
81} // namespace lldb_private
82
83#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:44
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:409
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:334