mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-12-05 20:24:01 +01:00
Avoid returning points from the symbol map.
Now that it uses a lookup, this is even more dangerous. But, the maps could be reordered while it's trying to print the pointer and cause that data to become invalid. This should be safe from race conditions.
This commit is contained in:
1 parent
b1af4f4911
commit
76afb2a8d5
11 files changed
+69
-50
No files matched your search
@@ -333,9 +333,7 @@ u32 SymbolMap::GetNextSymbolAddress(u32 address, SymbolType symmask) {
|
||||
return dataAddress;
|
||||
}
|
||||
|
||||
static char descriptionTemp[256];
|
||||
|
||||
const char *SymbolMap::GetDescription(unsigned int address) const {
|
||||
std::string SymbolMap::GetDescription(unsigned int address) const {
|
||||
lock_guard guard(lock_);
|
||||
const char* labelName = NULL;
|
||||
|
||||
@@ -351,6 +349,7 @@ const char *SymbolMap::GetDescription(unsigned int address) const {
|
||||
if (labelName != NULL)
|
||||
return labelName;
|
||||
|
||||
char descriptionTemp[256];
|
||||
sprintf(descriptionTemp, "(%08x)", address);
|
||||
return descriptionTemp;
|
||||
}
|
||||
@@ -742,6 +741,14 @@ const char *SymbolMap::GetLabelNameRel(u32 relAddress, int moduleIndex) const {
|
||||
return it->second.name;
|
||||
}
|
||||
|
||||
std::string SymbolMap::GetLabelString(u32 address) const {
|
||||
lock_guard guard(lock_);
|
||||
const char *label = GetLabelName(address);
|
||||
if (label == NULL)
|
||||
return "";
|
||||
return label;
|
||||
}
|
||||
|
||||
bool SymbolMap::GetLabelValue(const char* name, u32& dest) {
|
||||
lock_guard guard(lock_);
|
||||
for (auto it = activeLabels.begin(); it != activeLabels.end(); it++) {
|
||||
|
||||
Reference in new issue
Block a user