aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Plugins/ScriptInterpreter/Lua/ScriptInterpreterLua.h
diff options
context:
space:
mode:
authorPedro Tammela <pctammela@gmail.com>2020-12-21 17:59:35 +0000
committerPedro Tammela <pctammela@gmail.com>2021-01-25 23:40:57 +0000
commit532e4203c5be909af701df4dedfd36c9b8f85034 (patch)
tree86af93b0ded9c0e6e94d80ddd435023a9f6b999d /lldb/source/Plugins/ScriptInterpreter/Lua/ScriptInterpreterLua.h
parentce7f9cdb50a98cef5ee6e232e45e16c150c966e9 (diff)
downloadllvm-532e4203c5be909af701df4dedfd36c9b8f85034.zip
llvm-532e4203c5be909af701df4dedfd36c9b8f85034.tar.gz
llvm-532e4203c5be909af701df4dedfd36c9b8f85034.tar.bz2
[lldb/Lua] add support for Lua function breakpoint
Adds support for running a Lua function when a breakpoint is hit. Example: breakpoint command add -s lua -F abc The above runs the Lua function 'abc' passing 2 arguments. 'frame', 'bp_loc' and 'extra_args'. A third parameter 'extra_args' is only present when there is structured data declared in the command line. Example: breakpoint command add -s lua -F abc -k foo -v bar Differential Revision: https://reviews.llvm.org/D93649
Diffstat (limited to 'lldb/source/Plugins/ScriptInterpreter/Lua/ScriptInterpreterLua.h')
-rw-r--r--lldb/source/Plugins/ScriptInterpreter/Lua/ScriptInterpreterLua.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/lldb/source/Plugins/ScriptInterpreter/Lua/ScriptInterpreterLua.h b/lldb/source/Plugins/ScriptInterpreter/Lua/ScriptInterpreterLua.h
index 6c3fc01..1130cee 100644
--- a/lldb/source/Plugins/ScriptInterpreter/Lua/ScriptInterpreterLua.h
+++ b/lldb/source/Plugins/ScriptInterpreter/Lua/ScriptInterpreterLua.h
@@ -9,6 +9,7 @@
#ifndef liblldb_ScriptInterpreterLua_h_
#define liblldb_ScriptInterpreterLua_h_
+#include "lldb/Core/StructuredDataImpl.h"
#include "lldb/Interpreter/ScriptInterpreter.h"
#include "lldb/Utility/Status.h"
#include "lldb/lldb-enumerations.h"
@@ -22,6 +23,11 @@ public:
CommandDataLua() : BreakpointOptions::CommandData() {
interpreter = lldb::eScriptLanguageLua;
}
+ CommandDataLua(StructuredData::ObjectSP extra_args_sp)
+ : BreakpointOptions::CommandData(), m_extra_args_sp(extra_args_sp) {
+ interpreter = lldb::eScriptLanguageLua;
+ }
+ StructuredData::ObjectSP m_extra_args_sp;
};
ScriptInterpreterLua(Debugger &debugger);
@@ -72,9 +78,17 @@ public:
Status SetBreakpointCommandCallback(BreakpointOptions *bp_options,
const char *command_body_text) override;
+ Status SetBreakpointCommandCallbackFunction(
+ BreakpointOptions *bp_options, const char *function_name,
+ StructuredData::ObjectSP extra_args_sp) override;
+
private:
std::unique_ptr<Lua> m_lua;
bool m_session_is_active = false;
+
+ Status RegisterBreakpointCallback(BreakpointOptions *bp_options,
+ const char *command_body_text,
+ StructuredData::ObjectSP extra_args_sp);
};
} // namespace lldb_private