forked from swiftlang/llvm-project
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[lldb] Make use of Scripted{Python,}Interface for ScriptedThreadPlan
This patch makes ScriptedThreadPlan conforming to the ScriptedInterface & ScriptedPythonInterface facilities by introducing 2 ScriptedThreadPlanInterface & ScriptedThreadPlanPythonInterface classes. This allows us to get rid of every ScriptedThreadPlan-specific SWIG method and re-use the same affordances as other scripting offordances, like Scripted{Process,Thread,Platform} & OperatingSystem. To do so, this adds new transformer methods for `ThreadPlan`, `Stream` & `Event`, to allow the bijection between C++ objects and their python counterparts. Signed-off-by: Med Ismail Bennani <ismail@bennani.ma>
- Loading branch information
1 parent
8a786be
commit 4840384
Showing
23 changed files
with
401 additions
and
407 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
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
40 changes: 40 additions & 0 deletions
40
lldb/include/lldb/Interpreter/Interfaces/ScriptedThreadPlanInterface.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
//===-- ScriptedThreadPlanInterface.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_INTERFACES_SCRIPTEDTHREADPLANINTERFACE_H | ||
#define LLDB_INTERPRETER_INTERFACES_SCRIPTEDTHREADPLANINTERFACE_H | ||
|
||
#include "lldb/lldb-private.h" | ||
|
||
#include "ScriptedInterface.h" | ||
|
||
namespace lldb_private { | ||
class ScriptedThreadPlanInterface : public ScriptedInterface { | ||
public: | ||
virtual llvm::Expected<StructuredData::GenericSP> | ||
CreatePluginObject(llvm::StringRef class_name, | ||
lldb::ThreadPlanSP thread_plan_sp, | ||
const StructuredDataImpl &args_sp) { | ||
llvm_unreachable("unimplemented!"); | ||
} | ||
|
||
virtual llvm::Expected<bool> ExplainsStop(Event *event) { return true; } | ||
|
||
virtual llvm::Expected<bool> ShouldStop(Event *event) { return true; } | ||
|
||
virtual llvm::Expected<bool> IsStale() { return true; }; | ||
|
||
virtual lldb::StateType GetRunState() { return lldb::eStateStepping; } | ||
|
||
virtual llvm::Expected<bool> GetStopDescription(lldb_private::Stream *s) { | ||
return true; | ||
} | ||
}; | ||
} // namespace lldb_private | ||
|
||
#endif // LLDB_INTERPRETER_INTERFACES_SCRIPTEDTHREADPLANINTERFACE_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
Oops, something went wrong.