[lldb/Lua] Use the debugger's output and error file for Lua's I/O library.

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
This commit is contained in:
Jonas Devlieghere
2020-06-23 09:04:52 -07:00
parent 45fa936855
commit fa1b4a96a0
4 changed files with 52 additions and 0 deletions

View File

@@ -0,0 +1,16 @@
# REQUIRES: lua
# UNSUPPORTED: lldb-repro
#
# RUN: cat %s | %lldb --script-language lua 2> %t.stderr > %t.stdout
# RUN: cat %t.stdout | FileCheck %s --check-prefix STDOUT
# RUN: cat %t.stderr | FileCheck %s --check-prefix STDERR
script
file = lldb.SBFile(2, "w", false)
lldb.debugger:SetOutputFile(file)
io.write(95000 + 126, "\n")
quit
script
io.write(95000 + 14, "\n")
# STDOUT: 95126
# STDOUT-NOT: 95014
# STDERR: 95014