[all-commits] [llvm/llvm-project] a0d740: [LLDB/Lua] add support for one-liner breakpoint ca...

Pedro Tammela via All-commits all-commits at lists.llvm.org
Mon Nov 30 06:18:26 PST 2020


  Branch: refs/heads/temp-test-main
  Home:   https://github.com/llvm/llvm-project
  Commit: a0d7406ae800c45dd9cb438c7ae1f55329d198e2
      https://github.com/llvm/llvm-project/commit/a0d7406ae800c45dd9cb438c7ae1f55329d198e2
  Author: Pedro Tammela <pctammela at gmail.com>
  Date:   2020-11-30 (Mon, 30 Nov 2020)

  Changed paths:
    A lldb/bindings/lua/lua-swigsafecast.swig
    A lldb/bindings/lua/lua-wrapper.swig
    M lldb/bindings/lua/lua.swig
    M lldb/source/Plugins/ScriptInterpreter/Lua/Lua.cpp
    M lldb/source/Plugins/ScriptInterpreter/Lua/Lua.h
    M lldb/source/Plugins/ScriptInterpreter/Lua/ScriptInterpreterLua.cpp
    M lldb/source/Plugins/ScriptInterpreter/Lua/ScriptInterpreterLua.h
    A lldb/test/Shell/ScriptInterpreter/Lua/breakpoint_oneline_callback.test
    M lldb/unittests/ScriptInterpreter/Lua/LuaTests.cpp

  Log Message:
  -----------
  [LLDB/Lua] add support for one-liner breakpoint callback

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




More information about the All-commits mailing list