mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-04 10:19:23 +02:00
GP-0 Added exception detail for composite resolution error
This commit is contained in:
parent
47bd5a50cb
commit
a63b39d14f
2 changed files with 14 additions and 4 deletions
|
@ -16,6 +16,7 @@
|
|||
package ghidra.program.database.data;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ConcurrentModificationException;
|
||||
import java.util.Objects;
|
||||
|
||||
import db.DBRecord;
|
||||
|
@ -24,6 +25,7 @@ import ghidra.docking.settings.SettingsImpl;
|
|||
import ghidra.program.database.DBObjectCache;
|
||||
import ghidra.program.model.data.*;
|
||||
import ghidra.program.model.mem.MemBuffer;
|
||||
import ghidra.util.Msg;
|
||||
import ghidra.util.UniversalID;
|
||||
import ghidra.util.exception.AssertException;
|
||||
|
||||
|
@ -697,7 +699,13 @@ abstract class CompositeDB extends DataTypeDB implements CompositeInternal {
|
|||
DataTypeComponent[] definedComponents = composite.getDefinedComponents();
|
||||
DataTypeComponentDB[] myDefinedComponents = getDefinedComponents();
|
||||
if (definedComponents.length != myDefinedComponents.length) {
|
||||
throw new IllegalArgumentException("mismatched definition datatype");
|
||||
Msg.error(this,
|
||||
"Resolve failure: unexpected component count detected\nDefinition Type:\n" +
|
||||
definitionDt.toString() + "\nResolving Type:\n" + this.toString());
|
||||
throw new ConcurrentModificationException(
|
||||
"Resolve failure: unexpected component count detected for '" +
|
||||
definitionDt.getPathName() + "' (" + definedComponents.length + " vs " +
|
||||
myDefinedComponents.length + ")");
|
||||
}
|
||||
for (int i = 0; i < definedComponents.length; i++) {
|
||||
DataTypeComponent dtc = definedComponents[i];
|
||||
|
|
|
@ -16,8 +16,7 @@
|
|||
package ghidra.program.database.data;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.*;
|
||||
|
||||
import db.DBRecord;
|
||||
import db.Field;
|
||||
|
@ -241,7 +240,10 @@ class FunctionDefinitionDB extends DataTypeDB implements FunctionDefinition {
|
|||
ParameterDefinition[] definedArguments = funcDef.getArguments();
|
||||
ParameterDefinitionDB[] myArguments = getArguments();
|
||||
if (definedArguments.length != myArguments.length) {
|
||||
throw new IllegalArgumentException("mismatched definition datatype");
|
||||
throw new ConcurrentModificationException(
|
||||
"Resolve failure: unexpected argument count detected for '" +
|
||||
definitionDt.getPathName() + "' (" + definedArguments.length + " vs " +
|
||||
myArguments.length + ")");
|
||||
}
|
||||
for (int i = 0; i < definedArguments.length; i++) {
|
||||
ParameterDefinition arg = definedArguments[i];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue