diff options
| author | Lawrence D'Anna <lawrence_danna@apple.com> | 2019-10-15 16:59:20 +0000 |
|---|---|---|
| committer | Lawrence D'Anna <lawrence_danna@apple.com> | 2019-10-15 16:59:20 +0000 |
| commit | 311dbb1bd7c2933e8c1f5317aa9ef8715b4fae3c (patch) | |
| tree | 647aead7ea53ea5db166dd12f3e078198d3052ad /lldb/scripts | |
| parent | d9b553ec9961e95740535d3aeff62817f867767f (diff) | |
| download | bcm5719-llvm-311dbb1bd7c2933e8c1f5317aa9ef8715b4fae3c.tar.gz bcm5719-llvm-311dbb1bd7c2933e8c1f5317aa9ef8715b4fae3c.zip | |
convert SBDebugger::***FileHandle() wrappers to native files.
Summary:
This patch converts the swig wrappers for SetInputFileHandle() and friends
to emulate the old behavior using SetInputFile().
This will clear the way for deleting the FILE* typemaps altogether.
Reviewers: JDevlieghere, jasonmolenda, labath
Reviewed By: labath
Subscribers: mehdi_amini, dexonsmith, lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D68856
llvm-svn: 374912
Diffstat (limited to 'lldb/scripts')
| -rw-r--r-- | lldb/scripts/interface/SBDebugger.i | 51 |
1 files changed, 33 insertions, 18 deletions
diff --git a/lldb/scripts/interface/SBDebugger.i b/lldb/scripts/interface/SBDebugger.i index 695b32be064..20e662485b1 100644 --- a/lldb/scripts/interface/SBDebugger.i +++ b/lldb/scripts/interface/SBDebugger.i @@ -165,29 +165,44 @@ public: void SkipLLDBInitFiles (bool b); - %feature("autodoc", "DEPRECATED, use SetInputFile"); - void - SetInputFileHandle (FILE *f, bool transfer_ownership); + %pythoncode %{ + def SetOutputFileHandle(self, file, transfer_ownership): + "DEPRECATED, use SetOutputFile" + if file is None: + import sys + file = sys.stdout + self.SetOutputFile(SBFile.Create(file, borrow=True)) + + def SetInputFileHandle(self, file, transfer_ownership): + "DEPRECATED, use SetInputFile" + if file is None: + import sys + file = sys.stdin + self.SetInputFile(SBFile.Create(file, borrow=True)) + + def SetErrorFileHandle(self, file, transfer_ownership): + "DEPRECATED, use SetErrorFile" + if file is None: + import sys + file = sys.stderr + self.SetErrorFile(SBFile.Create(file, borrow=True)) + %} - %feature("autodoc", "DEPRECATED, use SetOutputFile"); - void - SetOutputFileHandle (FILE *f, bool transfer_ownership); - %feature("autodoc", "DEPRECATED, use SetErrorFile"); - void - SetErrorFileHandle (FILE *f, bool transfer_ownership); + %extend { - %feature("autodoc", "DEPRECATED, use GetInputFile"); - FILE * - GetInputFileHandle (); + lldb::FileSP GetInputFileHandle() { + return self->GetInputFile().GetFile(); + } - %feature("autodoc", "DEPRECATED, use GetOutputFile"); - FILE * - GetOutputFileHandle (); + lldb::FileSP GetOutputFileHandle() { + return self->GetOutputFile().GetFile(); + } - %feature("autodoc", "DEPRECATED, use GetErrorFile"); - FILE * - GetErrorFileHandle (); + lldb::FileSP GetErrorFileHandle() { + return self->GetErrorFile().GetFile(); + } + } SBError SetInputFile (SBFile file); |

