From d9bd4ae77be31aa707e91209a610a7e119362dc0 Mon Sep 17 00:00:00 2001 From: Enrico Granata Date: Thu, 9 Jan 2014 02:28:25 +0000 Subject: [PATCH] Patch by Ari Grant "Open LLDB and run: (lldb) script print lldb.debugger.GetInputFileHandle() This puts the debugger into a catatonic state and all interactions seem to enter a black hole. The reason is that executing this commnand actually *CLOSES* the input file handle and so all input is dropped on the floor. Oof! The fix is simple: flush a descriptor, instead of closing it, when transferring ownership." llvm-svn: 198835 --- lldb/scripts/Python/python-typemaps.swig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lldb/scripts/Python/python-typemaps.swig b/lldb/scripts/Python/python-typemaps.swig index be76eae5b7ed..24bb2b8ca46d 100644 --- a/lldb/scripts/Python/python-typemaps.swig +++ b/lldb/scripts/Python/python-typemaps.swig @@ -440,7 +440,7 @@ else // if (flags & __SRW) mode[i++] = 'a'; #endif - $result = PyFile_FromFile($1, const_cast(""), mode, fclose); + $result = PyFile_FromFile($1, const_cast(""), mode, fflush); } %typemap(in) (const char* string, int len) {