[Lldb-commits] [lldb] b934570 - [lldb] Update ScriptInterpreterLua for Status changes (NFC)
Jonas Devlieghere via lldb-commits
lldb-commits at lists.llvm.org
Sat Sep 7 17:04:06 PDT 2024
Author: Jonas Devlieghere
Date: 2024-09-07T17:03:59-07:00
New Revision: b93457073762bb347b6c7f39c23636dec036a815
URL: https://github.com/llvm/llvm-project/commit/b93457073762bb347b6c7f39c23636dec036a815
DIFF: https://github.com/llvm/llvm-project/commit/b93457073762bb347b6c7f39c23636dec036a815.diff
LOG: [lldb] Update ScriptInterpreterLua for Status changes (NFC)
The Status constructor that takes an error has been removed in favor of
Status::FromError.
Added:
Modified:
lldb/source/Plugins/ScriptInterpreter/Lua/ScriptInterpreterLua.cpp
Removed:
################################################################################
diff --git a/lldb/source/Plugins/ScriptInterpreter/Lua/ScriptInterpreterLua.cpp b/lldb/source/Plugins/ScriptInterpreter/Lua/ScriptInterpreterLua.cpp
index ea74a500518e31..896fc6951b85c6 100644
--- a/lldb/source/Plugins/ScriptInterpreter/Lua/ScriptInterpreterLua.cpp
+++ b/lldb/source/Plugins/ScriptInterpreter/Lua/ScriptInterpreterLua.cpp
@@ -358,16 +358,16 @@ Status ScriptInterpreterLua::SetBreakpointCommandCallback(
Status ScriptInterpreterLua::RegisterBreakpointCallback(
BreakpointOptions &bp_options, const char *command_body_text,
StructuredData::ObjectSP extra_args_sp) {
- Status error;
auto data_up = std::make_unique<CommandDataLua>(extra_args_sp);
- error = m_lua->RegisterBreakpointCallback(data_up.get(), command_body_text);
- if (error.Fail())
- return error;
+ llvm::Error err =
+ m_lua->RegisterBreakpointCallback(data_up.get(), command_body_text);
+ if (err)
+ return Status::FromError(std::move(err));
auto baton_sp =
std::make_shared<BreakpointOptions::CommandBaton>(std::move(data_up));
bp_options.SetCallback(ScriptInterpreterLua::BreakpointCallbackFunction,
baton_sp);
- return error;
+ return {};
}
void ScriptInterpreterLua::SetWatchpointCommandCallback(
@@ -379,16 +379,16 @@ void ScriptInterpreterLua::SetWatchpointCommandCallback(
Status ScriptInterpreterLua::RegisterWatchpointCallback(
WatchpointOptions *wp_options, const char *command_body_text,
StructuredData::ObjectSP extra_args_sp) {
- Status error;
auto data_up = std::make_unique<WatchpointOptions::CommandData>();
- error = m_lua->RegisterWatchpointCallback(data_up.get(), command_body_text);
- if (error.Fail())
- return error;
+ llvm::Error err =
+ m_lua->RegisterWatchpointCallback(data_up.get(), command_body_text);
+ if (err)
+ return Status::FromError(std::move(err));
auto baton_sp =
std::make_shared<WatchpointOptions::CommandBaton>(std::move(data_up));
wp_options->SetCallback(ScriptInterpreterLua::WatchpointCallbackFunction,
baton_sp);
- return error;
+ return {};
}
lldb::ScriptInterpreterSP
More information about the lldb-commits
mailing list