<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/lldb/source/Plugins/ScriptInterpreter/Lua/Lua.h, branch main</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.
</subtitle>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/'/>
<entry>
<title>[lldb/lua] Add scripted watchpoints for Lua</title>
<updated>2021-07-07T17:51:02+00:00</updated>
<author>
<name>Siger Yang</name>
<email>sigeryeung@gmail.com</email>
</author>
<published>2021-07-04T22:38:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=e81ba283131cf76ae62fa9b601a24d080578efaa'/>
<id>e81ba283131cf76ae62fa9b601a24d080578efaa</id>
<content type='text'>
Add support for Lua scripted watchpoints, with basic tests.

Differential Revision: https://reviews.llvm.org/D105034
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add support for Lua scripted watchpoints, with basic tests.

Differential Revision: https://reviews.llvm.org/D105034
</pre>
</div>
</content>
</entry>
<entry>
<title>[lldb/Lua] add support for Lua function breakpoint</title>
<updated>2021-01-25T23:40:57+00:00</updated>
<author>
<name>Pedro Tammela</name>
<email>pctammela@gmail.com</email>
</author>
<published>2020-12-21T17:59:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=532e4203c5be909af701df4dedfd36c9b8f85034'/>
<id>532e4203c5be909af701df4dedfd36c9b8f85034</id>
<content type='text'>
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
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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
</pre>
</div>
</content>
</entry>
<entry>
<title>[lldb/Lua] add support for multiline scripted breakpoints</title>
<updated>2021-01-07T00:31:36+00:00</updated>
<author>
<name>Pedro Tammela</name>
<email>pctammela@gmail.com</email>
</author>
<published>2020-12-16T21:34:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=d853bd7a4e86a50f7d7e6a5f397fcbd1e7d844b4'/>
<id>d853bd7a4e86a50f7d7e6a5f397fcbd1e7d844b4</id>
<content type='text'>
1 - Partial Statements

The interpreter loop runs every line it receives, so partial
Lua statements are not being handled properly. This is a problem for
multiline breakpoint scripts since the interpreter loop, for this
particular case, is just an abstraction to a partially parsed function
body declaration.

This patch addresses this issue and as a side effect improves the
general Lua interpreter loop as well. It's now possible to write partial
statements in the 'script' command.

Example:
   (lldb) script
   &gt;&gt;&gt;   do
   ..&gt;   local a = 123
   ..&gt;   print(a)
   ..&gt;   end
   123

The technique implemented is the same as the one employed by Lua's own REPL implementation.
Partial statements always errors out with the '&lt;eof&gt;' tag in the error
message.

2 - CheckSyntax in Lua.h

In order to support (1), we need an API for just checking the syntax of string buffers.

3 - Multiline scripted breakpoints

Finally, with all the base features implemented this feature is
straightforward. The interpreter loop behaves exactly the same, the
difference is that it will aggregate all Lua statements into the body of
the breakpoint function. An explicit 'quit' statement is needed to exit the
interpreter loop.

Example:
   (lldb) breakpoint command add -s lua
   Enter your Lua command(s). Type 'quit' to end.
   The commands are compiled as the body of the following Lua function
   function (frame, bp_loc, ...) end
   ..&gt; print(456)
   ..&gt; a = 123
   ..&gt; quit

Differential Revision: https://reviews.llvm.org/D93481
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
1 - Partial Statements

The interpreter loop runs every line it receives, so partial
Lua statements are not being handled properly. This is a problem for
multiline breakpoint scripts since the interpreter loop, for this
particular case, is just an abstraction to a partially parsed function
body declaration.

This patch addresses this issue and as a side effect improves the
general Lua interpreter loop as well. It's now possible to write partial
statements in the 'script' command.

Example:
   (lldb) script
   &gt;&gt;&gt;   do
   ..&gt;   local a = 123
   ..&gt;   print(a)
   ..&gt;   end
   123

The technique implemented is the same as the one employed by Lua's own REPL implementation.
Partial statements always errors out with the '&lt;eof&gt;' tag in the error
message.

2 - CheckSyntax in Lua.h

In order to support (1), we need an API for just checking the syntax of string buffers.

3 - Multiline scripted breakpoints

Finally, with all the base features implemented this feature is
straightforward. The interpreter loop behaves exactly the same, the
difference is that it will aggregate all Lua statements into the body of
the breakpoint function. An explicit 'quit' statement is needed to exit the
interpreter loop.

Example:
   (lldb) breakpoint command add -s lua
   Enter your Lua command(s). Type 'quit' to end.
   The commands are compiled as the body of the following Lua function
   function (frame, bp_loc, ...) end
   ..&gt; print(456)
   ..&gt; a = 123
   ..&gt; quit

Differential Revision: https://reviews.llvm.org/D93481
</pre>
</div>
</content>
</entry>
<entry>
<title>[LLDB/Lua] add support for one-liner breakpoint callback</title>
<updated>2020-11-30T14:12:26+00:00</updated>
<author>
<name>Pedro Tammela</name>
<email>pctammela@gmail.com</email>
</author>
<published>2020-11-15T19:39:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=a0d7406ae800c45dd9cb438c7ae1f55329d198e2'/>
<id>a0d7406ae800c45dd9cb438c7ae1f55329d198e2</id>
<content type='text'>
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, ...)
      &lt;body&gt;
   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
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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, ...)
      &lt;body&gt;
   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
</pre>
</div>
</content>
</entry>
<entry>
<title>[LLDB-lua] modify Lua's 'print' to respect 'io.stdout'</title>
<updated>2020-11-05T21:23:20+00:00</updated>
<author>
<name>Pedro Tammela</name>
<email>pctammela@gmail.com</email>
</author>
<published>2020-11-05T20:53:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=ca17571051d4e0a63e702371984dbd3671261f79'/>
<id>ca17571051d4e0a63e702371984dbd3671261f79</id>
<content type='text'>
This patch changes the implementation of Lua's `print()` function to
respect `io.stdout`.

The original implementation uses `lua_writestring()` internally, which is
hardcoded to `stdout`.

Reviewed By: JDevlieghere

Differential Revision: https://reviews.llvm.org/D90787
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch changes the implementation of Lua's `print()` function to
respect `io.stdout`.

The original implementation uses `lua_writestring()` internally, which is
hardcoded to `stdout`.

Reviewed By: JDevlieghere

Differential Revision: https://reviews.llvm.org/D90787
</pre>
</div>
</content>
</entry>
<entry>
<title>[LLDB/Lua] call lua_close() on Lua dtor</title>
<updated>2020-11-02T16:52:30+00:00</updated>
<author>
<name>Pedro Tammela</name>
<email>pctammela@gmail.com</email>
</author>
<published>2020-11-01T18:02:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=4d7d6f276c6df9e0a4cc3d9fccfaf84face62311'/>
<id>4d7d6f276c6df9e0a4cc3d9fccfaf84face62311</id>
<content type='text'>
This patch calls `lua_close()` on Lua dtor.

This guarantees that the Lua GC finalizers are honored, aside from the
usual internal clean up.

It also guarantees a call to the `__close` metamethod of any active
to-be-closed variable in Lua 5.4.

Since the previous `luaL_openlibs()` was a noop, because the standard
library is cached internally, I've removed it.

Differential Revision: https://reviews.llvm.org/D90557
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch calls `lua_close()` on Lua dtor.

This guarantees that the Lua GC finalizers are honored, aside from the
usual internal clean up.

It also guarantees a call to the `__close` metamethod of any active
to-be-closed variable in Lua 5.4.

Since the previous `luaL_openlibs()` was a noop, because the standard
library is cached internally, I've removed it.

Differential Revision: https://reviews.llvm.org/D90557
</pre>
</div>
</content>
</entry>
<entry>
<title>[lldb/Lua] Use the debugger's output and error file for Lua's I/O library.</title>
<updated>2020-06-23T16:05:51+00:00</updated>
<author>
<name>Jonas Devlieghere</name>
<email>jonas@devlieghere.com</email>
</author>
<published>2020-06-23T16:04:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=fa1b4a96a0110c87cdd83eb4ea3e9a0d002c3c3d'/>
<id>fa1b4a96a0110c87cdd83eb4ea3e9a0d002c3c3d</id>
<content type='text'>
Add support for changing the stdout and stderr file in Lua's I/O library
and hook it up with the debugger's output and error file respectively
for the interactive Lua interpreter.

https://reviews.llvm.org/D82273
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add support for changing the stdout and stderr file in Lua's I/O library
and hook it up with the debugger's output and error file respectively
for the interactive Lua interpreter.

https://reviews.llvm.org/D82273
</pre>
</div>
</content>
</entry>
<entry>
<title>[lldb/Lua] Support loading Lua modules</title>
<updated>2020-01-10T18:22:30+00:00</updated>
<author>
<name>Jonas Devlieghere</name>
<email>jonas@devlieghere.com</email>
</author>
<published>2020-01-10T18:21:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=572b9f468ad6844795fec29a7e671ba64d82e8c2'/>
<id>572b9f468ad6844795fec29a7e671ba64d82e8c2</id>
<content type='text'>
Implements the command script import command for Lua.

Differential revision: https://reviews.llvm.org/D71825
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Implements the command script import command for Lua.

Differential revision: https://reviews.llvm.org/D71825
</pre>
</div>
</content>
</entry>
<entry>
<title>[lldb/Lua] Make lldb.debugger et al available to Lua</title>
<updated>2020-01-09T16:15:41+00:00</updated>
<author>
<name>Jonas Devlieghere</name>
<email>jonas@devlieghere.com</email>
</author>
<published>2020-01-09T16:15:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=45c971f7eef18ef2b77a5f64133dbd7bd5939d5f'/>
<id>45c971f7eef18ef2b77a5f64133dbd7bd5939d5f</id>
<content type='text'>
The Python script interpreter makes the current debugger, target,
process, thread and frame available to interactive scripting sessions
through convenience variables. This patch does the same for Lua.

Differential revision: https://reviews.llvm.org/D71801
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The Python script interpreter makes the current debugger, target,
process, thread and frame available to interactive scripting sessions
through convenience variables. This patch does the same for Lua.

Differential revision: https://reviews.llvm.org/D71801
</pre>
</div>
</content>
</entry>
<entry>
<title>[Lldb/Lua] Persist Lua state across script interpreter calls.</title>
<updated>2019-12-21T23:00:35+00:00</updated>
<author>
<name>Jonas Devlieghere</name>
<email>jonas@devlieghere.com</email>
</author>
<published>2019-12-21T22:58:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=4164be7206d740b77b5a7b4b2f859ed122d08c10'/>
<id>4164be7206d740b77b5a7b4b2f859ed122d08c10</id>
<content type='text'>
Don't create a new lua state on every operation. Share a single state
across the lifetime of the script interpreter. Add simple locking to
prevent two threads from modifying the state concurrently.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Don't create a new lua state on every operation. Share a single state
across the lifetime of the script interpreter. Add simple locking to
prevent two threads from modifying the state concurrently.
</pre>
</div>
</content>
</entry>
</feed>
