Skip to content

Commit 11b3b38

Browse files
committed
[lldb] Make ScriptedInterface::CreateObjectPlugin less strict
This patches changes the implementation of `CreateObjectPlugin` in the various base ScriptedInterface classes, to return an `UnimplementedError` instead of triggering an assertion. Signed-off-by: Med Ismail Bennani <[email protected]>
1 parent 08e9c46 commit 11b3b38

File tree

4 files changed

+3
-5
lines changed

4 files changed

+3
-5
lines changed

lldb/include/lldb/Interpreter/Interfaces/ScriptedInterface.h

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#include "lldb/Target/ExecutionContext.h"
1414
#include "lldb/Utility/LLDBLog.h"
1515
#include "lldb/Utility/Log.h"
16+
#include "lldb/Utility/UnimplementedError.h"
1617
#include "lldb/lldb-private.h"
1718

1819
#include "llvm/Support/Compiler.h"

lldb/include/lldb/Interpreter/Interfaces/ScriptedPlatformInterface.h

+1-2
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@ class ScriptedPlatformInterface : virtual public ScriptedInterface {
2323
CreatePluginObject(llvm::StringRef class_name, ExecutionContext &exe_ctx,
2424
StructuredData::DictionarySP args_sp,
2525
StructuredData::Generic *script_obj = nullptr) {
26-
llvm_unreachable(
27-
"Cannot create an instance of the ScriptedPlatformInterface!");
26+
return {llvm::make_error<UnimplementedError>()};
2827
}
2928

3029
virtual StructuredData::DictionarySP ListProcesses() { return {}; }

lldb/include/lldb/Interpreter/Interfaces/ScriptedProcessInterface.h

-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
#include "ScriptedInterface.h"
1313
#include "lldb/Core/StructuredDataImpl.h"
1414
#include "lldb/Target/MemoryRegionInfo.h"
15-
#include "lldb/Utility/UnimplementedError.h"
1615

1716
#include "lldb/lldb-private.h"
1817

lldb/include/lldb/Interpreter/Interfaces/ScriptedThreadInterface.h

+1-2
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@ class ScriptedThreadInterface : virtual public ScriptedInterface {
2424
CreatePluginObject(llvm::StringRef class_name, ExecutionContext &exe_ctx,
2525
StructuredData::DictionarySP args_sp,
2626
StructuredData::Generic *script_obj = nullptr) {
27-
llvm_unreachable(
28-
"Cannot create an instance of the ScriptedThreadInterface!");
27+
return {llvm::make_error<UnimplementedError>()};
2928
}
3029

3130
virtual lldb::tid_t GetThreadID() { return LLDB_INVALID_THREAD_ID; }

0 commit comments

Comments
 (0)