Skip to content

Commit b934570

Browse files
committed
[lldb] Update ScriptInterpreterLua for Status changes (NFC)
The Status constructor that takes an error has been removed in favor of Status::FromError.
1 parent bcd586b commit b934570

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

lldb/source/Plugins/ScriptInterpreter/Lua/ScriptInterpreterLua.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -358,16 +358,16 @@ Status ScriptInterpreterLua::SetBreakpointCommandCallback(
358358
Status ScriptInterpreterLua::RegisterBreakpointCallback(
359359
BreakpointOptions &bp_options, const char *command_body_text,
360360
StructuredData::ObjectSP extra_args_sp) {
361-
Status error;
362361
auto data_up = std::make_unique<CommandDataLua>(extra_args_sp);
363-
error = m_lua->RegisterBreakpointCallback(data_up.get(), command_body_text);
364-
if (error.Fail())
365-
return error;
362+
llvm::Error err =
363+
m_lua->RegisterBreakpointCallback(data_up.get(), command_body_text);
364+
if (err)
365+
return Status::FromError(std::move(err));
366366
auto baton_sp =
367367
std::make_shared<BreakpointOptions::CommandBaton>(std::move(data_up));
368368
bp_options.SetCallback(ScriptInterpreterLua::BreakpointCallbackFunction,
369369
baton_sp);
370-
return error;
370+
return {};
371371
}
372372

373373
void ScriptInterpreterLua::SetWatchpointCommandCallback(
@@ -379,16 +379,16 @@ void ScriptInterpreterLua::SetWatchpointCommandCallback(
379379
Status ScriptInterpreterLua::RegisterWatchpointCallback(
380380
WatchpointOptions *wp_options, const char *command_body_text,
381381
StructuredData::ObjectSP extra_args_sp) {
382-
Status error;
383382
auto data_up = std::make_unique<WatchpointOptions::CommandData>();
384-
error = m_lua->RegisterWatchpointCallback(data_up.get(), command_body_text);
385-
if (error.Fail())
386-
return error;
383+
llvm::Error err =
384+
m_lua->RegisterWatchpointCallback(data_up.get(), command_body_text);
385+
if (err)
386+
return Status::FromError(std::move(err));
387387
auto baton_sp =
388388
std::make_shared<WatchpointOptions::CommandBaton>(std::move(data_up));
389389
wp_options->SetCallback(ScriptInterpreterLua::WatchpointCallbackFunction,
390390
baton_sp);
391-
return error;
391+
return {};
392392
}
393393

394394
lldb::ScriptInterpreterSP

0 commit comments

Comments
 (0)