llvm-project/lldb/source/Core
Lawrence D'Anna b07823f3e2 update ScriptInterpreterPython to use File, not FILE*
Summary:
ScriptInterpreterPython needs to save and restore sys.stdout and
friends when LLDB runs a python script.

It currently does this using FILE*, which is not optimal.  If
whatever was in sys.stdout can not be represented as a FILE*, then
it will not be restored correctly when the script is finished.

It also means that if the debugger's own output stream is not
representable as a file, ScriptInterpreterPython will not be able
to redirect python's  output correctly.

This patch updates ScriptInterpreterPython to represent files with
lldb_private::File, and to represent whatever the user had in
sys.stdout as simply a PythonObject.

This will make lldb interoperate better with other scripts or programs
that need to manipulate sys.stdout.

Reviewers: JDevlieghere, jasonmolenda, labath

Reviewed By: labath

Subscribers: lldb-commits

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D68962

llvm-svn: 374964
2019-10-16 01:58:15 +00:00
..
Address.cpp Remove SymbolVendor::GetSymtab 2019-08-05 09:21:47 +00:00
AddressRange.cpp Include inlined functions when figuring out a contiguous address range 2019-05-06 20:01:21 +00:00
AddressResolver.cpp [NFC] Remove ASCII lines from comments 2019-04-10 20:48:55 +00:00
AddressResolverFileLine.cpp [lldb][NFC] Remove strange bool parameter from Searcher::SearchCallback 2019-10-10 11:26:51 +00:00
AddressResolverName.cpp [lldb][NFC] Remove strange bool parameter from Searcher::SearchCallback 2019-10-10 11:26:51 +00:00
CMakeLists.txt [lldb] [cmake] Support linking against clang-cpp dylib 2019-10-04 12:03:03 +00:00
Communication.cpp [Logging] Replace Log::Printf with LLDB_LOG macro (NFC) 2019-07-24 17:56:10 +00:00
CoreProperties.td [lldb] Qualify includes of Properties[Enum].inc files. NFC 2019-07-29 17:22:10 +00:00
Debugger.cpp update ScriptInterpreterPython to use File, not FILE* 2019-10-16 01:58:15 +00:00
Disassembler.cpp [Disassembler] Simplify a few methods (2/2) (NFC) 2019-09-04 23:05:32 +00:00
DumpDataExtractor.cpp [Core] Remove unused dependency on clangAST 2019-09-28 00:27:24 +00:00
DumpRegisterValue.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
DynamicLoader.cpp [NFC] Remove ASCII lines from comments 2019-04-10 20:48:55 +00:00
EmulateInstruction.cpp Fix a "memset clearing an object of non-trivial type" warning in EmulateInstruction 2019-03-19 15:05:55 +00:00
FileLineResolver.cpp [lldb][NFC] Remove strange bool parameter from Searcher::SearchCallback 2019-10-10 11:26:51 +00:00
FileSpecList.cpp [NFC] Remove ASCII lines from comments 2019-04-10 20:48:55 +00:00
FormatEntity.cpp [lldb][NFC] Remove WordComplete mode, make result array indexed from 0 and remove any undocumented/redundant return values 2019-08-22 07:41:23 +00:00
Highlighter.cpp [NFC] Remove lldb_utility namespace. 2019-08-21 00:50:46 +00:00
IOHandler.cpp IOHandler: fall back on File::Read if a FILE* isn't available. 2019-10-11 17:43:32 +00:00
Mangled.cpp Remove the is_mangled flag from Mangled and Symbol 2019-10-09 16:22:14 +00:00
Module.cpp Remove size_t return parameter from FindTypes 2019-10-01 15:40:41 +00:00
ModuleChild.cpp Delete unnecessary copy ctors/copy assignment operators 2019-05-15 11:23:54 +00:00
ModuleList.cpp Remove size_t return parameter from FindTypes 2019-10-01 15:40:41 +00:00
Opcode.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
PluginManager.cpp Extend FindTypes with CompilerContext to allow filtering by language. 2019-08-22 21:45:58 +00:00
RichManglingContext.cpp [NFC] Remove ASCII lines from comments 2019-04-10 20:48:55 +00:00
SearchFilter.cpp [lldb][NFC] Remove strange bool parameter from Searcher::SearchCallback 2019-10-10 11:26:51 +00:00
Section.cpp Implement DW_OP_convert 2019-09-10 16:17:38 +00:00
SourceManager.cpp [lldb] NFC modernize codebase with modernize-use-nullptr 2019-05-23 11:14:47 +00:00
StreamAsynchronousIO.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
StreamFile.cpp uint32_t options -> File::OpenOptions options 2019-10-14 20:15:34 +00:00
UserSettingsController.cpp Pass ConstString by value (NFC) 2019-03-06 21:22:25 +00:00
Value.cpp Remove unused and undocumented data_offset parameter (NFC) 2019-08-08 19:22:32 +00:00
ValueObject.cpp [NFC] Remove lldb_utility namespace. 2019-08-21 00:50:46 +00:00
ValueObjectCast.cpp Remove unused and undocumented data_offset parameter (NFC) 2019-08-08 19:22:32 +00:00
ValueObjectChild.cpp Remove unused and undocumented data_offset parameter (NFC) 2019-08-08 19:22:32 +00:00
ValueObjectConstResult.cpp Remove unused and undocumented data_offset parameter (NFC) 2019-08-08 19:22:32 +00:00
ValueObjectConstResultCast.cpp Pass ConstString by value (NFC) 2019-03-06 21:22:25 +00:00
ValueObjectConstResultChild.cpp Pass ConstString by value (NFC) 2019-03-06 21:22:25 +00:00
ValueObjectConstResultImpl.cpp [lldb] NFC modernize codebase with modernize-use-nullptr 2019-05-23 11:14:47 +00:00
ValueObjectDynamicValue.cpp Remove unused and undocumented data_offset parameter (NFC) 2019-08-08 19:22:32 +00:00
ValueObjectList.cpp Delete unnecessary copy ctors/copy assignment operators 2019-05-15 11:23:54 +00:00
ValueObjectMemory.cpp Remove unused and undocumented data_offset parameter (NFC) 2019-08-08 19:22:32 +00:00
ValueObjectRegister.cpp [Symbol] Use llvm::Expected when getting TypeSystems 2019-07-30 22:12:34 +00:00
ValueObjectSyntheticFilter.cpp [LLDB] Migrate llvm::make_unique to std::make_unique 2019-08-14 22:19:23 +00:00
ValueObjectVariable.cpp Remove unused and undocumented data_offset parameter (NFC) 2019-08-08 19:22:32 +00:00