summaryrefslogtreecommitdiffstats
path: root/lldb/source/API/SBFile.cpp
diff options
context:
space:
mode:
authorLawrence D'Anna <lawrence_danna@apple.com>2019-10-15 16:46:27 +0000
committerLawrence D'Anna <lawrence_danna@apple.com>2019-10-15 16:46:27 +0000
commitd9b553ec9961e95740535d3aeff62817f867767f (patch)
treea20193fd70d7956369ddf7c7b75407b7273c597f /lldb/source/API/SBFile.cpp
parent1184c27fa586f8fe713921150146d433aae969ff (diff)
downloadbcm5719-llvm-d9b553ec9961e95740535d3aeff62817f867767f.tar.gz
bcm5719-llvm-d9b553ec9961e95740535d3aeff62817f867767f.zip
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
Diffstat (limited to 'lldb/source/API/SBFile.cpp')
-rw-r--r--lldb/source/API/SBFile.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/lldb/source/API/SBFile.cpp b/lldb/source/API/SBFile.cpp
index 739de40b6e0..f5a38efe4a7 100644
--- a/lldb/source/API/SBFile.cpp
+++ b/lldb/source/API/SBFile.cpp
@@ -108,6 +108,11 @@ bool SBFile::operator!() const {
return LLDB_RECORD_RESULT(!IsValid());
}
+FileSP SBFile::GetFile() const {
+ LLDB_RECORD_METHOD_CONST_NO_ARGS(FileSP, SBFile, GetFile);
+ return m_opaque_sp;
+}
+
namespace lldb_private {
namespace repro {
@@ -117,6 +122,7 @@ template <> void RegisterMethods<SBFile>(Registry &R) {
LLDB_REGISTER_METHOD_CONST(bool, SBFile, IsValid, ());
LLDB_REGISTER_METHOD_CONST(bool, SBFile, operator bool,());
LLDB_REGISTER_METHOD_CONST(bool, SBFile, operator!,());
+ LLDB_REGISTER_METHOD_CONST(FileSP, SBFile, GetFile, ());
LLDB_REGISTER_METHOD(lldb::SBError, SBFile, Close, ());
}
} // namespace repro
OpenPOWER on IntegriCloud