From 8dd29afb06a70b7847485a44fa7af868ec7d8997 Mon Sep 17 00:00:00 2001 From: "SND\\kernelnet_cp" <SND\kernelnet_cp@9b283d60-5439-405e-af05-b73fd8c4d996> Date: Wed, 26 Feb 2014 12:03:05 +0000 Subject: [PATCH] [0.2.x] fixed : issue #12776 ( typeInfo raises exception for templates with pointers ) git-svn-id: https://pykd.svn.codeplex.com/svn@87374 9b283d60-5439-405e-af05-b73fd8c4d996 --- pykd/pykdver.h | 2 +- pykd/typeinfo.cpp | 28 +++++++++++++++++++--------- 2 files changed, 20 insertions(+), 10 deletions(-) diff --git a/pykd/pykdver.h b/pykd/pykdver.h index 1e7a057..90abd7c 100644 --- a/pykd/pykdver.h +++ b/pykd/pykdver.h @@ -2,7 +2,7 @@ #define PYKD_VERSION_MAJOR 0 #define PYKD_VERSION_MINOR 2 #define PYKD_VERSION_SUBVERSION 0 -#define PYKD_VERSION_BUILDNO 28 +#define PYKD_VERSION_BUILDNO 29 #define __VER_STR2__(x) #x diff --git a/pykd/typeinfo.cpp b/pykd/typeinfo.cpp index bc5c486..b3a543a 100644 --- a/pykd/typeinfo.cpp +++ b/pykd/typeinfo.cpp @@ -215,16 +215,21 @@ BaseTypeVariant TypeInfo::getValue() TypeInfoPtr TypeInfo::getTypeInfo( SymbolPtr &symScope, const std::string &symName ) { - size_t pos = symName.find_first_of( "*[" ); + TypeInfoPtr basePtr = getBaseTypeInfo( symName, getTypePointerSize(symScope) ); + if ( basePtr != 0 ) + return basePtr; - if ( pos == std::string::npos ) + SymbolPtr symType; + + try { + + symType = symScope->getChildByName( symName ); + + }catch(SymbolException&) + {} + + if ( symType ) { - TypeInfoPtr basePtr = getBaseTypeInfo( symName, getTypePointerSize(symScope) ); - if ( basePtr != 0 ) - return basePtr; - - SymbolPtr symType = symScope->getChildByName( symName ); - if ( symType->getSymTag() == SymTagData ) { if ( symType->getLocType() == LocIsBitField ) @@ -247,7 +252,12 @@ TypeInfoPtr TypeInfo::getTypeInfo( SymbolPtr &symScope, const std::string &symN return getTypeInfo( symType ); } - return getComplexType( symScope, symName ); + size_t pos = symName.find_first_of( "*[" ); + + if ( pos != std::string::npos ) + return getComplexType( symScope, symName ); + + throw TypeException( symName, "symbol name is not found" ); } /////////////////////////////////////////////////////////////////////////////////////