[Lldb-commits] [PATCH] D18228: Make File option flags consistent for Python API

Francis Ricci via lldb-commits lldb-commits at lists.llvm.org
Wed Mar 16 14:50:37 PDT 2016


fjricci created this revision.
fjricci added reviewers: clayborg, granata.enrico, Eugene.Zelenko, jingham.
fjricci added subscribers: sas, lldb-commits.

Fixes SBCommandReturnObject::SetImmediateOutputFile() and
SBCommandReturnObject::SetImmediateOutputFile() for files opened
with "a" or "a+" by resolving inconsistencies between File and
our Python parsing of file objects.

http://reviews.llvm.org/D18228

Files:
  source/Host/common/File.cpp
  source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp

Index: source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp
===================================================================
--- source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp
+++ source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp
@@ -1255,7 +1255,7 @@
     .Case("a",   File::eOpenOptionAppend|File::eOpenOptionCanCreate)
     .Case("r+",  File::eOpenOptionRead|File::eOpenOptionWrite)
     .Case("w+",  File::eOpenOptionRead|File::eOpenOptionWrite|File::eOpenOptionCanCreate|File::eOpenOptionTruncate)
-    .Case("a+",  File::eOpenOptionRead|File::eOpenOptionWrite|File::eOpenOptionCanCreate)
+    .Case("a+",  File::eOpenOptionAppend|File::eOpenOptionRead|File::eOpenOptionCanCreate)
     .Default(0);
 }
 
Index: source/Host/common/File.cpp
===================================================================
--- source/Host/common/File.cpp
+++ source/Host/common/File.cpp
@@ -45,7 +45,7 @@
             else
                 return "a+";
         }
-        else if (options & File::eOpenOptionWrite)
+        else
         {
             if (options & File::eOpenOptionCanCreateNewOnly)
                 return "ax";


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D18228.50876.patch
Type: text/x-patch
Size: 1161 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20160316/37ab0357/attachment.bin>


More information about the lldb-commits mailing list