Commit a7855ea4 authored by SND\kernelnet_cp's avatar SND\kernelnet_cp
Browse files

[pykd] added: debuggerPath routine ( Return full path to the process image that uses pykd )


git-svn-id: https://pykd.svn.codeplex.com/svn@70089 9b283d60-5439-405e-af05-b73fd8c4d996
parent 4dc9bba0
......@@ -221,6 +221,8 @@ BOOST_PYTHON_MODULE( pykd )
"Delete synthetic symbols by virtual address" );
boost::python::def( "delSynSymbolsMask", &delSyntheticSymbolsMask,
"Delete synthetic symbols by mask of module and symbol name");
boost::python::def( "debuggerPath", &getDebuggerImage,
"Return full path to the process image that uses pykd" );
boost::python::class_<TypeInfo>( "typeInfo",
"Class representing non-primitive type info: structure, union, etc. attributes is a fields of non-primitive type" )
......@@ -253,7 +255,7 @@ BOOST_PYTHON_MODULE( pykd )
DEF_PY_GLOBAL( "ulong_t", TypeInfo("", "unsigned long") );
DEF_PY_GLOBAL( "int_t", TypeInfo("", "int") );
DEF_PY_GLOBAL( "uint_t", TypeInfo("", "unsigned int") );
DEF_PY_GLOBAL( "ptr_t", TypeInfo("", "void*") );
//DEF_PY_GLOBAL( "ptr_t", TypeInfo("", "void*") );
DEF_PY_GLOBAL( "double_t", TypeInfo("", "double") );
DEF_PY_GLOBAL( "longlong_t", TypeInfo("", "int64") );
DEF_PY_GLOBAL( "ulonglong_t", TypeInfo("", "unsigned int64") );
......
#include "stdafx.h"
#include <psapi.h>
#include "dbgext.h"
#include "dbgexcept.h"
#include "dbgsystem.h"
......@@ -124,3 +126,13 @@ isDumpAnalyzing()
}
///////////////////////////////////////////////////////////////////////////////////
std::string
getDebuggerImage()
{
std::vector<char> buffer(MAX_PATH);
GetModuleFileNameExA( GetCurrentProcess(), NULL, &buffer[0], buffer.size() );
return std::string( &buffer[0] );
}
///////////////////////////////////////////////////////////////////////////////////
\ No newline at end of file
......@@ -28,4 +28,8 @@ isKernelDebugging();
bool
isDumpAnalyzing();
std::string
getDebuggerImage();
/////////////////////////////////////////////////////////////////////////////////
\ No newline at end of file
......@@ -66,7 +66,7 @@
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="dbgeng.lib "
AdditionalDependencies="dbgeng.lib dbghelp.lib psapi.lib"
OutputFile="$(OutDir)\$(ProjectName).pyd"
LinkIncremental="2"
AdditionalLibraryDirectories="&quot;$(DBG_SDK_ROOT)\lib\i386&quot;;&quot;$(PYTHON_ROOT)\x86\libs&quot;;&quot;$(BOOST_ROOT)\stage\lib&quot;"
......@@ -151,7 +151,7 @@
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="dbgeng.lib dbghelp.lib"
AdditionalDependencies="dbgeng.lib dbghelp.lib psapi.lib"
OutputFile="$(OutDir)\$(ProjectName).pyd"
LinkIncremental="2"
AdditionalLibraryDirectories="&quot;$(DBG_SDK_ROOT)\lib\amd64&quot;;&quot;$(PYTHON_ROOT)\x64\libs&quot;;&quot;$(BOOST_ROOT)\stage64\lib&quot;"
......@@ -230,7 +230,7 @@
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="dbgeng.lib"
AdditionalDependencies="dbgeng.lib dbghelp.lib psapi.lib"
OutputFile="$(OutDir)\$(ProjectName).pyd"
LinkIncremental="1"
AdditionalLibraryDirectories="&quot;$(DBG_SDK_ROOT)\lib\i386&quot;;&quot;$(PYTHON_ROOT)\x86\libs&quot;;&quot;$(BOOST_ROOT)\stage\lib&quot;"
......@@ -311,7 +311,7 @@
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="dbgeng.lib dbghelp.lib"
AdditionalDependencies="dbgeng.lib dbghelp.lib psapi.lib"
OutputFile="$(OutDir)\$(ProjectName).pyd"
LinkIncremental="1"
AdditionalLibraryDirectories="&quot;$(DBG_SDK_ROOT)\lib\amd64&quot;;&quot;$(PYTHON_ROOT)\x64\libs&quot;;&quot;$(BOOST_ROOT)\stage64\lib&quot;"
......
......@@ -70,7 +70,7 @@
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="dbgeng.lib "
AdditionalDependencies="dbgeng.lib psapi.lib"
OutputFile="$(OutDir)\$(ProjectName).pyd"
LinkIncremental="2"
AdditionalLibraryDirectories="&quot;$(DBG_SDK_ROOT)\lib\i386&quot;;&quot;$(PYTHON_ROOT)\x86\libs&quot;;&quot;$(BOOST_ROOT)\stage\lib&quot;"
......@@ -151,7 +151,7 @@
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="dbgeng.lib"
AdditionalDependencies="dbgeng.lib psapi.lib"
OutputFile="$(OutDir)\$(ProjectName).pyd"
LinkIncremental="2"
AdditionalLibraryDirectories="&quot;$(DBG_SDK_ROOT)\lib\amd64&quot;;&quot;$(PYTHON_ROOT)\x64\libs&quot;;&quot;$(BOOST_ROOT)\stage64\lib&quot;"
......@@ -227,7 +227,7 @@
<Tool
Name="VCLinkerTool"
AdditionalOptions="/pdbpath:none"
AdditionalDependencies="dbgeng.lib"
AdditionalDependencies="dbgeng.lib psapi.lib"
OutputFile="$(OutDir)\$(ProjectName).pyd"
LinkIncremental="1"
AdditionalLibraryDirectories="&quot;$(DBG_SDK_ROOT)\lib\i386&quot;;&quot;$(PYTHON_ROOT)\x86\libs&quot;;&quot;$(BOOST_ROOT)\stage\lib&quot;"
......@@ -306,7 +306,7 @@
<Tool
Name="VCLinkerTool"
AdditionalOptions="/pdbpath:none"
AdditionalDependencies="dbgeng.lib"
AdditionalDependencies="dbgeng.lib psapi.lib"
OutputFile="$(OutDir)\$(ProjectName).pyd"
LinkIncremental="1"
AdditionalLibraryDirectories="&quot;$(DBG_SDK_ROOT)\lib\amd64&quot;;&quot;$(PYTHON_ROOT)\x64\libs&quot;;&quot;$(BOOST_ROOT)\stage64\lib&quot;"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment