Skip to content

Commit 74b87de

Browse files
committed
wip
1 parent 43b1fb3 commit 74b87de

File tree

2 files changed

+12
-9
lines changed

2 files changed

+12
-9
lines changed

view/sharedcache/core/SharedCache.cpp

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -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
}

view/sharedcache/workflow/SharedCacheWorkflow.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ void SharedCacheWorkflow::FixupStubs(Ref<AnalysisContext> ctx)
235235
if (auto symbol = bv->GetSymbolByAddress(dest.GetConstant()))
236236
{
237237
auto newSymbol = new Symbol(FunctionSymbol, "j_" + symbol->GetRawName(), func->GetStart());
238-
bv->DefineUserSymbol(newSymbol);
238+
bv->DefineAutoUserSymbol(newSymbol);
239239
}
240240
}
241241
}

0 commit comments

Comments
 (0)