Index: include/lldb/API/SBCommandReturnObject.h =================================================================== --- include/lldb/API/SBCommandReturnObject.h +++ include/lldb/API/SBCommandReturnObject.h @@ -91,6 +91,12 @@ SetImmediateErrorFile (FILE *fh); void + SetImmediateOutputFileWithOwnership(FILE* file); + + void + SetImmediateErrorFileWithOwnership(FILE* file); + + void PutCString(const char* string, int len = -1); size_t Index: scripts/interface/SBCommandReturnObject.i =================================================================== --- scripts/interface/SBCommandReturnObject.i +++ scripts/interface/SBCommandReturnObject.i @@ -16,6 +16,7 @@ See SBCommandInterpreter for example usage of SBCommandReturnObject." ) SBCommandReturnObject; + class SBCommandReturnObject { public: @@ -84,11 +85,14 @@ bool GetDescription (lldb::SBStream &description); + %rename(SetImmediateOutputFile) SetImmediateOutputFileWithOwnership; + %rename(SetImmediateErrorFile) SetImmediateErrorFileWithOwnership; + void - SetImmediateOutputFile (FILE *fh); - + SetImmediateOutputFileWithOwnership (FILE *fh); + void - SetImmediateErrorFile (FILE *fh); + SetImmediateErrorFileWithOwnership (FILE *fh); void PutCString(const char* string, int len); Index: source/API/SBCommandReturnObject.cpp =================================================================== --- source/API/SBCommandReturnObject.cpp +++ source/API/SBCommandReturnObject.cpp @@ -270,6 +270,20 @@ } void +SBCommandReturnObject::SetImmediateOutputFileWithOwnership(FILE *fh) +{ + if (m_opaque_ap) + m_opaque_ap->SetImmediateOutputFile(fh, true); +} + +void +SBCommandReturnObject::SetImmediateErrorFileWithOwnership(FILE *fh) +{ + if (m_opaque_ap) + m_opaque_ap->SetImmediateErrorFile(fh, true); +} + +void SBCommandReturnObject::PutCString(const char* string, int len) { if (m_opaque_ap)