diff options
author | Pedro Tammela <pctammela@gmail.com> | 2020-12-06 14:30:57 +0000 |
---|---|---|
committer | Pedro Tammela <pctammela@gmail.com> | 2020-12-07 11:21:07 +0000 |
commit | 280ae10774abac63d4c9fdaf99598afe3053540a (patch) | |
tree | 51718cada153349293572877d444c9f8894c5a68 /lldb/source/Commands/CommandObjectBreakpointCommand.cpp | |
parent | 7b1cb4715063679531e51127eee869cd03df88da (diff) | |
download | llvm-280ae10774abac63d4c9fdaf99598afe3053540a.zip llvm-280ae10774abac63d4c9fdaf99598afe3053540a.tar.gz llvm-280ae10774abac63d4c9fdaf99598afe3053540a.tar.bz2 |
[LLDB] fix error message for one-line breakpoint scripts
LLDB is ignoring compilation errors for one-line breakpoint scripts.
This patch fixes the issues and now the error message of the
ScriptInterpreter is shown to the user.
I had to remove a new-line character for the Lua interpreter since it
was duplicated.
Differential Revision: https://reviews.llvm.org/D92729
Diffstat (limited to 'lldb/source/Commands/CommandObjectBreakpointCommand.cpp')
-rw-r--r-- | lldb/source/Commands/CommandObjectBreakpointCommand.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lldb/source/Commands/CommandObjectBreakpointCommand.cpp b/lldb/source/Commands/CommandObjectBreakpointCommand.cpp index 792e90f..caaf3bf 100644 --- a/lldb/source/Commands/CommandObjectBreakpointCommand.cpp +++ b/lldb/source/Commands/CommandObjectBreakpointCommand.cpp @@ -414,22 +414,23 @@ protected: // to set or collect command callback. Otherwise, call the methods // associated with this object. if (m_options.m_use_script_language) { + Status error; ScriptInterpreter *script_interp = GetDebugger().GetScriptInterpreter( /*can_create=*/true, m_options.m_script_language); // Special handling for one-liner specified inline. if (m_options.m_use_one_liner) { - script_interp->SetBreakpointCommandCallback( + error = script_interp->SetBreakpointCommandCallback( m_bp_options_vec, m_options.m_one_liner.c_str()); } else if (!m_func_options.GetName().empty()) { - Status error = script_interp->SetBreakpointCommandCallbackFunction( + error = script_interp->SetBreakpointCommandCallbackFunction( m_bp_options_vec, m_func_options.GetName().c_str(), m_func_options.GetStructuredData()); - if (!error.Success()) - result.SetError(error); } else { script_interp->CollectDataForBreakpointCommandCallback( m_bp_options_vec, result); } + if (!error.Success()) + result.SetError(error); } else { // Special handling for one-liner specified inline. if (m_options.m_use_one_liner) |