Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[lldb/Plugins] Introduce Scripted Interface Factory
This patch splits the previous `ScriptedProcessPythonInterface` into multiple specific classes: 1. The `ScriptedInterface` abstract class that carries the interface instance object and its virtual pure abstract creation method. 2. The `ScriptedPythonInterface` that holds a generic `Dispatch` method that can be used by various interfaces to call python methods and also keeps a reference to the Python Script Interpreter instance. 3. The `ScriptedProcessInterface` that describes the base Scripted Process model with all the methods used in the underlying script. All these components are used to refactor the `ScriptedProcessPythonInterface` class, making it more modular. This patch is also a requirement for the upcoming work on `ScriptedThread`. Differential Revision: https://reviews.llvm.org/D107521 Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
- Loading branch information
1 parent
b9e57e0
commit 3925204
Showing
11 changed files
with
329 additions
and
240 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
//===-- ScriptedInterface.h -------------------------------------*- C++ -*-===// | ||
// | ||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
// See https://llvm.org/LICENSE.txt for license information. | ||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
// | ||
//===----------------------------------------------------------------------===// | ||
|
||
#ifndef LLDB_INTERPRETER_SCRIPTEDINTERFACE_H | ||
#define LLDB_INTERPRETER_SCRIPTEDINTERFACE_H | ||
|
||
#include "lldb/Core/StructuredDataImpl.h" | ||
#include "lldb/Target/ExecutionContext.h" | ||
#include "lldb/lldb-private.h" | ||
|
||
#include <string> | ||
|
||
namespace lldb_private { | ||
class ScriptedInterface { | ||
public: | ||
ScriptedInterface() = default; | ||
virtual ~ScriptedInterface() = default; | ||
|
||
virtual StructuredData::GenericSP | ||
CreatePluginObject(llvm::StringRef class_name, ExecutionContext &exe_ctx, | ||
StructuredData::DictionarySP args_sp) = 0; | ||
|
||
protected: | ||
StructuredData::GenericSP m_object_instance_sp; | ||
}; | ||
} // namespace lldb_private | ||
#endif // LLDB_INTERPRETER_SCRIPTEDINTERFACE_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.