diff options
author | Enrico Granata <egranata@apple.com> | 2012-10-16 20:57:12 +0000 |
---|---|---|
committer | Enrico Granata <egranata@apple.com> | 2012-10-16 20:57:12 +0000 |
commit | cd4d24d5e9583dfe8839262df17088e38962fda1 (patch) | |
tree | af316a903d7e77de4769673431f8ddcaee17dba4 /lldb/source/API/SBCommandReturnObject.cpp | |
parent | 981d4dfa0f4e7ed2232e48845a239683fea182a4 (diff) | |
download | bcm5719-llvm-cd4d24d5e9583dfe8839262df17088e38962fda1.tar.gz bcm5719-llvm-cd4d24d5e9583dfe8839262df17088e38962fda1.zip |
<rdar://problem/12446320> Fixing an issue with our Driver where setting an immediate output would not cause suppression of the final printout. This allows effective output redirection for Python commands
llvm-svn: 166058
Diffstat (limited to 'lldb/source/API/SBCommandReturnObject.cpp')
-rw-r--r-- | lldb/source/API/SBCommandReturnObject.cpp | 42 |
1 files changed, 41 insertions, 1 deletions
diff --git a/lldb/source/API/SBCommandReturnObject.cpp b/lldb/source/API/SBCommandReturnObject.cpp index 4632009679b..e923bba1041 100644 --- a/lldb/source/API/SBCommandReturnObject.cpp +++ b/lldb/source/API/SBCommandReturnObject.cpp @@ -268,7 +268,7 @@ SBCommandReturnObject::SetImmediateOutputFile (FILE *fh) if (m_opaque_ap.get()) m_opaque_ap->SetImmediateOutputFile (fh); } - + void SBCommandReturnObject::SetImmediateErrorFile (FILE *fh) { @@ -285,6 +285,46 @@ SBCommandReturnObject::PutCString(const char* string, int len) } } +const char * +SBCommandReturnObject::GetOutput (bool only_if_no_immediate) +{ + if (!m_opaque_ap.get()) + return NULL; + if (only_if_no_immediate == false || m_opaque_ap->GetImmediateOutputStream().get() == NULL) + return GetOutput(); + return NULL; +} + +const char * +SBCommandReturnObject::GetError (bool only_if_no_immediate) +{ + if (!m_opaque_ap.get()) + return NULL; + if (only_if_no_immediate == false || m_opaque_ap->GetImmediateErrorStream().get() == NULL) + return GetError(); + return NULL; +} + +size_t +SBCommandReturnObject::GetErrorSize (bool only_if_no_immediate) +{ + if (!m_opaque_ap.get()) + return NULL; + if (only_if_no_immediate == false || m_opaque_ap->GetImmediateErrorStream().get() == NULL) + return GetErrorSize(); + return NULL; +} + +size_t +SBCommandReturnObject::GetOutputSize (bool only_if_no_immediate) +{ + if (!m_opaque_ap.get()) + return NULL; + if (only_if_no_immediate == false || m_opaque_ap->GetImmediateOutputStream().get() == NULL) + return GetOutputSize(); + return NULL; +} + size_t SBCommandReturnObject::Printf(const char* format, ...) { |