[pykd] fixed: issue 9560 ( dbgCommand truncates long output string )

git-svn-id: https://pykd.svn.codeplex.com/svn@70097 9b283d60-5439-405e-af05-b73fd8c4d996
This commit is contained in:
SND\kernelnet_cp 2011-09-28 13:14:01 +00:00
parent a7855ea4d1
commit 4dc6f73c5a

View File

@ -14,20 +14,46 @@ void dbgPrint::dprint( const boost::python::object& obj, bool dml )
{ {
std::wstring str = boost::python::extract<std::wstring>( obj ); std::wstring str = boost::python::extract<std::wstring>( obj );
HRESULT hres = dbgExt->control4->ControlledOutputWide( dml ? DEBUG_OUTCTL_AMBIENT_DML : DEBUG_OUTCTL_AMBIENT_TEXT, DEBUG_OUTPUT_NORMAL, L"%ws", str.c_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; std::wcout << str;
} }
}
///////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////
void dbgPrint::dprintln( const boost::python::object& obj, bool dml ) void dbgPrint::dprintln( const boost::python::object& obj, bool dml )
{ {
std::wstring str = boost::python::extract<std::wstring>( obj ); std::wstring str = boost::python::extract<std::wstring>( 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() ); 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; std::wcout << str;
} }
}
///////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////