[0.1.x] added : debuggerPath routine

git-svn-id: https://pykd.svn.codeplex.com/svn@71441 9b283d60-5439-405e-af05-b73fd8c4d996
This commit is contained in:
SND\kernelnet_cp 2011-11-17 15:32:28 +00:00 committed by Mikhail I. Izmestev
parent 92538913e1
commit 1bdfc6e278
3 changed files with 22 additions and 9 deletions

View File

@ -53,6 +53,16 @@ static python::dict genDict(const pyDia::Symbol::ValueNameEntry srcValues[], siz
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
std::string
getDebuggerImage()
{
std::vector<char> buffer(MAX_PATH);
GetModuleFileNameExA( GetCurrentProcess(), NULL, &buffer[0], buffer.size() );
return std::string( &buffer[0] );
}
////////////////////////////////////////////////////////////////////////////////
BOOST_PYTHON_FUNCTION_OVERLOADS( dprint_, dprint, 1, 2 ); BOOST_PYTHON_FUNCTION_OVERLOADS( dprint_, dprint, 1, 2 );
BOOST_PYTHON_FUNCTION_OVERLOADS( dprintln_, dprintln, 1, 2 ); BOOST_PYTHON_FUNCTION_OVERLOADS( dprintln_, dprintln, 1, 2 );
@ -277,15 +287,17 @@ BOOST_PYTHON_MODULE( pykd )
"Attach debugger to a kernel target" ); "Attach debugger to a kernel target" );
python::def( "expr", &pykd::evaluate, python::def( "expr", &pykd::evaluate,
"Evaluate windbg expression" ); "Evaluate windbg expression" );
python::def( "getDebuggeeType", &pykd::getDebuggeeType, python::def( "getDebuggeeType", &getDebuggeeType,
"Return type of the debuggee" ); "Return type of the debuggee" );
python::def( "getExecutionStatus", &pykd::getExecutionStatus, python::def( "debuggerPath", &getDebuggerImage,
"Return full path to the process image that uses pykd" );
python::def( "getExecutionStatus", &getExecutionStatus,
"Return information about the execution status of the debugger" ); "Return information about the execution status of the debugger" );
python::def( "go", &pykd::changeDebuggerStatus<DEBUG_STATUS_GO>, python::def( "go", &changeDebuggerStatus<DEBUG_STATUS_GO>,
"Change debugger status to DEBUG_STATUS_GO" ); "Change debugger status to DEBUG_STATUS_GO" );
python::def( "isDumpAnalyzing", &pykd::isDumpAnalyzing, python::def( "isDumpAnalyzing", &isDumpAnalyzing,
"Check if it is a dump analyzing ( not living debuggee )" ); "Check if it is a dump analyzing ( not living debuggee )" );
python::def( "isKernelDebugging", &pykd::isKernelDebugging, python::def( "isKernelDebugging", &isKernelDebugging,
"Check if kernel dubugging is running" ); "Check if kernel dubugging is running" );
python::def( "loadBytes", &loadBytes, loadBytes_( python::args( "offset", "count", "phyAddr" ), python::def( "loadBytes", &loadBytes, loadBytes_( python::args( "offset", "count", "phyAddr" ),
"Read the block of the target's memory and return it as liat of unsigned bytes" ) ); "Read the block of the target's memory and return it as liat of unsigned bytes" ) );

View File

@ -70,7 +70,7 @@
/> />
<Tool <Tool
Name="VCLinkerTool" Name="VCLinkerTool"
AdditionalDependencies="dbgeng.lib diaguids.lib" AdditionalDependencies="dbgeng.lib diaguids.lib psapi.lib"
OutputFile="$(OutDir)\$(ProjectName).pyd" OutputFile="$(OutDir)\$(ProjectName).pyd"
LinkIncremental="2" LinkIncremental="2"
AdditionalLibraryDirectories="&quot;$(DIA_SDK_ROOT)\lib&quot;;&quot;$(DBG_SDK_ROOT)\lib\i386&quot;;&quot;$(PYTHON_ROOT)\x86\libs&quot;;&quot;$(BOOST_ROOT)\stage\lib&quot;" AdditionalLibraryDirectories="&quot;$(DIA_SDK_ROOT)\lib&quot;;&quot;$(DBG_SDK_ROOT)\lib\i386&quot;;&quot;$(PYTHON_ROOT)\x86\libs&quot;;&quot;$(BOOST_ROOT)\stage\lib&quot;"
@ -151,7 +151,7 @@
/> />
<Tool <Tool
Name="VCLinkerTool" Name="VCLinkerTool"
AdditionalDependencies="dbgeng.lib diaguids.lib" AdditionalDependencies="dbgeng.lib diaguids.lib psapi.lib"
OutputFile="$(OutDir)\$(ProjectName).pyd" OutputFile="$(OutDir)\$(ProjectName).pyd"
LinkIncremental="2" LinkIncremental="2"
AdditionalLibraryDirectories="&quot;$(DIA_SDK_ROOT)\lib\amd64&quot;;&quot;$(DBG_SDK_ROOT)\lib\amd64&quot;;&quot;$(PYTHON_ROOT)\x64\libs&quot;;&quot;$(BOOST_ROOT)\stage64\lib&quot;" AdditionalLibraryDirectories="&quot;$(DIA_SDK_ROOT)\lib\amd64&quot;;&quot;$(DBG_SDK_ROOT)\lib\amd64&quot;;&quot;$(PYTHON_ROOT)\x64\libs&quot;;&quot;$(BOOST_ROOT)\stage64\lib&quot;"
@ -227,7 +227,7 @@
<Tool <Tool
Name="VCLinkerTool" Name="VCLinkerTool"
AdditionalOptions="/pdbpath:none" AdditionalOptions="/pdbpath:none"
AdditionalDependencies="dbgeng.lib diaguids.lib" AdditionalDependencies="dbgeng.lib diaguids.lib psapi.lib"
OutputFile="$(OutDir)\$(ProjectName).pyd" OutputFile="$(OutDir)\$(ProjectName).pyd"
LinkIncremental="1" LinkIncremental="1"
AdditionalLibraryDirectories="&quot;$(DIA_SDK_ROOT)\lib&quot;;&quot;$(DBG_SDK_ROOT)\lib\i386&quot;;&quot;$(PYTHON_ROOT)\x86\libs&quot;;&quot;$(BOOST_ROOT)\stage\lib&quot;" AdditionalLibraryDirectories="&quot;$(DIA_SDK_ROOT)\lib&quot;;&quot;$(DBG_SDK_ROOT)\lib\i386&quot;;&quot;$(PYTHON_ROOT)\x86\libs&quot;;&quot;$(BOOST_ROOT)\stage\lib&quot;"
@ -306,7 +306,7 @@
<Tool <Tool
Name="VCLinkerTool" Name="VCLinkerTool"
AdditionalOptions="/pdbpath:none" AdditionalOptions="/pdbpath:none"
AdditionalDependencies="dbgeng.lib diaguids.lib" AdditionalDependencies="dbgeng.lib diaguids.lib psapi.lib"
OutputFile="$(OutDir)\$(ProjectName).pyd" OutputFile="$(OutDir)\$(ProjectName).pyd"
LinkIncremental="1" LinkIncremental="1"
AdditionalLibraryDirectories="&quot;$(DIA_SDK_ROOT)\lib\amd64&quot;;&quot;$(DBG_SDK_ROOT)\lib\amd64&quot;;&quot;$(PYTHON_ROOT)\x64\libs&quot;;&quot;$(BOOST_ROOT)\stage64\lib&quot;" AdditionalLibraryDirectories="&quot;$(DIA_SDK_ROOT)\lib\amd64&quot;;&quot;$(DBG_SDK_ROOT)\lib\amd64&quot;;&quot;$(PYTHON_ROOT)\x64\libs&quot;;&quot;$(BOOST_ROOT)\stage64\lib&quot;"

View File

@ -29,6 +29,7 @@
#include <tchar.h> #include <tchar.h>
#include <windows.h> #include <windows.h>
#include <atlbase.h> #include <atlbase.h>
#include <psapi.h>
#include <dia2.h> #include <dia2.h>