mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-04 02:09:44 +02:00
GT-2961 - Adjust DataTypeManagerDB
This commit is contained in:
parent
860fe5a2d7
commit
f53e6ce60d
1 changed files with 9 additions and 22 deletions
|
@ -1255,17 +1255,17 @@ abstract public class DataTypeManagerDB implements DataTypeManager {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
// try to deal with datatypes that have '/' chars in their name.
|
// Use a category path to parse the datatype path because it knows how to deal with
|
||||||
Category category = getLowestLevelCategory(dataTypePath);
|
// escaped forward slashes.
|
||||||
|
CategoryPath parsedPath = new CategoryPath(dataTypePath);
|
||||||
|
CategoryPath categoryPath = parsedPath.getParent();
|
||||||
|
String dataTypeName = parsedPath.getName();
|
||||||
|
Category category = getCategory(categoryPath);
|
||||||
|
|
||||||
if (category != null) {
|
if (category == null) {
|
||||||
CategoryPath categoryPath = category.getCategoryPath();
|
return null;
|
||||||
String path = categoryPath.getPath();
|
|
||||||
int dataTypeNameStartIndex = path.endsWith("/") ? path.length() : path.length() + 1; // +1 to get past the last '/'
|
|
||||||
String dataTypeName = dataTypePath.substring(dataTypeNameStartIndex);
|
|
||||||
return category.getDataType(dataTypeName);
|
|
||||||
}
|
}
|
||||||
return null;
|
return category.getDataType(dataTypeName);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -1273,19 +1273,6 @@ abstract public class DataTypeManagerDB implements DataTypeManager {
|
||||||
return getDataType(dataTypePath);
|
return getDataType(dataTypePath);
|
||||||
}
|
}
|
||||||
|
|
||||||
private Category getLowestLevelCategory(String dataTypePath) {
|
|
||||||
CategoryPath pathParser = new CategoryPath(dataTypePath); // Use a category path to parse the path.
|
|
||||||
while (pathParser != null) {
|
|
||||||
CategoryPath path = pathParser.getParent();
|
|
||||||
Category category = getCategory(path);
|
|
||||||
if (category != null) {
|
|
||||||
return category;
|
|
||||||
}
|
|
||||||
pathParser = path;
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void findEnumValueNames(long value, Set<String> enumValueNames) {
|
public void findEnumValueNames(long value, Set<String> enumValueNames) {
|
||||||
buildEnumValueMap();
|
buildEnumValueMap();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue