[0.1.x] fixed : getting typedVar( addr ) for release symbols

git-svn-id: https://pykd.svn.codeplex.com/svn@72735 9b283d60-5439-405e-af05-b73fd8c4d996
This commit is contained in:
SND\kernelnet_cp 2011-12-28 08:32:02 +00:00 committed by Mikhail I. Izmestev
parent 0f1d3aa124
commit 73cbf9b728
3 changed files with 37 additions and 11 deletions

View File

@ -190,18 +190,44 @@ Module::getTypedVarByName( const std::string &symName )
TypedVarPtr
Module::getTypedVarByAddr( ULONG64 addr )
{
HRESULT hres;
addr = addr64(addr);
if ( addr < m_base || addr > getEnd() )
throw DbgException( "address is out of the module space" );
LONG displacement;
pyDia::SymbolPtr diaSym =
getDia()->findByRvaImpl((ULONG)(addr - m_base), SymTagData, displacement);
if (displacement)
throw DbgException( "not exactly match by RVA" );
char nameBuf[0x100];
return TypedVar::getTypedVar( m_client, TypeInfo::getTypeInfo( diaSym->getType() ), addr );
hres =
m_symbols->GetNameByOffset(
addr,
nameBuf,
sizeof(nameBuf),
NULL,
NULL );
std::string fullName( nameBuf );
size_t symPos = fullName.find ( '!' ) + 1;
std::string symbolName;
symbolName.assign( fullName, symPos, fullName.length() - symPos );
if ( FAILED(hres) )
throw DbgException( "failed IDebugSymbols::GetNameByOffset" );
return getTypedVarByName( symbolName );
//LONG displacement;
//pyDia::SymbolPtr diaSym =
// getDia()->findByRvaImpl((ULONG)(addr - m_base), SymTagData, displacement);
//if (displacement)
// throw DbgException( "not exactly match by RVA" );
//return TypedVar::getTypedVar( m_client, TypeInfo::getTypeInfo( diaSym->getType() ), addr );
}
///////////////////////////////////////////////////////////////////////////////////

View File

@ -53,8 +53,8 @@ END
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 0,1,0,2
PRODUCTVERSION 0,1,0,2
FILEVERSION 0,1,0,3
PRODUCTVERSION 0,1,0,3
FILEFLAGSMASK 0x17L
#ifdef _DEBUG
FILEFLAGS 0x1L
@ -70,11 +70,11 @@ BEGIN
BLOCK "041904b0"
BEGIN
VALUE "FileDescription", "pykd - python extension for windbg"
VALUE "FileVersion", "0, 1, 0, 2"
VALUE "FileVersion", "0, 1, 0, 3"
VALUE "InternalName", "pykd"
VALUE "OriginalFilename", "pykd.dll"
VALUE "ProductName", "pykd - python extension for windbg"
VALUE "ProductVersion", "0, 1, 0, 2"
VALUE "ProductVersion", "0, 1, 0, 3"
END
END
BLOCK "VarFileInfo"

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="windows-1251"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="9.00"
Version="9,00"
Name="targetapp"
ProjectGUID="{C6254E16-AB8E-41EE-887D-31458E93FC68}"
RootNamespace="targetapp"