Skip to content

Ghidra is a software reverse engineering (SRE) framework

Merge remote-tracking branch 'origin/patch'

Ryan Kurtz046623b1f7d5
diff --cc Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/lang/BasicCompilerSpec.java
index 274e7d9361,6f82352b27..921d6d25a1
--- a/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/lang/BasicCompilerSpec.java
+++ b/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/lang/BasicCompilerSpec.java
@@@ -447,19 -504,18 +465,22 @@@ public class BasicCompilerSpec implemen
/**
* Establish cross referencing to prototype models.
* All xrefs are regenerated from a single complete list of PrototypeModels.
+ * If there are PrototypeModels with duplicate names, return an example name.
+ * Return null otherwise
+ * The modelList must provide a model with name matching defaultName or
+ * an exception is thrown. (In theory the schema guarantees this model always exists)
*
* @param modelList is the complete list of models
- * @param defaultName is the name to use for the default model (or null)
+ * @param defaultName is the name to use for the default model
* @param evalCurrent is the name to use for evaluating the current function (or null)
* @param evalCalled is the name to use for evaluating called functions (or null)
+ * @return a PrototypeModel name that was duplicated or null
+ * @throws XmlParseException if there is no model matching defaultName
*/
- protected void modelXrefs(List<PrototypeModel> modelList, String defaultName,
+ protected String modelXrefs(List<PrototypeModel> modelList, String defaultName,
- String evalCurrent, String evalCalled) {
+ String evalCurrent, String evalCalled) throws XmlParseException {
+ String foundDuplicate = null;
- buildModelArrays(modelList);
+ buildModelArrays(modelList, defaultName);
callingConventionMap = new HashMap<>();
for (PrototypeModel model : models) {
String name = model.getName();