[LLDB-lua] modify Lua's 'print' to respect 'io.stdout'
authorPedro Tammela <pctammela@gmail.com>
Thu, 5 Nov 2020 20:53:16 +0000 (20:53 +0000)
committerPedro Tammela <pctammela@gmail.com>
Thu, 5 Nov 2020 21:23:20 +0000 (21:23 +0000)
commitca17571051d4e0a63e702371984dbd3671261f79
treead230000f0a9f290177a194092480caf584b6376
parente55157874cf20acef55ca20a87699bf77b7cfd3a
[LLDB-lua] modify Lua's 'print' to respect 'io.stdout'

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
lldb/source/Plugins/ScriptInterpreter/Lua/Lua.cpp
lldb/source/Plugins/ScriptInterpreter/Lua/Lua.h
lldb/test/Shell/ScriptInterpreter/Lua/print.test [new file with mode: 0644]