OSDN Git Service

[lldb/ScriptInterpreter] Extract IO redirection logic
authorJonas Devlieghere <jonas@devlieghere.com>
Thu, 25 Jun 2020 16:43:17 +0000 (09:43 -0700)
committerJonas Devlieghere <jonas@devlieghere.com>
Thu, 25 Jun 2020 16:43:28 +0000 (09:43 -0700)
commitd79273c941d58486d09c020eb7767a5246a9c24d
tree66698a4d25cb154b7a70355fa8f37054d60fb53e
parent3b83501c29588ab65e7118fe404adf383789dedd
[lldb/ScriptInterpreter] Extract IO redirection logic

This patch takes the IO redirection logic from ScriptInterpreterPython
and moves it into the interpreter library so that it can be used by
other script interpreters. I've turned it into a RAII object so that we
don't have to worry about cleaning up in the calling code.

Differential revision: https://reviews.llvm.org/D82396
lldb/include/lldb/Interpreter/ScriptInterpreter.h
lldb/source/Interpreter/ScriptInterpreter.cpp
lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp