mirror of
https://github.com/ivellioscolin/pykd.git
synced 2025-04-21 04:13:22 +08:00
[0.3.x] added : getFrameNumber ( return current frame number )
[0.3.x] added : eventHandler::onChangeBreakpoints ( Breakpoints is changed for current process ) git-svn-id: https://pykd.svn.codeplex.com/svn@89566 9b283d60-5439-405e-af05-b73fd8c4d996
This commit is contained in:
parent
27d34f5c30
commit
c89fc1f823
@ -1,6 +1,10 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<packages>
|
<packages>
|
||||||
<package id="boost" version="1.57.0.0" targetFramework="Native" />
|
<package id="boost" version="1.57.0.0" targetFramework="Native" />
|
||||||
|
<package id="boost_chrono" version="1.57.0.0" targetFramework="Native" />
|
||||||
|
<package id="boost_date_time" version="1.57.0.0" targetFramework="Native" />
|
||||||
<package id="boost_python" version="1.57.0.0" targetFramework="Native" />
|
<package id="boost_python" version="1.57.0.0" targetFramework="Native" />
|
||||||
|
<package id="boost_system" version="1.57.0.0" targetFramework="Native" />
|
||||||
|
<package id="boost_thread" version="1.57.0.0" targetFramework="Native" />
|
||||||
<package id="Python27" version="2.7.6" targetFramework="Native" />
|
<package id="Python27" version="2.7.6" targetFramework="Native" />
|
||||||
</packages>
|
</packages>
|
@ -108,6 +108,11 @@ inline kdlib::StackFramePtr getCurrentFrame() {
|
|||||||
return kdlib::getCurrentStackFrame();
|
return kdlib::getCurrentStackFrame();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline unsigned long getCurrentFrameNumber() {
|
||||||
|
AutoRestorePyState pystate;
|
||||||
|
return kdlib::getCurrentStackFrameNumber();
|
||||||
|
}
|
||||||
|
|
||||||
inline void setCurrentFrame( kdlib::StackFramePtr& stackFrame) {
|
inline void setCurrentFrame( kdlib::StackFramePtr& stackFrame) {
|
||||||
AutoRestorePyState pystate;
|
AutoRestorePyState pystate;
|
||||||
kdlib::setCurrentStackFrame(stackFrame);
|
kdlib::setCurrentStackFrame(stackFrame);
|
||||||
|
@ -286,6 +286,28 @@ void EventHandler::onChangeLocalScope()
|
|||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
void EventHandler::onChangeBreakpoints()
|
||||||
|
{
|
||||||
|
PyEval_RestoreThread(m_pystate);
|
||||||
|
|
||||||
|
try {
|
||||||
|
|
||||||
|
python::override pythonHandler = get_override("onChangeBreakpoints");
|
||||||
|
if (pythonHandler)
|
||||||
|
{
|
||||||
|
pythonHandler();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (const python::error_already_set &)
|
||||||
|
{
|
||||||
|
printException();
|
||||||
|
}
|
||||||
|
|
||||||
|
m_pystate = PyEval_SaveThread();
|
||||||
|
}
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
void EventHandler::onDebugOutput(const std::wstring& text)
|
void EventHandler::onDebugOutput(const std::wstring& text)
|
||||||
{
|
{
|
||||||
PyEval_RestoreThread( m_pystate );
|
PyEval_RestoreThread( m_pystate );
|
||||||
|
@ -35,6 +35,7 @@ public:
|
|||||||
virtual kdlib::DebugCallbackResult onModuleUnload( kdlib::MEMOFFSET_64 offset, const std::wstring &name );
|
virtual kdlib::DebugCallbackResult onModuleUnload( kdlib::MEMOFFSET_64 offset, const std::wstring &name );
|
||||||
virtual void onCurrentThreadChange(kdlib::THREAD_DEBUG_ID threadid);
|
virtual void onCurrentThreadChange(kdlib::THREAD_DEBUG_ID threadid);
|
||||||
virtual void onChangeLocalScope();
|
virtual void onChangeLocalScope();
|
||||||
|
virtual void onChangeBreakpoints();
|
||||||
virtual void onDebugOutput(const std::wstring& text);
|
virtual void onDebugOutput(const std::wstring& text);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -69,7 +69,7 @@
|
|||||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||||
</ImportGroup>
|
</ImportGroup>
|
||||||
<PropertyGroup Label="UserMacros">
|
<PropertyGroup Label="UserMacros">
|
||||||
<NuGetPackageImportStamp>445589a8</NuGetPackageImportStamp>
|
<NuGetPackageImportStamp>50e91edb</NuGetPackageImportStamp>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug_2.7|Win32'">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug_2.7|Win32'">
|
||||||
<LinkIncremental>true</LinkIncremental>
|
<LinkIncremental>true</LinkIncremental>
|
||||||
|
@ -113,6 +113,105 @@
|
|||||||
<ClCompile Include="pyeventhandler.cpp">
|
<ClCompile Include="pyeventhandler.cpp">
|
||||||
<Filter>Source Files</Filter>
|
<Filter>Source Files</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
|
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\lib\native\src\converter\boost_python.converter.arg_to_python_base.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\lib\native\src\converter\boost_python.converter.builtin_converters.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\lib\native\src\converter\boost_python.converter.from_python.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\lib\native\src\converter\boost_python.converter.registry.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\lib\native\src\converter\boost_python.converter.type_id.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\lib\native\src\object\boost_python.object.class.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\lib\native\src\object\boost_python.object.enum.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\lib\native\src\object\boost_python.object.function.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\lib\native\src\object\boost_python.object.function_doc_signature.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\lib\native\src\object\boost_python.object.inheritance.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\lib\native\src\object\boost_python.object.iterator.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\lib\native\src\object\boost_python.object.life_support.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\lib\native\src\object\boost_python.object.pickle_support.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\lib\native\src\object\boost_python.object.stl_iterator.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\lib\native\src\boost_python.dict.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\lib\native\src\boost_python.errors.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\lib\native\src\boost_python.exec.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\lib\native\src\boost_python.import.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\lib\native\src\boost_python.list.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\lib\native\src\boost_python.long.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\lib\native\src\boost_python.module.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\lib\native\src\boost_python.numeric.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\lib\native\src\boost_python.object_operators.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\lib\native\src\boost_python.object_protocol.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\lib\native\src\boost_python.slice.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\lib\native\src\boost_python.str.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\lib\native\src\boost_python.tuple.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\lib\native\src\boost_python.wrapper.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\lib\native\src\win32\boost_thread.win32.thread.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\lib\native\src\win32\boost_thread.win32.tss_dll.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\lib\native\src\win32\boost_thread.win32.tss_pe.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\lib\native\src\boost_thread.future.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\lib\native\src\boost_thread.tss_null.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<None Include="pykd.def">
|
<None Include="pykd.def">
|
||||||
|
@ -355,6 +355,8 @@ BOOST_PYTHON_MODULE( pykd )
|
|||||||
"Return a current stack as a list of stackFrame objects" );
|
"Return a current stack as a list of stackFrame objects" );
|
||||||
python::def( "getFrame", pykd::getCurrentFrame,
|
python::def( "getFrame", pykd::getCurrentFrame,
|
||||||
"Return a current stack frame" );
|
"Return a current stack frame" );
|
||||||
|
python::def("getFrameNumber", pykd::getCurrentFrameNumber,
|
||||||
|
"Return current frame number");
|
||||||
python::def( "setFrame", pykd::setCurrentFrame,
|
python::def( "setFrame", pykd::setCurrentFrame,
|
||||||
"Change current local scope" );
|
"Change current local scope" );
|
||||||
python::def( "setFrame", pykd::setCurrentFrameByIndex,
|
python::def( "setFrame", pykd::setCurrentFrameByIndex,
|
||||||
@ -901,6 +903,8 @@ BOOST_PYTHON_MODULE( pykd )
|
|||||||
.def( "onChangeLocalScope", &EventHandler::onChangeLocalScope,
|
.def( "onChangeLocalScope", &EventHandler::onChangeLocalScope,
|
||||||
"The current local scope has been changed.\n"
|
"The current local scope has been changed.\n"
|
||||||
"There is no return value" )
|
"There is no return value" )
|
||||||
|
.def("onChangeBreakpoints", &EventHandler::onChangeBreakpoints,
|
||||||
|
"Breakpoints is changed for current process" )
|
||||||
.def( "onDebugOutput", &EventHandler::onDebugOutput,
|
.def( "onDebugOutput", &EventHandler::onDebugOutput,
|
||||||
"Request debug output" );
|
"Request debug output" );
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user