xref: /llvm-project/lldb/include/lldb/Interpreter/Interfaces/ScriptedPlatformInterface.h (revision 0642cd768b80665585c8500bed2933a3b99123dc)
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::FromErrorString(
35         "ScriptedPlatformInterface cannot attach to a process");
36   }
37 
38   virtual Status LaunchProcess(lldb::ProcessLaunchInfoSP launch_info) {
39     return Status::FromErrorString(
40         "ScriptedPlatformInterface cannot launch process");
41   }
42 
43   virtual Status KillProcess(lldb::pid_t pid) {
44     return Status::FromErrorString(
45         "ScriptedPlatformInterface cannot kill process");
46   }
47 };
48 } // namespace lldb_private
49 
50 #endif // LLDB_INTERPRETER_INTERFACES_SCRIPTEDPLATFORMINTERFACE_H
51