From ba4803a89fcf776be877c5a4f40209ff1f4f2a50 Mon Sep 17 00:00:00 2001 From: "SND\\kernelnet_cp" Date: Mon, 22 Aug 2011 06:50:38 +0000 Subject: [PATCH] [pykd] added : attachKernel routine ( attach debugger to a kernel target ) git-svn-id: https://pykd.svn.codeplex.com/svn@69212 9b283d60-5439-405e-af05-b73fd8c4d996 --- pykd/dbgdump.cpp | 12 +++++++++++- pykd/dbgdump.h | 3 +++ pykd/dbgext.cpp | 4 +++- test/targetapp/targetapp.vcproj | 6 +++++- 4 files changed, 22 insertions(+), 3 deletions(-) diff --git a/pykd/dbgdump.cpp b/pykd/dbgdump.cpp index e8c71bb..d51128d 100644 --- a/pykd/dbgdump.cpp +++ b/pykd/dbgdump.cpp @@ -88,4 +88,14 @@ attachProcess( ULONG processId ) ///////////////////////////////////////////////////////////////////////////////// - \ No newline at end of file +void +attachKernel( const std::wstring param ) +{ + HRESULT hres; + + hres = dbgExt->client5->AttachKernelWide( DEBUG_ATTACH_KERNEL_CONNECTION, param.c_str() ); + if ( FAILED( hres ) ) + throw DbgException( "IDebugClient5::AttachKernelWide failed" ); +} + +///////////////////////////////////////////////////////////////////////////////// \ No newline at end of file diff --git a/pykd/dbgdump.h b/pykd/dbgdump.h index b84fcce..725979e 100644 --- a/pykd/dbgdump.h +++ b/pykd/dbgdump.h @@ -13,4 +13,7 @@ startProcess( const std::wstring &processName ); void attachProcess( ULONG processId ); +void +attachKernel( const std::wstring param ); + ///////////////////////////////////////////////////////////////////////////////// diff --git a/pykd/dbgext.cpp b/pykd/dbgext.cpp index d4b95bc..13f09e9 100644 --- a/pykd/dbgext.cpp +++ b/pykd/dbgext.cpp @@ -92,7 +92,9 @@ BOOST_PYTHON_MODULE( pykd ) boost::python::def( "startProcess", &startProcess, "Start process for debugging (only for console)"); boost::python::def( "attachProcess", &attachProcess, - "Attach debugger to the exsisting process" ); + "Attach debugger to a exsisting process" ); + boost::python::def( "attachKernel", &attachKernel, + "Attach debugger to a kernel target" ); boost::python::def( "dbgCommand", &dbgCommand, "Execute debugger command. For example: dbgCommand( \"lmvm nt\" )" ); boost::python::def( "isValid", &isOffsetValid, diff --git a/test/targetapp/targetapp.vcproj b/test/targetapp/targetapp.vcproj index cf71fb0..cf9ba53 100644 --- a/test/targetapp/targetapp.vcproj +++ b/test/targetapp/targetapp.vcproj @@ -1,7 +1,7 @@ + +