From 8b26c10a0f7893701c49b89a1bb3615aa4a74054 Mon Sep 17 00:00:00 2001 From: "SND\\kernelnet_cp" Date: Mon, 17 Sep 2012 07:19:27 +0000 Subject: [PATCH] [0.2.x] fixed : DiaSymbol::getName git-svn-id: https://pykd.svn.codeplex.com/svn@79630 9b283d60-5439-405e-af05-b73fd8c4d996 --- pykd/dia/diawrapper.cpp | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/pykd/dia/diawrapper.cpp b/pykd/dia/diawrapper.cpp index 2265376..30b489c 100644 --- a/pykd/dia/diawrapper.cpp +++ b/pykd/dia/diawrapper.cpp @@ -432,16 +432,30 @@ ULONG DiaSymbol::getLocType() ////////////////////////////////////////////////////////////////////////////// -static const boost::regex stdcallMatch("^_(\\w+)@.+$"); +static const boost::regex stdcallMatch("^(\\w+)(@\\d+)?$"); std::string DiaSymbol::getName() { BSTR bstrName = NULL; HRESULT hres = m_symbol->get_undecoratedName(&bstrName); if (S_OK != hres) - bstrName = callSymbol(get_name); - autoBstr retValue( bstrName ); - return retValue.asStr(); + bstrName = callSymbol(get_name); + + std::string retStr = autoBstr( bstrName ).asStr(); + + ULONG symTag; + hres = m_symbol->get_symTag( &symTag ); + if ( S_OK == hres && symTag == SymTagPublicSymbol ) + { + retStr.erase( 0, 1 ); + } + + boost::cmatch matchResult; + + if ( boost::regex_match( retStr.c_str(), matchResult, stdcallMatch ) ) + retStr= std::string( matchResult[1].first, matchResult[1].second ); + + return retStr; } ///////////////////////////////////////////////////////////////////////////////