@@ -2981,12 +2981,10 @@ void SharedCache::FindSymbolAtAddrAndApplyToAddr(
29812981 if (auto symbol = m_dscView->GetSymbolByAddress (symbolLocation))
29822982 {
29832983 // A symbol already exists at the source location. Add a stub symbol at `targetLocation` based on the existing symbol.
2984- auto id = m_dscView->BeginUndoActions ();
29852984 if (m_dscView->GetAnalysisFunction (m_dscView->GetDefaultPlatform (), targetLocation))
2986- m_dscView->DefineUserSymbol (new Symbol (FunctionSymbol, prefix + symbol->GetFullName (), targetLocation));
2985+ m_dscView->DefineAutoUserSymbol (new Symbol (FunctionSymbol, prefix + symbol->GetFullName (), targetLocation));
29872986 else
2988- m_dscView->DefineUserSymbol (new Symbol (symbol->GetType (), prefix + symbol->GetFullName (), targetLocation));
2989- m_dscView->ForgetUndoActions (id);
2987+ m_dscView->DefineAutoUserSymbol (new Symbol (symbol->GetType (), prefix + symbol->GetFullName (), targetLocation));
29902988 return ;
29912989 }
29922990 }
@@ -3019,19 +3017,24 @@ void SharedCache::FindSymbolAtAddrAndApplyToAddr(
30193017 auto typeLib = TypeLibraryForImage (header->installName );
30203018 auto type = typeLib ? m_dscView->ImportTypeLibraryObject (typeLib, {symbol->GetFullName ()}) : nullptr ;
30213019
3020+ QualifiedName demangledName = {};
3021+ std::string shortName = symbol->GetShortName ();
3022+ if (DemangleLLVM (shortName, demangledName, true ))
3023+ shortName = demangledName.GetString ();
3024+
30223025 if (auto func = m_dscView->GetAnalysisFunction (m_dscView->GetDefaultPlatform (), targetLocation))
30233026 {
3024- m_dscView->DefineUserSymbol (
3025- new Symbol (FunctionSymbol, prefix + symbol->GetFullName (), targetLocation));
3027+ m_dscView->DefineAutoUserSymbol (
3028+ new Symbol (FunctionSymbol, shortName, shortName, prefix + symbol->GetFullName (), targetLocation));
30263029 if (type)
30273030 func->SetUserType (type);
30283031 if (triggerReanalysis)
30293032 func->Reanalyze ();
30303033 }
30313034 else
30323035 {
3033- m_dscView->DefineUserSymbol (
3034- new Symbol (symbol->GetType (), prefix + symbol->GetFullName (), targetLocation));
3036+ m_dscView->DefineAutoUserSymbol (
3037+ new Symbol (symbol->GetType (), shortName, shortName, prefix + symbol->GetFullName (), targetLocation));
30353038 if (type)
30363039 m_dscView->DefineUserDataVariable (targetLocation, type);
30373040 }
0 commit comments