mirror of
https://github.com/ivellioscolin/pykd.git
synced 2025-04-20 03:23:23 +08:00
[pykd] added : typedVar::data method ( Return raw string object with data stream )
git-svn-id: https://pykd.svn.codeplex.com/svn@66398 9b283d60-5439-405e-af05-b73fd8c4d996
This commit is contained in:
parent
80eaf476cd
commit
2f4f925b4b
@ -21,7 +21,6 @@
|
||||
#include "dbgdump.h"
|
||||
#include "dbgexcept.h"
|
||||
#include "dbgeventcb.h"
|
||||
#include "dbgcallback.h"
|
||||
#include "dbgpath.h"
|
||||
#include "dbgprocess.h"
|
||||
#include "dbgsynsym.h"
|
||||
@ -255,6 +254,8 @@ BOOST_PYTHON_MODULE( pykd )
|
||||
"Return virtual address" )
|
||||
.def("sizeof", &TypedVar::getSize,
|
||||
"Return size of a variable in the target memory" )
|
||||
.def("data", &TypedVar::data,
|
||||
"Return raw string object with data stream" )
|
||||
.def("__getattr__", &TypedVar::getFieldWrap,
|
||||
"Return field of structure as a object attribute" )
|
||||
.def("__str__", &TypedVar::print,
|
||||
@ -828,6 +829,21 @@ pycmd( PDEBUG_CLIENT4 client, PCSTR args )
|
||||
ULONG inputSize;
|
||||
bool stopInput = false;
|
||||
|
||||
boost::python::import( "pykd" );
|
||||
|
||||
boost::python::object main = boost::python::import("__main__");
|
||||
|
||||
boost::python::object global(main.attr("__dict__"));
|
||||
|
||||
// ïåðåíàïðàâëåíèå ñòàíäàðòíûõ ïîòîêîâ ÂÂ
|
||||
boost::python::object sys = boost::python::import("sys");
|
||||
|
||||
dbgOut dout;
|
||||
sys.attr("stdout") = boost::python::object( dout );
|
||||
|
||||
dbgIn din;
|
||||
sys.attr("stdin") = boost::python::object( din );
|
||||
|
||||
do {
|
||||
|
||||
std::string output;
|
||||
|
@ -867,6 +867,21 @@ TypedVar::getField( boost::python::object &pyobj, const std::string &fieldName
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
std::string
|
||||
TypedVar::data()
|
||||
{
|
||||
if ( m_buffer.size() == 0 )
|
||||
{
|
||||
m_buffer.resize( (size_t)m_typeInfo.fullSize() );
|
||||
|
||||
loadMemory( m_targetOffset, (PVOID)&m_buffer[0], (ULONG)m_buffer.size() );
|
||||
}
|
||||
|
||||
return std::string( &m_buffer[0], m_buffer.size() );
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
std::string
|
||||
TypedVar::print()
|
||||
{
|
||||
|
@ -233,6 +233,8 @@ public:
|
||||
return m_targetOffset;
|
||||
}
|
||||
|
||||
std::string data();
|
||||
|
||||
std::string print();
|
||||
|
||||
private:
|
||||
|
Loading…
Reference in New Issue
Block a user