diff --git a/pykd/dbgio.cpp b/pykd/dbgio.cpp index a3e3a51..bf9944a 100644 --- a/pykd/dbgio.cpp +++ b/pykd/dbgio.cpp @@ -14,9 +14,22 @@ void dbgPrint::dprint( const boost::python::object& obj, bool dml ) { std::wstring str = boost::python::extract( obj ); - HRESULT hres = dbgExt->control4->ControlledOutputWide( dml ? DEBUG_OUTCTL_AMBIENT_DML : DEBUG_OUTCTL_AMBIENT_TEXT, DEBUG_OUTPUT_NORMAL, L"%ws", str.c_str() ); - - std::wcout << str; + if ( isWindbgExt() ) + { + + for ( size_t i = 0; i < str.size() / 100 + 1; ++i ) + { + dbgExt->control4->ControlledOutputWide( + dml ? DEBUG_OUTCTL_AMBIENT_DML : DEBUG_OUTCTL_AMBIENT_TEXT, DEBUG_OUTPUT_NORMAL, + L"%ws", + str.substr( i*100, min( str.size() - i*100, 100 ) ).c_str() + ); + } + } + else + { + std::wcout << str; + } } ///////////////////////////////////////////////////////////////////////////////// @@ -24,10 +37,23 @@ void dbgPrint::dprint( const boost::python::object& obj, bool dml ) void dbgPrint::dprintln( const boost::python::object& obj, bool dml ) { std::wstring str = boost::python::extract( obj ); + str += L"\r\n"; - dbgExt->control4->ControlledOutputWide( dml ? DEBUG_OUTCTL_AMBIENT_DML : DEBUG_OUTCTL_AMBIENT_TEXT, DEBUG_OUTPUT_NORMAL, L"%ws\r\n", str.c_str() ); - - std::wcout << str; + if ( isWindbgExt() ) + { + for ( size_t i = 0; i < str.size() / 100 + 1; ++i ) + { + dbgExt->control4->ControlledOutputWide( + dml ? DEBUG_OUTCTL_AMBIENT_DML : DEBUG_OUTCTL_AMBIENT_TEXT, DEBUG_OUTPUT_NORMAL, + L"%ws", + str.substr( i*100, min( str.size() - i*100, 100 ) ).c_str() + ); + } + } + else + { + std::wcout << str; + } } /////////////////////////////////////////////////////////////////////////////////