allow arbitrary python streams to be converted to SBFile

Summary:
This patch adds SWIG typemaps that can convert arbitrary python
file objects into lldb_private::File.

A SBFile may be initialized from a python file using the
constructor.   There are also alternate, tagged constructors
that allow python files to be borrowed, and for the caller
to control whether or not the python I/O methods will be
called even when a file descriptor is available.I

Reviewers: JDevlieghere, jasonmolenda, labath

Reviewed By: labath

Subscribers: zturner, amccarth, lldb-commits

Tags: #lldb

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

llvm-svn: 374225
This commit is contained in:
Lawrence D'Anna
2019-10-09 20:56:17 +00:00
parent adc38dcf5f
commit 21b8a8ae27
6 changed files with 812 additions and 32 deletions

View File

@@ -16,7 +16,9 @@ using namespace lldb_private;
SBFile::~SBFile() {}
SBFile::SBFile(FileSP file_sp) : m_opaque_sp(file_sp) {}
SBFile::SBFile(FileSP file_sp) : m_opaque_sp(file_sp) {
LLDB_RECORD_DUMMY(void, SBfile, SBFile, (FileSP), file_sp);
}
SBFile::SBFile() { LLDB_RECORD_CONSTRUCTOR_NO_ARGS(SBFile); }