Fix renaming a function from disassembly.

This commit is contained in:
Unknown W. Brackets 2014-02-11 07:45:13 -08:00
parent e9fa37b4de
commit d279dcd454
4 changed files with 9 additions and 7 deletions

View File

@ -728,7 +728,7 @@ void SymbolMap::AddLabel(const char* name, u32 address, int moduleIndex) {
}
}
void SymbolMap::SetLabelName(const char* name, u32 address) {
void SymbolMap::SetLabelName(const char* name, u32 address, bool updateImmediately) {
lock_guard guard(lock_);
auto labelInfo = activeLabels.find(address);
if (labelInfo == activeLabels.end()) {
@ -740,9 +740,11 @@ void SymbolMap::SetLabelName(const char* name, u32 address) {
strcpy(label->second.name,name);
label->second.name[127] = 0;
// Do we really need to call this here? Causes extreme startup slowdown
// as this gets called for every function identified by the function replacement code.
// UpdateActiveSymbols();
// Allow the caller to skip this as it causes extreme startup slowdown
// when this gets called for every function identified by the function replacement code.
if (updateImmediately) {
UpdateActiveSymbols();
}
}
}
}

View File

@ -98,7 +98,7 @@ public:
void AddLabel(const char* name, u32 address, int moduleIndex = -1);
std::string GetLabelString(u32 address) const;
void SetLabelName(const char* name, u32 address);
void SetLabelName(const char* name, u32 address, bool updateImmediately = true);
bool GetLabelValue(const char* name, u32& dest);
void AddData(u32 address, u32 size, DataType type, int moduleIndex = -1);

View File

@ -641,7 +641,7 @@ skip:
char defaultLabel[256];
// If it was renamed, keep it. Only change the name if it's still the default.
if (existingLabel.empty() || !strcmp(existingLabel.c_str(), DefaultFunctionName(defaultLabel, f.start))) {
symbolMap.SetLabelName(mf->name, f.start);
symbolMap.SetLabelName(mf->name, f.start, false);
}
}
}

View File

@ -115,7 +115,7 @@ unsigned int WINAPI TheThread(void *)
}
NativeInitGraphics();
NativeResized();
NativeResized();
INFO_LOG(BOOT, "Done.");
_dbg_update_();