SBFile::GetFile: convert SBFile back into python native files.
authorLawrence D'Anna <lawrence_danna@apple.com>
Tue, 15 Oct 2019 16:46:27 +0000 (16:46 +0000)
committerLawrence D'Anna <lawrence_danna@apple.com>
Tue, 15 Oct 2019 16:46:27 +0000 (16:46 +0000)
commitd9b553ec9961e95740535d3aeff62817f867767f
treea20193fd70d7956369ddf7c7b75407b7273c597f
parent1184c27fa586f8fe713921150146d433aae969ff
SBFile::GetFile: convert SBFile back into python native files.

Summary:
This makes SBFile::GetFile public and adds a SWIG typemap to convert
the result back into a python native file.

If the underlying File itself came from a python file, it is returned
identically.   Otherwise a new python file object is created using
the file descriptor.

Reviewers: JDevlieghere, jasonmolenda, labath

Reviewed By: labath

Subscribers: lldb-commits

Tags: #lldb

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

llvm-svn: 374911
lldb/include/lldb/API/SBFile.h
lldb/include/lldb/Host/File.h
lldb/packages/Python/lldbsuite/test/python_api/file_handle/TestFileHandle.py
lldb/scripts/Python/python-typemaps.swig
lldb/scripts/interface/SBFile.i
lldb/source/API/SBFile.cpp
lldb/source/Host/common/File.cpp
lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp
lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h