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";
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";
_______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits