[0.3.x] added : expr supports cplusplus syntax

git-svn-id: https://pykd.svn.codeplex.com/svn@85198 9b283d60-5439-405e-af05-b73fd8c4d996
This commit is contained in:
SND\kernelnet_cp 2013-09-13 14:16:33 +00:00 committed by Mikhail I. Izmestev
parent 4572e0927f
commit 30466d4587
2 changed files with 5 additions and 4 deletions

View File

@ -4,6 +4,7 @@
#include "kdlib/typeinfo.h" #include "kdlib/typeinfo.h"
#include "dbgengine.h" #include "dbgengine.h"
#include "variant.h"
namespace pykd { namespace pykd {
@ -131,13 +132,13 @@ std::wstring debugCommand( const std::wstring &command )
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
unsigned long long evaluate( const std::wstring &expression ) python::object evaluate( const std::wstring &expression, bool cplusplus )
{ {
AutoRestorePyState pystate; AutoRestorePyState pystate;
unsigned long long result = kdlib::evaluate(expression); kdlib::NumVariant var = kdlib::evaluate(expression, cplusplus );
return result; return pykd::NumVariantAdaptor::convertToPython( var );
} }
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////

View File

@ -21,7 +21,7 @@ void loadDump( const std::wstring &fileName );
void attachKernel( const std::wstring &connectOptions = L"" ); void attachKernel( const std::wstring &connectOptions = L"" );
std::wstring debugCommand( const std::wstring &command ); std::wstring debugCommand( const std::wstring &command );
unsigned long long evaluate( const std::wstring &expression ); python::object evaluate( const std::wstring &expression, bool cplusplus = false );
python::tuple getSourceLine( kdlib::MEMOFFSET_64 offset = 0 ); python::tuple getSourceLine( kdlib::MEMOFFSET_64 offset = 0 );