These callbacks are set using the following:
breakpoint command add -s lua -o "print('hello world!')"
The user supplied script is executed as:
function (frame, bp_loc, ...)
<body>
end
So the local variables 'frame', 'bp_loc' and vararg are all accessible.
Any global variables declared will persist in the Lua interpreter.
A user should never hold 'frame' and 'bp_loc' in a global variable as
these userdatas are context dependent.
Differential Revision: https://reviews.llvm.org/D91508
26 lines
560 B
Plaintext
26 lines
560 B
Plaintext
/*
|
|
lldb.swig
|
|
|
|
This is the input file for SWIG, to create the appropriate C++ wrappers and
|
|
functions for various scripting languages, to enable them to call the
|
|
liblldb Script Bridge functions.
|
|
*/
|
|
|
|
%module lldb
|
|
|
|
%include <std_string.i>
|
|
%include "lua-typemaps.swig"
|
|
%include "macros.swig"
|
|
%include "headers.swig"
|
|
|
|
%{
|
|
#include "llvm/Support/Error.h"
|
|
#include "llvm/Support/FormatVariadic.h"
|
|
#include "../bindings/lua/lua-swigsafecast.swig"
|
|
using namespace lldb_private;
|
|
using namespace lldb;
|
|
%}
|
|
|
|
%include "interfaces.swig"
|
|
%include "lua-wrapper.swig"
|