1 | //===-- ScriptedPlatformInterface.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_SCRIPTEDPLATFORMINTERFACE_H |
10 | #define LLDB_INTERPRETER_INTERFACES_SCRIPTEDPLATFORMINTERFACE_H |
11 | |
12 | #include "lldb/Core/StructuredDataImpl.h" |
13 | #include "lldb/Interpreter/Interfaces/ScriptedInterface.h" |
14 | |
15 | #include "lldb/lldb-private.h" |
16 | |
17 | #include <string> |
18 | |
19 | namespace lldb_private { |
20 | class ScriptedPlatformInterface : virtual public ScriptedInterface { |
21 | public: |
22 | virtual llvm::Expected<StructuredData::GenericSP> |
23 | CreatePluginObject(llvm::StringRef class_name, ExecutionContext &exe_ctx, |
24 | StructuredData::DictionarySP args_sp, |
25 | StructuredData::Generic *script_obj = nullptr) = 0; |
26 | |
27 | virtual StructuredData::DictionarySP ListProcesses() { return {}; } |
28 | |
29 | virtual StructuredData::DictionarySP GetProcessInfo(lldb::pid_t) { |
30 | return {}; |
31 | } |
32 | |
33 | virtual Status AttachToProcess(lldb::ProcessAttachInfoSP attach_info) { |
34 | return Status("ScriptedPlatformInterface cannot attach to a process"); |
35 | } |
36 | |
37 | virtual Status LaunchProcess(lldb::ProcessLaunchInfoSP launch_info) { |
38 | return Status("ScriptedPlatformInterface cannot launch process"); |
39 | } |
40 | |
41 | virtual Status KillProcess(lldb::pid_t pid) { |
42 | return Status("ScriptedPlatformInterface cannot kill process"); |
43 | } |
44 | }; |
45 | } // namespace lldb_private |
46 | |
47 | #endif // LLDB_INTERPRETER_INTERFACES_SCRIPTEDPLATFORMINTERFACE_H |
48 |