further improved local labels in disassembly

This commit is contained in:
thrust26 2021-01-18 09:33:46 +01:00
parent 9c82f3039c
commit cebf896a71
1 changed files with 3 additions and 8 deletions

View File

@ -712,13 +712,7 @@ bool CartDebug::getLabel(ostream& buf, uInt16 addr, bool isRead,
if(iter != myUserLabels.end()) if(iter != myUserLabels.end())
{ {
// TODO: detect and add SUBROUTINE in saved disassembly // TODO: detect and add SUBROUTINE in saved disassembly
string::size_type pos = iter->second.find_first_of('.', 0); buf << iter->second;
// Remove local prefix in debugger
if(pos != string::npos)
buf << iter->second.substr(pos);
else
buf << iter->second;
return true; return true;
} }
} }
@ -877,7 +871,8 @@ string CartDebug::loadSymbolFile()
const auto& iterA = myUserAddresses.find(shortLabel); const auto& iterA = myUserAddresses.find(shortLabel);
if(iterA != myUserAddresses.end()) if(iterA != myUserAddresses.end())
addLabel(label, value); // add long local label name if short label already exists // if short label already exists, move prefix to suffix and add long local label name
addLabel(shortLabel + "." + label.substr(0, pos), value);
else else
addLabel(shortLabel, value); addLabel(shortLabel, value);
} }