This is an archive of the discontinued LLVM Phabricator instance.

[LLDB-lua] modify Lua's 'print' to respect 'io.stdout'
ClosedPublic

Authored by tammela on Nov 4 2020, 12:50 PM.

Details

Summary

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.

Diff Detail

Event Timeline

tammela created this revision.Nov 4 2020, 12:50 PM
Herald added a project: Restricted Project. · View Herald TranscriptNov 4 2020, 12:50 PM
tammela requested review of this revision.Nov 4 2020, 12:50 PM

This is great, it's been bothering me a lot. Thank Pedro!

Could you please add a test case (something similar to `lldb/test/Shell/ScriptInterpreter/Lua/io.test should be fine).

tammela updated this revision to Diff 303088.Nov 5 2020, 4:59 AM

Add test case

This revision is now accepted and ready to land.Nov 5 2020, 8:21 AM
This revision was landed with ongoing or failed builds.Nov 5 2020, 1:32 PM
This revision was automatically updated to reflect the committed changes.