mirror of
https://github.com/ivellioscolin/pykd.git
synced 2025-04-29 20:03:33 +08:00
[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:
parent
92538913e1
commit
1bdfc6e278
@ -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" ) );
|
||||||
|
@ -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=""$(DIA_SDK_ROOT)\lib";"$(DBG_SDK_ROOT)\lib\i386";"$(PYTHON_ROOT)\x86\libs";"$(BOOST_ROOT)\stage\lib""
|
AdditionalLibraryDirectories=""$(DIA_SDK_ROOT)\lib";"$(DBG_SDK_ROOT)\lib\i386";"$(PYTHON_ROOT)\x86\libs";"$(BOOST_ROOT)\stage\lib""
|
||||||
@ -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=""$(DIA_SDK_ROOT)\lib\amd64";"$(DBG_SDK_ROOT)\lib\amd64";"$(PYTHON_ROOT)\x64\libs";"$(BOOST_ROOT)\stage64\lib""
|
AdditionalLibraryDirectories=""$(DIA_SDK_ROOT)\lib\amd64";"$(DBG_SDK_ROOT)\lib\amd64";"$(PYTHON_ROOT)\x64\libs";"$(BOOST_ROOT)\stage64\lib""
|
||||||
@ -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=""$(DIA_SDK_ROOT)\lib";"$(DBG_SDK_ROOT)\lib\i386";"$(PYTHON_ROOT)\x86\libs";"$(BOOST_ROOT)\stage\lib""
|
AdditionalLibraryDirectories=""$(DIA_SDK_ROOT)\lib";"$(DBG_SDK_ROOT)\lib\i386";"$(PYTHON_ROOT)\x86\libs";"$(BOOST_ROOT)\stage\lib""
|
||||||
@ -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=""$(DIA_SDK_ROOT)\lib\amd64";"$(DBG_SDK_ROOT)\lib\amd64";"$(PYTHON_ROOT)\x64\libs";"$(BOOST_ROOT)\stage64\lib""
|
AdditionalLibraryDirectories=""$(DIA_SDK_ROOT)\lib\amd64";"$(DBG_SDK_ROOT)\lib\amd64";"$(PYTHON_ROOT)\x64\libs";"$(BOOST_ROOT)\stage64\lib""
|
||||||
|
@ -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>
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user