Skip to content

Ghidra is a software reverse engineering (SRE) framework

GP-1797 removed unused DataTypeConflictException

ghidra101067debde72
diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/register/DebuggerRegistersProvider.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/register/DebuggerRegistersProvider.java
index 4fda299f8d..7ae54dabd0 100644
--- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/register/DebuggerRegistersProvider.java
+++ b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/register/DebuggerRegistersProvider.java
@@ -62,7 +62,8 @@ import ghidra.framework.plugintool.AutoService;
import ghidra.framework.plugintool.ComponentProviderAdapter;
import ghidra.framework.plugintool.annotation.AutoServiceConsumed;
import ghidra.program.model.address.*;
-import ghidra.program.model.data.*;
+import ghidra.program.model.data.DataType;
+import ghidra.program.model.data.DataTypeEncodeException;
import ghidra.program.model.lang.*;
import ghidra.program.model.util.CodeUnitInsertionException;
import ghidra.trace.model.*;
@@ -840,7 +841,7 @@ public class DebuggerRegistersProvider extends ComponentProviderAdapter
}
tid.commit();
}
- catch (CodeUnitInsertionException | DataTypeConflictException | CancelledException e) {
+ catch (CodeUnitInsertionException | CancelledException e) {
throw new AssertionError(e);
}
}
diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/watch/DebuggerWatchesProvider.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/watch/DebuggerWatchesProvider.java
index d59bf50ab3..c5ab82c7d8 100644
--- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/watch/DebuggerWatchesProvider.java
+++ b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/watch/DebuggerWatchesProvider.java
@@ -60,7 +60,6 @@ import ghidra.framework.plugintool.annotation.AutoServiceConsumed;
import ghidra.pcode.exec.trace.TraceSleighUtils;
import ghidra.program.model.address.*;
import ghidra.program.model.data.DataType;
-import ghidra.program.model.data.DataTypeConflictException;
import ghidra.program.model.lang.Register;
import ghidra.program.model.listing.*;
import ghidra.program.model.util.CodeUnitInsertionException;
@@ -528,7 +527,7 @@ public class DebuggerWatchesProvider extends ComponentProviderAdapter {
listing.clearCodeUnits(row.getAddress(), row.getRange().getMaxAddress(), false);
listing.createData(address, dataType, size);
}
- catch (CodeUnitInsertionException | DataTypeConflictException e) {
+ catch (CodeUnitInsertionException e) {
errs.add(address + " " + dataType + "(" + size + "): " + e.getMessage());
}
}
diff --git a/Ghidra/Debug/Debugger/src/test/java/ghidra/app/plugin/core/debug/gui/DebuggerManualTest.java b/Ghidra/Debug/Debugger/src/test/java/ghidra/app/plugin/core/debug/gui/DebuggerManualTest.java
index f325f2e6c1..9ee084271b 100644
--- a/Ghidra/Debug/Debugger/src/test/java/ghidra/app/plugin/core/debug/gui/DebuggerManualTest.java
+++ b/Ghidra/Debug/Debugger/src/test/java/ghidra/app/plugin/core/debug/gui/DebuggerManualTest.java
@@ -41,7 +41,6 @@ import ghidra.app.plugin.core.symtable.SymbolTablePlugin;
import ghidra.app.plugin.debug.MemoryUsagePlugin;
import ghidra.framework.plugintool.util.PluginException;
import ghidra.program.model.address.AddressOverflowException;
-import ghidra.program.model.data.DataTypeConflictException;
import ghidra.program.model.data.Undefined4DataType;
import ghidra.program.model.lang.Language;
import ghidra.program.model.util.CodeUnitInsertionException;
@@ -78,7 +77,7 @@ public class DebuggerManualTest extends AbstractGhidraHeadedDebuggerGUITest {
@Test
@Ignore
public void testManual01() throws PluginException, CodeUnitInsertionException,
- DataTypeConflictException, AddressOverflowException, DuplicateNameException,
+ AddressOverflowException, DuplicateNameException,
TraceOverlappedRegionException, InterruptedException {
addPlugin(tool, DebuggerBreakpointMarkerPlugin.class);
diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/analyzers/CondenseFillerBytesAnalyzer.java b/Ghidra/Features/Base/src/main/java/ghidra/app/analyzers/CondenseFillerBytesAnalyzer.java
index 3f7a7339a0..24f2557df7 100644
--- a/Ghidra/Features/Base/src/main/java/ghidra/app/analyzers/CondenseFillerBytesAnalyzer.java
+++ b/Ghidra/Features/Base/src/main/java/ghidra/app/analyzers/CondenseFillerBytesAnalyzer.java
@@ -23,7 +23,6 @@ import ghidra.app.util.importer.MessageLog;
import ghidra.framework.options.Options;
import ghidra.program.model.address.*;
import ghidra.program.model.data.AlignmentDataType;
-import ghidra.program.model.data.DataTypeConflictException;
import ghidra.program.model.listing.*;
import ghidra.program.model.mem.Memory;
import ghidra.program.model.mem.MemoryAccessException;
@@ -213,12 +212,6 @@ public class CondenseFillerBytesAnalyzer extends AbstractAnalyzer {
"Unable to condense filler bytes (bad filler value?) at " + fillerAddress, e);
return;
}
- catch (DataTypeConflictException e) {
- // shouldn't happen if we have true filler bytes
- Msg.error(this,
- "Unable to condense filler bytes (bad filler value?) at " + fillerAddress, e);
- return;
- }
}
@Override
diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/cmd/data/CreateDataBackgroundCmd.java b/Ghidra/Features/Base/src/main/java/ghidra/app/cmd/data/CreateDataBackgroundCmd.java
index d2110e35f6..dfe3b01571 100644
--- a/Ghidra/Features/Base/src/main/java/ghidra/app/cmd/data/CreateDataBackgroundCmd.java
+++ b/Ghidra/Features/Base/src/main/java/ghidra/app/cmd/data/CreateDataBackgroundCmd.java
@@ -18,7 +18,8 @@ package ghidra.app.cmd.data;
import ghidra.framework.cmd.BackgroundCommand;
import ghidra.framework.model.DomainObject;
import ghidra.program.model.address.*;
-import ghidra.program.model.data.*;
+import ghidra.program.model.data.DataType;
+import ghidra.program.model.data.DataUtilities;
import ghidra.program.model.listing.*;
import ghidra.program.model.util.CodeUnitInsertionException;
import ghidra.util.Swing;
@@ -126,8 +127,7 @@ public class CreateDataBackgroundCmd extends BackgroundCommand {
}
private void createData(Address start, Address end, DataType dataType, Program p,
- TaskMonitor monitor)
- throws AddressOverflowException, CodeUnitInsertionException, DataTypeConflictException {
+ TaskMonitor monitor) throws AddressOverflowException, CodeUnitInsertionException {
Listing listing = p.getListing();
listing.clearCodeUnits(start, end, false);
diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/analysis/ConstantPropagationAnalyzer.java b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/analysis/ConstantPropagationAnalyzer.java
index f28b2f29e2..352638a57c 100644
--- a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/analysis/ConstantPropagationAnalyzer.java
+++ b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/analysis/ConstantPropagationAnalyzer.java
@@ -459,9 +459,6 @@ public class ConstantPropagationAnalyzer extends AbstractAnalyzer {
catch (CodeUnitInsertionException e) {
// don't care; we tried
}
- catch (DataTypeConflictException e) {
- // don't care; we tried
- }
}
@Override
diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/analysis/PefDebugAnalyzer.java b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/analysis/PefDebugAnalyzer.java
index aaa037684e..546bc39bd9 100644
--- a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/analysis/PefDebugAnalyzer.java
+++ b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/analysis/PefDebugAnalyzer.java
@@ -20,7 +20,8 @@ import ghidra.app.util.bin.format.pef.PefDebug;
import ghidra.app.util.importer.MessageLog;
import ghidra.app.util.opinion.PefLoader;
import ghidra.program.model.address.*;
-import ghidra.program.model.data.*;
+import ghidra.program.model.data.DataType;
+import ghidra.program.model.data.DataUtilities;
import ghidra.program.model.data.DataUtilities.ClearDataMode;
import ghidra.program.model.listing.*;
import ghidra.program.model.mem.Memory;
@@ -69,8 +70,8 @@ public class PefDebugAnalyzer extends AbstractAnalyzer {
}
private void applyStructure(Program program, Address address) throws MemoryAccessException,
- AddressOutOfBoundsException, CodeUnitInsertionException, DataTypeConflictException,
- DuplicateNameException, InvalidInputException, CircularDependencyException {
+ AddressOutOfBoundsException, CodeUnitInsertionException, DuplicateNameException,
+ InvalidInputException, CircularDependencyException {
Listing listing = program.getListing();
Memory memory = program.getMemory();
diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/assembler/PatchDataAction.java b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/assembler/PatchDataAction.java
index 5ce17b4cfb..cd1a666979 100644
--- a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/assembler/PatchDataAction.java
+++ b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/assembler/PatchDataAction.java
@@ -29,7 +29,8 @@ import docking.widgets.fieldpanel.support.FieldLocation;
import ghidra.framework.plugintool.Plugin;
import ghidra.program.database.util.ProgramTransaction;
import ghidra.program.model.address.*;
-import ghidra.program.model.data.*;
+import ghidra.program.model.data.DataType;
+import ghidra.program.model.data.DataTypeEncodeException;
import ghidra.program.model.listing.*;
import ghidra.program.model.mem.MemoryAccessException;
import ghidra.program.model.util.CodeUnitInsertionException;
@@ -146,7 +147,7 @@ public class PatchDataAction extends AbstractPatchAction {
catch (MemoryAccessException e) {
Msg.showError(this, null, "Patch Failure", e.getMessage(), e);
}
- catch (CodeUnitInsertionException | DataTypeConflictException e) {
+ catch (CodeUnitInsertionException e) {
throw new AssertionError(); // Should have been cleared first
}
}
diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/compositeeditor/CompEditorModel.java b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/compositeeditor/CompEditorModel.java
index b9a6df69e2..c56a6065f2 100644
--- a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/compositeeditor/CompEditorModel.java
+++ b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/compositeeditor/CompEditorModel.java
@@ -527,12 +527,10 @@ public abstract class CompEditorModel extends CompositeEditorModel {
*
* @throws InvalidDataTypeException if the structure being edited is part
* of the data type being inserted or if inserting isn't allowed.
- * @throws DataTypeConflictException if creating the data type or one of
- * its sub-parts conflicted with an existing data type.
*/
@Override
public DataTypeComponent insert(int rowIndex, DataType datatype, int length)
- throws UsrException {
+ throws InvalidDataTypeException, UsrException {
if (isEditingField()) {
endFieldEditing();
@@ -999,8 +997,7 @@ public abstract class CompEditorModel extends CompositeEditorModel {
public abstract void clearComponents(int[] rows) throws UsrException;
@Override
- protected void createArray(int numElements)
- throws InvalidDataTypeException, DataTypeConflictException, UsrException {
+ protected void createArray(int numElements) throws InvalidDataTypeException, UsrException {
if (selection.getNumRanges() != 1) {
throw new UsrException("Can only create arrays on a contiguous selection.");
}
diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/compositeeditor/CompositeEditorModel.java b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/compositeeditor/CompositeEditorModel.java
index 2dcc67dbc2..a7d63a4f85 100644
--- a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/compositeeditor/CompositeEditorModel.java
+++ b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/compositeeditor/CompositeEditorModel.java
@@ -509,8 +509,7 @@ public abstract class CompositeEditorModel extends CompositeViewerModel implemen
}
}
- protected void createArray(int numElements)
- throws InvalidDataTypeException, DataTypeConflictException, UsrException {
+ protected void createArray(int numElements) throws InvalidDataTypeException, UsrException {
if (selection.getNumRanges() != 1) {
throw new UsrException("Can only create arrays on a contiguous selection.");
}
diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/compositeeditor/StructureEditorModel.java b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/compositeeditor/StructureEditorModel.java
index d4849fbd5d..549eae7cda 100644
--- a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/compositeeditor/StructureEditorModel.java
+++ b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/compositeeditor/StructureEditorModel.java
@@ -1091,7 +1091,7 @@ class StructureEditorModel extends CompEditorModel {
}
public void createInternalStructure(TaskMonitor monitor)
- throws InvalidDataTypeException, DataTypeConflictException, UsrException {
+ throws InvalidDataTypeException, UsrException {
if (selection.getNumRanges() != 1) {
throw new UsrException("Can only create structure on a contiguous selection.");
diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/compositeeditor/UnionEditorModel.java b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/compositeeditor/UnionEditorModel.java
index bab34d67dd..4259e228a4 100644
--- a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/compositeeditor/UnionEditorModel.java
+++ b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/compositeeditor/UnionEditorModel.java
@@ -187,8 +187,7 @@ class UnionEditorModel extends CompEditorModel {
}
@Override
- protected void createArray(int numElements)
- throws InvalidDataTypeException, DataTypeConflictException, UsrException {
+ protected void createArray(int numElements) throws InvalidDataTypeException, UsrException {
if (getNumSelectedComponentRows() != 1) {
throw new UsrException("Select an individual component to create an array.");
}
@@ -362,11 +361,10 @@ class UnionEditorModel extends CompEditorModel {
*
* @throws InvalidDataTypeException if the union being edited is part
* of the data type being inserted or if inserting isn't allowed.
- * @throws DataTypeConflictException if creating the data type or one of
- * its sub-parts conflicted with an existing data type.
*/
@Override
- public DataTypeComponent insert(int rowIndex, DataType dt, int dtLength) throws UsrException {
+ public DataTypeComponent insert(int rowIndex, DataType dt, int dtLength)
+ throws InvalidDataTypeException, UsrException {
if (dt.equals(DataType.DEFAULT)) {
throw new InvalidDataTypeException(
"Inserting undefined bytes is not allowed in a union.");
diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/disassembler/AddressTable.java b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/disassembler/AddressTable.java
index 79202a7e6e..54387a4646 100644
--- a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/disassembler/AddressTable.java
+++ b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/disassembler/AddressTable.java
@@ -351,120 +351,118 @@ public class AddressTable {
// create table size dw's after the jmp
// (could create as an array)
- try {
- // create a case label
- Symbol curSymbol = program.getSymbolTable().getPrimarySymbol(tableAddr);
- if (curSymbol != null && curSymbol.getName().startsWith("Addr")) {
- tableNameLabel = new AddLabelCmd(tableAddr, tableName, true, SourceType.ANALYSIS);
- }
- else {
- tableNameLabel = new AddLabelCmd(tableAddr, tableName, true, SourceType.ANALYSIS);
- }
- Address lastAddress = null;
- DataType ptrDT = program.getDataTypeManager().addDataType(
- PointerDataType.getPointer(null, addrSize), null);
- for (int i = 0; i < tableSize; i++) {
- Address loc = tableAddr.add(i * addrSize);
+ // create a case label
+ Symbol curSymbol = program.getSymbolTable().getPrimarySymbol(tableAddr);
+ if (curSymbol != null && curSymbol.getName().startsWith("Addr")) {
+ tableNameLabel = new AddLabelCmd(tableAddr, tableName, true, SourceType.ANALYSIS);
+ }
+ else {
+ tableNameLabel = new AddLabelCmd(tableAddr, tableName, true, SourceType.ANALYSIS);
+ }
+
+ Address lastAddress = null;
+ DataType ptrDT = program.getDataTypeManager()
+ .addDataType(
+ PointerDataType.getPointer(null, addrSize), null);
+ for (int i = 0; i < tableSize; i++) {
+ Address loc = tableAddr.add(i * addrSize);
+ try {
try {
- try {
- program.getListing().createData(loc, ptrDT, addrSize);
+ program.getListing().createData(loc, ptrDT, addrSize);
+ }
+ catch (CodeUnitInsertionException e) {
+ CodeUnit cu = listing.getCodeUnitAt(loc);
+ if (cu instanceof Instruction) {
+ break;
}
- catch (CodeUnitInsertionException e) {
- CodeUnit cu = listing.getCodeUnitAt(loc);
- if (cu instanceof Instruction) {
+ if (cu == null) {
+ Msg.warn(this, "Couldn't get data at ");
+ cu = listing.getDefinedDataContaining(loc);
+ if (cu == null || cu instanceof Instruction) {
break;
}
+ cu = ((Data) cu).getPrimitiveAt((int) loc.subtract(cu.getMinAddress()));
if (cu == null) {
- Msg.warn(this, "Couldn't get data at ");
- cu = listing.getDefinedDataContaining(loc);
- if (cu == null || cu instanceof Instruction) {
- break;
- }
- cu = ((Data) cu).getPrimitiveAt((int) loc.subtract(cu.getMinAddress()));
- if (cu == null) {
- break;
- }
- }
- if (!((Data) cu).isPointer()) {
- listing.clearCodeUnits(loc, loc.add(addrSize - 1), false);
- program.getListing().createData(loc, ptrDT, addrSize);
- }
- }
- }
- catch (CodeUnitInsertionException e) {
- }
- Data data = program.getListing().getDataAt(loc);
- if (data == null) {
- continue;
- }
- Address target = ((Address) data.getValue());
- if (target == null) {
- continue;
- }
-
- // make sure the pointer created is the same as the table target
- Address tableTarget = tableElements[i];
- if (tableTarget != null && !target.equals(tableTarget)) {
- data.removeValueReference(target);
- data.addValueReference(tableTarget, RefType.DATA);
- target = tableTarget;
- }
-
- // Don't allow the targets of the switch to vary widely
- MemoryBlock thisBlock = program.getMemory().getBlock(target);
- if (lastAddress != null) {
- try {
- long diff = lastAddress.subtract(target);
- if (diff > 1024 * 128) {
break;
}
}
- catch (IllegalArgumentException e) {
- break;
+ if (!((Data) cu).isPointer()) {
+ listing.clearCodeUnits(loc, loc.add(addrSize - 1), false);
+ program.getListing().createData(loc, ptrDT, addrSize);
}
- MemoryBlock lastBlock = program.getMemory().getBlock(lastAddress);
+ }
+ }
+ catch (CodeUnitInsertionException e) {
+ // couldn't create
+ }
+ Data data = program.getListing().getDataAt(loc);
+ if (data == null) {
+ continue;
+ }
+ Address target = ((Address) data.getValue());
+ if (target == null) {
+ continue;
+ }
- if (lastBlock == null || !lastBlock.equals(thisBlock)) {
+ // make sure the pointer created is the same as the table target
+ Address tableTarget = tableElements[i];
+ if (tableTarget != null && !target.equals(tableTarget)) {
+ data.removeValueReference(target);
+ data.addValueReference(tableTarget, RefType.DATA);
+ target = tableTarget;
+ }
+
+ // Don't allow the targets of the switch to vary widely
+ MemoryBlock thisBlock = program.getMemory().getBlock(target);
+ if (lastAddress != null) {
+ try {
+ long diff = lastAddress.subtract(target);
+ if (diff > 1024 * 128) {
break;
}
}
- lastAddress = target;
-
- // check that the block we are in and the block targetted is executable
- if (instrBlockExecutable && thisBlock != null && !thisBlock.isExecute()) {
+ catch (IllegalArgumentException e) {
break;
}
- // disassemble the case
- if (program.getListing().getInstructionAt(target) == null || notInAFunction) {
- if (!tableInProgress) {
- newCodeFound = true;
- }
+ MemoryBlock lastBlock = program.getMemory().getBlock(lastAddress);
+
+ if (lastBlock == null || !lastBlock.equals(thisBlock)) {
+ break;
}
+ }
+ lastAddress = target;
- if (!flagNewCode || !newCodeFound) {
- // create a case label
- if (!ftype.isCall()) {
- AddLabelCmd lcmd = new AddLabelCmd(target,
- caseName + Integer.toHexString(i), true, SourceType.ANALYSIS);
- switchLabelList.add(lcmd);
- }
+ // check that the block we are in and the block targetted is executable
+ if (instrBlockExecutable && thisBlock != null && !thisBlock.isExecute()) {
+ break;
+ }
+ // disassemble the case
+ if (program.getListing().getInstructionAt(target) == null || notInAFunction) {
+ if (!tableInProgress) {
+ newCodeFound = true;
+ }
+ }
- // add a reference to the case
- start_inst.addMnemonicReference(target, ftype, SourceType.ANALYSIS);
- //program.getReferenceManager().addMemReference(start_inst.getMinAddress(), target, ftype, false, CodeUnit.MNEMONIC);
+ if (!flagNewCode || !newCodeFound) {
+ // create a case label
+ if (!ftype.isCall()) {
+ AddLabelCmd lcmd = new AddLabelCmd(target,
+ caseName + Integer.toHexString(i), true, SourceType.ANALYSIS);
+ switchLabelList.add(lcmd);
}
- disassembleTarget(program, target, monitor);
+ // add a reference to the case
+ start_inst.addMnemonicReference(target, ftype, SourceType.ANALYSIS);
+ //program.getReferenceManager().addMemReference(start_inst.getMinAddress(), target, ftype, false, CodeUnit.MNEMONIC);
}
- // if we are in a function, fix up it's body
- if (!ftype.isCall()) {
- fixupFunctionBody(program, start_inst, monitor);
- }
+ disassembleTarget(program, target, monitor);
}
- catch (DataTypeConflictException e1) {
- return false;
+
+ // if we are in a function, fix up it's body
+ if (!ftype.isCall()) {
+ fixupFunctionBody(program, start_inst, monitor);
}
// create the index array if this table has one
diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/disassembler/EntryPointAnalyzer.java b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/disassembler/EntryPointAnalyzer.java
index ff24aec6d4..8da8f320ca 100644
--- a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/disassembler/EntryPointAnalyzer.java
+++ b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/disassembler/EntryPointAnalyzer.java
@@ -30,7 +30,6 @@ import ghidra.app.util.importer.MessageLog;
import ghidra.framework.options.Options;
import ghidra.program.disassemble.Disassembler;
import ghidra.program.model.address.*;
-import ghidra.program.model.data.DataTypeConflictException;
import ghidra.program.model.data.PointerDataType;
import ghidra.program.model.listing.*;
import ghidra.program.model.symbol.*;
@@ -362,9 +361,6 @@ public class EntryPointAnalyzer extends AbstractAnalyzer {
catch (CodeUnitInsertionException e) {
// couldn't create
}
- catch (DataTypeConflictException e) {
- // couldn't create
- }
}
private int addExternalSymbolsToSet(Program program, AddressSetView addressSet,
diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/equate/ConvertCommand.java b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/equate/ConvertCommand.java
index 3877ea357e..27f9af7b06 100644
--- a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/equate/ConvertCommand.java
+++ b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/equate/ConvertCommand.java
@@ -26,7 +26,8 @@ import ghidra.docking.settings.Settings;
import ghidra.framework.cmd.BackgroundCommand;
import ghidra.framework.model.DomainObject;
import ghidra.program.model.address.Address;
-import ghidra.program.model.data.*;
+import ghidra.program.model.data.AbstractIntegerDataType;
+import ghidra.program.model.data.DataType;
import ghidra.program.model.listing.*;
import ghidra.program.model.scalar.Scalar;
import ghidra.program.model.symbol.Equate;
@@ -89,8 +90,7 @@ public class ConvertCommand extends BackgroundCommand {
return msg == null;
}
- private boolean applyDataSettings(Data data)
- throws CodeUnitInsertionException, DataTypeConflictException {
+ private boolean applyDataSettings(Data data) throws CodeUnitInsertionException {
DataType dt = data.getBaseDataType();
Settings settings = data;
@@ -130,7 +130,7 @@ public class ConvertCommand extends BackgroundCommand {
}
private void createData(Data data, DataType unsignedDataType)
- throws CodeUnitInsertionException, DataTypeConflictException {
+ throws CodeUnitInsertionException {
Listing listing = data.getProgram().getListing();
Address addr = data.getAddress();
listing.clearCodeUnits(addr, data.getMaxAddress(), false);
diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/exceptionhandlers/gcc/GccAnalysisClass.java b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/exceptionhandlers/gcc/GccAnalysisClass.java
index 7c396224fd..52df1b9886 100644
--- a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/exceptionhandlers/gcc/GccAnalysisClass.java
+++ b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/exceptionhandlers/gcc/GccAnalysisClass.java
@@ -85,7 +85,8 @@ public abstract class GccAnalysisClass {
// try creating without clearing, the code units should be clear
program.getListing().createData(addr, dt);
}
- catch (CodeUnitInsertionException | DataTypeConflictException e) {
+ catch (CodeUnitInsertionException e) {
+ // TODO: not sure what this accomplishes since no clearing will be done
CreateDataCmd dataCmd = new CreateDataCmd(addr, dt);
dataCmd.applyTo(program);
}
diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/util/bin/format/dwarf4/next/DWARFFunctionImporter.java b/Ghidra/Features/Base/src/main/java/ghidra/app/util/bin/format/dwarf4/next/DWARFFunctionImporter.java
index 55a1c5b315..049f3876de 100644
--- a/Ghidra/Features/Base/src/main/java/ghidra/app/util/bin/format/dwarf4/next/DWARFFunctionImporter.java
+++ b/Ghidra/Features/Base/src/main/java/ghidra/app/util/bin/format/dwarf4/next/DWARFFunctionImporter.java
@@ -18,11 +18,10 @@ package ghidra.app.util.bin.format.dwarf4.next;
import static ghidra.app.util.bin.format.dwarf4.encoding.DWARFAttribute.*;
import static ghidra.app.util.bin.format.dwarf4.encoding.DWARFTag.*;
+import java.io.IOException;
import java.util.*;
import java.util.stream.Collectors;
-import java.io.IOException;
-
import ghidra.app.cmd.comments.AppendCommentCmd;
import ghidra.app.cmd.label.SetLabelPrimaryCmd;
import ghidra.app.util.bin.format.dwarf4.*;
@@ -976,7 +975,7 @@ public class DWARFFunctionImporter {
}
return result;
}
- catch (CodeUnitInsertionException | DataTypeConflictException e) {
+ catch (CodeUnitInsertionException e) {
Msg.error(this, "Error creating data object at " + address, e);
}
return null;
diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/util/bin/format/elf/relocation/ElfRelocationHandler.java b/Ghidra/Features/Base/src/main/java/ghidra/app/util/bin/format/elf/relocation/ElfRelocationHandler.java
index ac5cfa1f3e..ca0e336ed6 100644
--- a/Ghidra/Features/Base/src/main/java/ghidra/app/util/bin/format/elf/relocation/ElfRelocationHandler.java
+++ b/Ghidra/Features/Base/src/main/java/ghidra/app/util/bin/format/elf/relocation/ElfRelocationHandler.java
@@ -22,8 +22,9 @@ import org.apache.commons.lang3.StringUtils;
import ghidra.app.util.bin.format.elf.*;
import ghidra.app.util.importer.MessageLog;
import ghidra.program.model.address.Address;
-import ghidra.program.model.data.*;
+import ghidra.program.model.data.DataUtilities;
import ghidra.program.model.data.DataUtilities.ClearDataMode;
+import ghidra.program.model.data.PointerTypedef;
import ghidra.program.model.listing.*;
import ghidra.program.model.mem.MemoryAccessException;
import ghidra.program.model.util.CodeUnitInsertionException;
@@ -90,7 +91,7 @@ abstract public class ElfRelocationHandler implements ExtensionPoint {
DataUtilities.createData(program, addr, dt, -1, false,
ClearDataMode.CLEAR_ALL_UNDEFINED_CONFLICT_DATA);
}
- catch (CodeUnitInsertionException | DataTypeConflictException e) {
+ catch (CodeUnitInsertionException e) {
Msg.error(ElfRelocationHandler.class,
"Failed to apply component-offset pointer at " + addr);
}
diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/util/bin/format/objectiveC/ObjectiveC1_Utilities.java b/Ghidra/Features/Base/src/main/java/ghidra/app/util/bin/format/objectiveC/ObjectiveC1_Utilities.java
index ca227385f7..dd0d43290b 100644
--- a/Ghidra/Features/Base/src/main/java/ghidra/app/util/bin/format/objectiveC/ObjectiveC1_Utilities.java
+++ b/Ghidra/Features/Base/src/main/java/ghidra/app/util/bin/format/objectiveC/ObjectiveC1_Utilities.java
@@ -139,7 +139,7 @@ public final class ObjectiveC1_Utilities {
* Applies the data type at the specified address.
*/
public static void applyData(Program program, DataType dt, Address address)
- throws CodeUnitInsertionException, DataTypeConflictException {
+ throws CodeUnitInsertionException {
Data data = program.getListing().getDefinedDataAt(address);
if (data != null && data.getDataType().isEquivalent(dt)) {
return;
@@ -176,26 +176,12 @@ public final class ObjectiveC1_Utilities {
* Applies a pointer data type at the specified address and returns the address being referenced.
*/
public static Address createPointerAndReturnAddressBeingReferenced(Program program,
- Address address) throws CodeUnitInsertionException, DataTypeConflictException {
+ Address address) throws CodeUnitInsertionException {
program.getListing().createData(address, new PointerDataType());
Data data = program.getListing().getDefinedDataAt(address);
return (Address) data.getValue();
}
- /**
- * Applies a pointer data type at the specified address and returns the newly created data object.
- */
- public static Data createPointer(Program program, Address address) {
- try {
- program.getListing().createData(address, new PointerDataType());
- Data data = program.getListing().getDefinedDataAt(address);
- return data;
- }
- catch (Exception e) {
- }
- return null;
- }
-
/**
* Returns the name space inside the given parent name space.
* If it does not exist, then create it and return it.
diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/util/bin/format/pe/DebugDataDirectory.java b/Ghidra/Features/Base/src/main/java/ghidra/app/util/bin/format/pe/DebugDataDirectory.java
index 71b4debc86..1a07c920d8 100644
--- a/Ghidra/Features/Base/src/main/java/ghidra/app/util/bin/format/pe/DebugDataDirectory.java
+++ b/Ghidra/Features/Base/src/main/java/ghidra/app/util/bin/format/pe/DebugDataDirectory.java
@@ -65,7 +65,7 @@ public class DebugDataDirectory extends DataDirectory {
@Override
public void markup(Program program, boolean isBinary, TaskMonitor monitor, MessageLog log,
NTHeader ntHeader) throws DuplicateNameException, CodeUnitInsertionException,
- DataTypeConflictException, IOException {
+ IOException {
monitor.setMessage(program.getName()+": debug...");
Address addr = PeUtils.getMarkupAddress(program, isBinary, ntHeader, virtualAddress);
diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/util/bin/format/pe/DelayImportDataDirectory.java b/Ghidra/Features/Base/src/main/java/ghidra/app/util/bin/format/pe/DelayImportDataDirectory.java
index 4de3d84d3f..67faa93cf1 100644
--- a/Ghidra/Features/Base/src/main/java/ghidra/app/util/bin/format/pe/DelayImportDataDirectory.java
+++ b/Ghidra/Features/Base/src/main/java/ghidra/app/util/bin/format/pe/DelayImportDataDirectory.java
@@ -87,7 +87,7 @@ public class DelayImportDataDirectory extends DataDirectory {
@Override
public void markup(Program program, boolean isBinary, TaskMonitor monitor, MessageLog log,
NTHeader ntHeader) throws DuplicateNameException, CodeUnitInsertionException,
- DataTypeConflictException, IOException {
+ IOException {
monitor.setMessage(program.getName()+": delay import(s)...");
Address addr = PeUtils.getMarkupAddress(program, isBinary, ntHeader, virtualAddress);
@@ -187,7 +187,7 @@ public class DelayImportDataDirectory extends DataDirectory {
DelayImportDescriptor descriptor,
TaskMonitor monitor,
MessageLog log)
- throws DataTypeConflictException, DuplicateNameException {
+ throws DuplicateNameException {
Map<ThunkData, ImportByName> map = descriptor.getImportByNameMap();
Iterator<ThunkData> thunks = map.keySet().iterator();
diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/util/bin/format/pe/ExceptionDataDirectory.java b/Ghidra/Features/Base/src/main/java/ghidra/app/util/bin/format/pe/ExceptionDataDirectory.java
index ab7579243a..d222f45961 100644
--- a/Ghidra/Features/Base/src/main/java/ghidra/app/util/bin/format/pe/ExceptionDataDirectory.java
+++ b/Ghidra/Features/Base/src/main/java/ghidra/app/util/bin/format/pe/ExceptionDataDirectory.java
@@ -50,7 +50,7 @@ public class ExceptionDataDirectory extends DataDirectory {
@Override
public void markup(Program program, boolean isBinary, TaskMonitor monitor, MessageLog log,
NTHeader ntHeader) throws DuplicateNameException, CodeUnitInsertionException,
- DataTypeConflictException, IOException {
+ IOException {
monitor.setMessage(program.getName()+": exceptions...");
Address addr = PeUtils.getMarkupAddress(program, isBinary, ntHeader, virtualAddress);
if (!program.getMemory().contains(addr)) {
diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/util/bin/format/pe/ExportDataDirectory.java b/Ghidra/Features/Base/src/main/java/ghidra/app/util/bin/format/pe/ExportDataDirectory.java
index c05274d040..a452ca5902 100644
--- a/Ghidra/Features/Base/src/main/java/ghidra/app/util/bin/format/pe/ExportDataDirectory.java
+++ b/Ghidra/Features/Base/src/main/java/ghidra/app/util/bin/format/pe/ExportDataDirectory.java
@@ -146,7 +146,7 @@ public class ExportDataDirectory extends DataDirectory {
@Override
public void markup(Program program, boolean isBinary, TaskMonitor monitor, MessageLog log,
NTHeader ntHeader) throws DuplicateNameException, CodeUnitInsertionException,
- DataTypeConflictException, IOException {
+ IOException {
monitor.setMessage("[" + program.getName() + "]: exports...");
Address addr = PeUtils.getMarkupAddress(program, isBinary, ntHeader, virtualAddress);
diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/util/bin/format/pe/GlobalPointerDataDirectory.java b/Ghidra/Features/Base/src/main/java/ghidra/app/util/bin/format/pe/GlobalPointerDataDirectory.java
index 800ad30f79..afebb62217 100644
--- a/Ghidra/Features/Base/src/main/java/ghidra/app/util/bin/format/pe/GlobalPointerDataDirectory.java
+++ b/Ghidra/Features/Base/src/main/java/ghidra/app/util/bin/format/pe/GlobalPointerDataDirectory.java
@@ -42,7 +42,7 @@ public class GlobalPointerDataDirectory extends DataDirectory {
@Override
public void markup(Program program, boolean isBinary, TaskMonitor monitor, MessageLog log,
NTHeader ntHeader) throws DuplicateNameException, CodeUnitInsertionException,
- DataTypeConflictException, IOException {
+ IOException {
monitor.setMessage(program.getName()+": global pointers...");
Address addr = PeUtils.getMarkupAddress(program, isBinary, ntHeader, virtualAddress);
if (!program.getMemory().contains(addr)) {
diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/util/bin/format/pe/ImportDataDirectory.java b/Ghidra/Features/Base/src/main/java/ghidra/app/util/bin/format/pe/ImportDataDirectory.java
index 309910f0bf..b902089e5e 100644
--- a/Ghidra/Features/Base/src/main/java/ghidra/app/util/bin/format/pe/ImportDataDirectory.java
+++ b/Ghidra/Features/Base/src/main/java/ghidra/app/util/bin/format/pe/ImportDataDirectory.java
@@ -77,7 +77,7 @@ public class ImportDataDirectory extends DataDirectory {
@Override
public void markup(Program program, boolean isBinary, TaskMonitor monitor, MessageLog log,
NTHeader ntHeader) throws DuplicateNameException, CodeUnitInsertionException,
- DataTypeConflictException, IOException, MemoryAccessException {
+ IOException, MemoryAccessException {
if (imports == null || descriptors == null) {
return;
diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/util/bin/format/pe/LoadConfigDataDirectory.java b/Ghidra/Features/Base/src/main/java/ghidra/app/util/bin/format/pe/LoadConfigDataDirectory.java
index 6ad74e69e7..2ffa75fc54 100644
--- a/Ghidra/Features/Base/src/main/java/ghidra/app/util/bin/format/pe/LoadConfigDataDirectory.java
+++ b/Ghidra/Features/Base/src/main/java/ghidra/app/util/bin/format/pe/LoadConfigDataDirectory.java
@@ -51,7 +51,7 @@ public class LoadConfigDataDirectory extends DataDirectory {
@Override
public void markup(Program program, boolean isBinary, TaskMonitor monitor, MessageLog log,
NTHeader ntHeader) throws DuplicateNameException, CodeUnitInsertionException,
- DataTypeConflictException, IOException {
+ IOException {
monitor.setMessage(program.getName()+": load config directory...");
Address addr = PeUtils.getMarkupAddress(program, isBinary, ntHeader, virtualAddress);
diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/util/bin/format/pe/ResourceDataDirectory.java b/Ghidra/Features/Base/src/main/java/ghidra/app/util/bin/format/pe/ResourceDataDirectory.java
index 8f37e46b83..2d8fcbb4c9 100644
--- a/Ghidra/Features/Base/src/main/java/ghidra/app/util/bin/format/pe/ResourceDataDirectory.java
+++ b/Ghidra/Features/Base/src/main/java/ghidra/app/util/bin/format/pe/ResourceDataDirectory.java
@@ -178,7 +178,7 @@ public class ResourceDataDirectory extends DataDirectory {
@Override
public void markup(Program program, boolean isBinary, TaskMonitor monitor, MessageLog log,
NTHeader ntHeader) throws DuplicateNameException, CodeUnitInsertionException,
- DataTypeConflictException, IOException {
+ IOException {
if (rootDirectory == null) {
return;
diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/util/bin/format/pe/SecurityDataDirectory.java b/Ghidra/Features/Base/src/main/java/ghidra/app/util/bin/format/pe/SecurityDataDirectory.java
index 5ac8cf65bc..82a683494f 100644
--- a/Ghidra/Features/Base/src/main/java/ghidra/app/util/bin/format/pe/SecurityDataDirectory.java
+++ b/Ghidra/Features/Base/src/main/java/ghidra/app/util/bin/format/pe/SecurityDataDirectory.java
@@ -64,7 +64,7 @@ public class SecurityDataDirectory extends DataDirectory implements ByteArrayCon
@Override
public void markup(Program program, boolean isBinary, TaskMonitor monitor, MessageLog log,
NTHeader ntHeader) throws DuplicateNameException, CodeUnitInsertionException,
- DataTypeConflictException, IOException {
+ IOException {
if (!isBinary) {//certificates are never mapped into running program...
return;
diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/util/bin/format/pe/TLSDataDirectory.java b/Ghidra/Features/Base/src/main/java/ghidra/app/util/bin/format/pe/TLSDataDirectory.java
index 7a9c92de3d..fa468739be 100644
--- a/Ghidra/Features/Base/src/main/java/ghidra/app/util/bin/format/pe/TLSDataDirectory.java
+++ b/Ghidra/Features/Base/src/main/java/ghidra/app/util/bin/format/pe/TLSDataDirectory.java
@@ -21,7 +21,8 @@ import ghidra.app.util.bin.BinaryReader;
import ghidra.app.util.importer.MessageLog;
import ghidra.program.model.address.Address;
import ghidra.program.model.address.AddressSpace;
-import ghidra.program.model.data.*;
+import ghidra.program.model.data.DataType;
+import ghidra.program.model.data.PointerDataType;
import ghidra.program.model.listing.Program;
import ghidra.program.model.mem.DumbMemBufferImpl;
import ghidra.program.model.symbol.SourceType;
@@ -58,7 +59,7 @@ public class TLSDataDirectory extends DataDirectory {
@Override
public void markup(Program program, boolean isBinary, TaskMonitor monitor, MessageLog log,
NTHeader ntHeader) throws DuplicateNameException, CodeUnitInsertionException,
- DataTypeConflictException, IOException {
+ IOException {
monitor.setMessage(program.getName()+": TLS...");
Address addr = PeUtils.getMarkupAddress(program, isBinary, ntHeader, virtualAddress);
diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/util/bin/format/pe/cli/tables/CliTableMethodDef.java b/Ghidra/Features/Base/src/main/java/ghidra/app/util/bin/format/pe/cli/tables/CliTableMethodDef.java
index 2a3cdb2392..391f644a01 100644
--- a/Ghidra/Features/Base/src/main/java/ghidra/app/util/bin/format/pe/cli/tables/CliTableMethodDef.java
+++ b/Ghidra/Features/Base/src/main/java/ghidra/app/util/bin/format/pe/cli/tables/CliTableMethodDef.java
@@ -456,9 +456,6 @@ public class CliTableMethodDef extends CliAbstractTable {
catch (CodeUnitInsertionException e) {
// Ignore, something there already
}
- catch (DataTypeConflictException e) {
- // Ignore, something there already
- }
catch (NullPointerException e) {
Msg.warn(this, "Error processing function \"" + funcName + "\" (" + methodRowIndex +
"): Bad parameters provided");
diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/util/datatype/microsoft/ThreadEnvironmentBlock.java b/Ghidra/Features/Base/src/main/java/ghidra/app/util/datatype/microsoft/ThreadEnvironmentBlock.java
index 2cc5b2755b..1eda299cb0 100644
--- a/Ghidra/Features/Base/src/main/java/ghidra/app/util/datatype/microsoft/ThreadEnvironmentBlock.java
+++ b/Ghidra/Features/Base/src/main/java/ghidra/app/util/datatype/microsoft/ThreadEnvironmentBlock.java
@@ -173,9 +173,6 @@ public class ThreadEnvironmentBlock {
catch (CodeUnitInsertionException e) {
Msg.warn(this, "Unable to insert TEB field: " + name);
}
- catch (DataTypeConflictException e) {
- Msg.warn(this, "TEB data-type conflicts with existing data-type: " + dat.getName());
- }
catch (InvalidInputException e) {
Msg.warn(this, "Unable to create TEB symbol name: " + name);
}
@@ -706,13 +703,12 @@ public class ThreadEnvironmentBlock {
* @throws AddressOverflowException for problems with block's start Address
* @throws IllegalArgumentException for problems with the block name or the TEB data-type
* @throws LockException if it cannot get an exclusive lock on the program
- * @throws DataTypeConflictException for conflicts with other data-types
* @throws CodeUnitInsertionException for problems laying down the structure on the block
* @throws InvalidInputException for problems with the symbol name attached to the TEB
*/
public void createBlockAndStructure() throws MemoryConflictException, LockException,
IllegalArgumentException, AddressOverflowException, CodeUnitInsertionException,
- DataTypeConflictException, InvalidInputException {
+ InvalidInputException {
Memory memory = program.getMemory();
MemoryBlock block = memory.getBlock(BLOCK_NAME);
if (block != null) {
diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/util/demangler/DemangledFunction.java b/Ghidra/Features/Base/src/main/java/ghidra/app/util/demangler/DemangledFunction.java
index 311ec6a5fb..0391e06aa1 100644
--- a/Ghidra/Features/Base/src/main/java/ghidra/app/util/demangler/DemangledFunction.java
+++ b/Ghidra/Features/Base/src/main/java/ghidra/app/util/demangler/DemangledFunction.java
@@ -568,9 +568,6 @@ public class DemangledFunction extends DemangledObject {
catch (CodeUnitInsertionException e) {
// ignore
}
- catch (DataTypeConflictException e) {
- // ignore - should not happen
- }
}
private DataType resolveReturnType(Program program, Function function,
diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/util/opinion/CoffLoader.java b/Ghidra/Features/Base/src/main/java/ghidra/app/util/opinion/CoffLoader.java
index 98c01c0c43..41aa656ac1 100644
--- a/Ghidra/Features/Base/src/main/java/ghidra/app/util/opinion/CoffLoader.java
+++ b/Ghidra/Features/Base/src/main/java/ghidra/app/util/opinion/CoffLoader.java
@@ -30,7 +30,8 @@ import ghidra.app.util.importer.MessageLog;
import ghidra.framework.model.DomainObject;
import ghidra.program.database.mem.FileBytes;
import ghidra.program.model.address.*;
-import ghidra.program.model.data.*;
+import ghidra.program.model.data.DataType;
+import ghidra.program.model.data.Undefined;
import ghidra.program.model.lang.Language;
import ghidra.program.model.listing.*;
import ghidra.program.model.mem.*;
@@ -384,7 +385,7 @@ public class CoffLoader extends AbstractLibrarySupportLoader {
}
private Data createUndefined(Listing listing, Memory memory, Address addr, int size)
- throws CodeUnitInsertionException, DataTypeConflictException {
+ throws CodeUnitInsertionException {
MemoryBlock block = memory.getBlock(addr);
if (block == null || !block.isInitialized()) {
return null;
diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/util/opinion/ElfProgramBuilder.java b/Ghidra/Features/Base/src/main/java/ghidra/app/util/opinion/ElfProgramBuilder.java
index a9b656d3c4..3ecc881f19 100644
--- a/Ghidra/Features/Base/src/main/java/ghidra/app/util/opinion/ElfProgramBuilder.java
+++ b/Ghidra/Features/Base/src/main/java/ghidra/app/util/opinion/ElfProgramBuilder.java
@@ -502,9 +502,6 @@ class ElfProgramBuilder extends MemorySectionResolver implements ElfLoadHelper {
catch (CodeUnitInsertionException e) {
// ignore
}
- catch (DataTypeConflictException e) {
- // ignore
- }
if (cu == null) {
cu = listing.getCodeUnitAt(nextAddr);
@@ -2099,9 +2096,6 @@ class ElfProgramBuilder extends MemorySectionResolver implements ElfLoadHelper {
catch (CodeUnitInsertionException e) {
log("ELF data markup conflict at " + address);
}
- catch (DataTypeConflictException e) {
- throw new AssertException("unexpected", e);
- }
return null;
}
@@ -2118,9 +2112,6 @@ class ElfProgramBuilder extends MemorySectionResolver implements ElfLoadHelper {
catch (CodeUnitInsertionException e) {
log("ELF data markup conflict while applying " + dt.getName() + " at " + address);
}
- catch (DataTypeConflictException e) {
- log("ELF data type conflict:" + getMessage(e));
- }
return null;
}
@@ -2556,8 +2547,7 @@ class ElfProgramBuilder extends MemorySectionResolver implements ElfLoadHelper {
}
}
- private int createString(Address address)
- throws CodeUnitInsertionException, DataTypeConflictException {
+ private int createString(Address address) throws CodeUnitInsertionException {
Data d = listing.getDataAt(address);
if (d == null || !TerminatedStringDataType.dataType.isEquivalent(d.getDataType())) {
d = listing.createData(address, TerminatedStringDataType.dataType, -1);
diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/util/opinion/NeLoader.java b/Ghidra/Features/Base/src/main/java/ghidra/app/util/opinion/NeLoader.java
index 1e2be5245e..be3dd7c6f4 100644
--- a/Ghidra/Features/Base/src/main/java/ghidra/app/util/opinion/NeLoader.java
+++ b/Ghidra/Features/Base/src/main/java/ghidra/app/util/opinion/NeLoader.java
@@ -24,12 +24,12 @@ import ghidra.app.util.MemoryBlockUtils;
import ghidra.app.util.Option;
import ghidra.app.util.bin.ByteProvider;
import ghidra.app.util.bin.format.ne.*;
-import ghidra.app.util.bin.format.ne.Resource;
import ghidra.app.util.importer.MessageLog;
import ghidra.framework.options.Options;
import ghidra.program.database.function.OverlappingFunctionException;
import ghidra.program.model.address.*;
-import ghidra.program.model.data.*;
+import ghidra.program.model.data.ByteDataType;
+import ghidra.program.model.data.StringDataType;
import ghidra.program.model.lang.Register;
import ghidra.program.model.listing.*;
import ghidra.program.model.mem.*;
@@ -375,8 +375,7 @@ public class NeLoader extends AbstractLibrarySupportLoader {
listing.createData(straddr, new StringDataType(),
Conv.byteToInt(string.getLength()));
}
- catch (AddressOverflowException | CodeUnitInsertionException
- | DataTypeConflictException e) {
+ catch (AddressOverflowException | CodeUnitInsertionException e) {
log.appendMsg("Error creating data");
log.appendException(e);
}
diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/util/opinion/OmfLoader.java b/Ghidra/Features/Base/src/main/java/ghidra/app/util/opinion/OmfLoader.java
index 4c28e73fab..c08173684a 100644
--- a/Ghidra/Features/Base/src/main/java/ghidra/app/util/opinion/OmfLoader.java
+++ b/Ghidra/Features/Base/src/main/java/ghidra/app/util/opinion/OmfLoader.java
@@ -27,7 +27,8 @@ import ghidra.app.util.bin.format.omf.OmfFixupRecord.Subrecord;
import ghidra.app.util.importer.MessageLog;
import ghidra.program.model.address.Address;
import ghidra.program.model.address.AddressOverflowException;
-import ghidra.program.model.data.*;
+import ghidra.program.model.data.DataType;
+import ghidra.program.model.data.Undefined;
import ghidra.program.model.lang.Language;
import ghidra.program.model.listing.*;
import ghidra.program.model.mem.*;
@@ -552,10 +553,9 @@ public class OmfLoader extends AbstractLibrarySupportLoader {
* @param size is the number of bytes in the data
* @return the new created Data object
* @throws CodeUnitInsertionException if the new data conflicts with another object
- * @throws DataTypeConflictException if the data-type cannot be created
*/
private Data createUndefined(Listing listing, Memory memory, Address addr, int size)
- throws CodeUnitInsertionException, DataTypeConflictException {
+ throws CodeUnitInsertionException {
MemoryBlock block = memory.getBlock(addr);
if (block == null || !block.isInitialized()) {
return null;
diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/util/opinion/PeLoader.java b/Ghidra/Features/Base/src/main/java/ghidra/app/util/opinion/PeLoader.java
index 74691e4111..d450d3e960 100644
--- a/Ghidra/Features/Base/src/main/java/ghidra/app/util/opinion/PeLoader.java
+++ b/Ghidra/Features/Base/src/main/java/ghidra/app/util/opinion/PeLoader.java
@@ -160,9 +160,6 @@ public class PeLoader extends AbstractPeDebugLoader {
catch (CodeUnitInsertionException e) {
throw new IOException(e);
}
- catch (DataTypeConflictException e) {
- throw new IOException(e);
- }
catch (MemoryAccessException e) {
throw new IOException(e);
}
diff --git a/Ghidra/Features/Base/src/main/java/ghidra/program/util/SymbolicPropogator.java b/Ghidra/Features/Base/src/main/java/ghidra/program/util/SymbolicPropogator.java
index 400730dd9a..f250bc48be 100644
--- a/Ghidra/Features/Base/src/main/java/ghidra/program/util/SymbolicPropogator.java
+++ b/Ghidra/Features/Base/src/main/java/ghidra/program/util/SymbolicPropogator.java
@@ -2399,9 +2399,6 @@ public class SymbolicPropogator {
catch (CodeUnitInsertionException e) {
data = program.getListing().getDefinedDataAt(address);
}
- catch (DataTypeConflictException e) {
- // do nothing
- }
int addrByteSize = dt.getLength();
return addrByteSize;
diff --git a/Ghidra/Features/Base/src/main/java/ghidra/test/processors/support/PCodeTestAbstractControlBlock.java b/Ghidra/Features/Base/src/main/java/ghidra/test/processors/support/PCodeTestAbstractControlBlock.java
index 9b94fec078..db0fcf8b8f 100644
--- a/Ghidra/Features/Base/src/main/java/ghidra/test/processors/support/PCodeTestAbstractControlBlock.java
+++ b/Ghidra/Features/Base/src/main/java/ghidra/test/processors/support/PCodeTestAbstractControlBlock.java
@@ -279,9 +279,6 @@ public abstract class PCodeTestAbstractControlBlock {
// catch (CodeUnitInsertionException e) {
// // ignore
// }
-// catch (DataTypeConflictException e) {
-// // ignore
-// }
// }
protected void applyU4Data(Address addr) {
@@ -291,9 +288,6 @@ public abstract class PCodeTestAbstractControlBlock {
catch (CodeUnitInsertionException e) {
// ignore
}
- catch (DataTypeConflictException e) {
- // ignore
- }
}
protected int getStructureComponent(Structure testInfoStruct, String fieldName) {
diff --git a/Ghidra/Features/Base/src/test.slow/java/ghidra/app/merge/listing/AbstractListingMergeManagerTest.java b/Ghidra/Features/Base/src/test.slow/java/ghidra/app/merge/listing/AbstractListingMergeManagerTest.java
index ac025a9e6e..fd1f893f42 100644
--- a/Ghidra/Features/Base/src/test.slow/java/ghidra/app/merge/listing/AbstractListingMergeManagerTest.java
+++ b/Ghidra/Features/Base/src/test.slow/java/ghidra/app/merge/listing/AbstractListingMergeManagerTest.java
@@ -43,7 +43,8 @@ import ghidra.program.database.*;
import ghidra.program.disassemble.Disassembler;
import ghidra.program.disassemble.DisassemblerMessageListener;
import ghidra.program.model.address.*;
-import ghidra.program.model.data.*;
+import ghidra.program.model.data.ByteDataType;
+import ghidra.program.model.data.DataType;
import ghidra.program.model.lang.*;
import ghidra.program.model.listing.*;
import ghidra.program.model.mem.*;
@@ -134,8 +135,7 @@ public abstract class AbstractListingMergeManagerTest extends AbstractMergeTest
program.getMemory().setBytes(addr, bytes);
listing.createData(addr, dt);
}
- catch (CodeUnitInsertionException | DataTypeConflictException
- | MemoryAccessException e) {
+ catch (CodeUnitInsertionException | MemoryAccessException e) {
Assert.fail(e.getMessage());
}
Data data = listing.getDataAt(addr);
diff --git a/Ghidra/Features/Base/src/test.slow/java/ghidra/app/merge/listing/CodeUnitMergeManager1Test.java b/Ghidra/Features/Base/src/test.slow/java/ghidra/app/merge/listing/CodeUnitMergeManager1Test.java
index 7f274e3572..129a767b31 100644
--- a/Ghidra/Features/Base/src/test.slow/java/ghidra/app/merge/listing/CodeUnitMergeManager1Test.java
+++ b/Ghidra/Features/Base/src/test.slow/java/ghidra/app/merge/listing/CodeUnitMergeManager1Test.java
@@ -15,7 +15,7 @@
*/
package ghidra.app.merge.listing;
-import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.*;
import org.junit.Assert;
import org.junit.Test;
@@ -892,9 +892,6 @@ public class CodeUnitMergeManager1Test extends AbstractListingMergeManagerTest {
catch (CodeUnitInsertionException e) {
e.printStackTrace();
}
- catch (DataTypeConflictException e) {
- e.printStackTrace();
- }
finally {
program.endTransaction(txId, commit);
}
@@ -1016,9 +1013,6 @@ public class CodeUnitMergeManager1Test extends AbstractListingMergeManagerTest {
catch (CodeUnitInsertionException e) {
e.printStackTrace();
}
- catch (DataTypeConflictException e) {
- e.printStackTrace();
- }
finally {
program.endTransaction(txId, commit);
}
@@ -1134,9 +1128,6 @@ public class CodeUnitMergeManager1Test extends AbstractListingMergeManagerTest {
catch (CodeUnitInsertionException e) {
e.printStackTrace();
}
- catch (DataTypeConflictException e) {
- e.printStackTrace();
- }
finally {
program.endTransaction(txId, commit);
}
@@ -1276,9 +1267,6 @@ public class CodeUnitMergeManager1Test extends AbstractListingMergeManagerTest {
catch (CodeUnitInsertionException e) {
e.printStackTrace();
}
- catch (DataTypeConflictException e) {
- e.printStackTrace();
- }
finally {
program.endTransaction(txId, commit);
}
diff --git a/Ghidra/Features/Base/src/test.slow/java/ghidra/app/plugin/core/codebrowser/CodeBrowserTest.java b/Ghidra/Features/Base/src/test.slow/java/ghidra/app/plugin/core/codebrowser/CodeBrowserTest.java
index bb2016eb24..586169f31e 100644
--- a/Ghidra/Features/Base/src/test.slow/java/ghidra/app/plugin/core/codebrowser/CodeBrowserTest.java
+++ b/Ghidra/Features/Base/src/test.slow/java/ghidra/app/plugin/core/codebrowser/CodeBrowserTest.java
@@ -193,7 +193,7 @@ public class CodeBrowserTest extends AbstractGhidraHeadedIntegrationTest {
}
@Test
- public void testSelectionOnStructureInOffcutView_SCR_8089() throws DataTypeConflictException {
+ public void testSelectionOnStructureInOffcutView_SCR_8089() {
// create offcut view, the view will contain 3 bytes, but the structure will be 4 bytes
cb.getListingPanel().setView(new AddressSet(addr("0100101c"), addr("0100101e")));
diff --git a/Ghidra/Features/FileFormats/src/main/java/ghidra/macosx/analyzers/CFStringAnalyzer.java b/Ghidra/Features/FileFormats/src/main/java/ghidra/macosx/analyzers/CFStringAnalyzer.java
index 8b57ecd95f..e9d19e823e 100644
--- a/Ghidra/Features/FileFormats/src/main/java/ghidra/macosx/analyzers/CFStringAnalyzer.java
+++ b/Ghidra/Features/FileFormats/src/main/java/ghidra/macosx/analyzers/CFStringAnalyzer.java
@@ -118,10 +118,6 @@ public class CFStringAnalyzer extends AbstractAnalyzer {
log.appendException(e);
return false;
}
- catch (DataTypeConflictException e) {
- log.appendException(e);
- return false;
- }
catch (InvalidInputException e) {
log.appendException(e);
// return false;
diff --git a/Ghidra/Features/FileFormats/src/main/java/ghidra/macosx/analyzers/MachoConstructorDestructorAnalyzer.java b/Ghidra/Features/FileFormats/src/main/java/ghidra/macosx/analyzers/MachoConstructorDestructorAnalyzer.java
index 11a98c18e7..8e0a703054 100644
--- a/Ghidra/Features/FileFormats/src/main/java/ghidra/macosx/analyzers/MachoConstructorDestructorAnalyzer.java
+++ b/Ghidra/Features/FileFormats/src/main/java/ghidra/macosx/analyzers/MachoConstructorDestructorAnalyzer.java
@@ -15,12 +15,14 @@
*/
package ghidra.macosx.analyzers;
+import java.util.ArrayList;
+import java.util.List;
+
import ghidra.app.services.*;
import ghidra.app.util.importer.MessageLog;
import ghidra.app.util.opinion.MachoLoader;
import ghidra.program.model.address.Address;
import ghidra.program.model.address.AddressSetView;
-import ghidra.program.model.data.DataTypeConflictException;
import ghidra.program.model.data.PointerDataType;
import ghidra.program.model.listing.Data;
import ghidra.program.model.listing.Program;
@@ -29,9 +31,6 @@ import ghidra.program.model.util.CodeUnitInsertionException;
import ghidra.util.exception.CancelledException;
import ghidra.util.task.TaskMonitor;
-import java.util.ArrayList;
-import java.util.List;
-
public class MachoConstructorDestructorAnalyzer extends AbstractAnalyzer {
private static final String NAME = "Mach-O Constructor/Destructor";
private static final String DESCRIPTION =
@@ -67,9 +66,6 @@ public class MachoConstructorDestructorAnalyzer extends AbstractAnalyzer {
catch (CodeUnitInsertionException e) {
break;
}
- catch (DataTypeConflictException e) {
- break;
- }
}
}
diff --git a/Ghidra/Features/FileFormats/src/main/java/ghidra/macosx/analyzers/TestAnalyzer.java b/Ghidra/Features/FileFormats/src/main/java/ghidra/macosx/analyzers/TestAnalyzer.java
index 0d6bad66ab..9c3af35ae4 100644
--- a/Ghidra/Features/FileFormats/src/main/java/ghidra/macosx/analyzers/TestAnalyzer.java
+++ b/Ghidra/Features/FileFormats/src/main/java/ghidra/macosx/analyzers/TestAnalyzer.java
@@ -73,10 +73,6 @@ public class TestAnalyzer extends AbstractAnalyzer {
log.appendException(e);
return false;
}
- catch (DataTypeConflictException e) {
- log.appendException(e);
- return false;
- }
}
return true;
diff --git a/Ghidra/Features/MicrosoftCodeAnalyzer/src/main/java/ghidra/app/cmd/data/AbstractCreateDataBackgroundCmd.java b/Ghidra/Features/MicrosoftCodeAnalyzer/src/main/java/ghidra/app/cmd/data/AbstractCreateDataBackgroundCmd.java
index 51fcdd5ae2..d683e13e6e 100644
--- a/Ghidra/Features/MicrosoftCodeAnalyzer/src/main/java/ghidra/app/cmd/data/AbstractCreateDataBackgroundCmd.java
+++ b/Ghidra/Features/MicrosoftCodeAnalyzer/src/main/java/ghidra/app/cmd/data/AbstractCreateDataBackgroundCmd.java
@@ -190,7 +190,7 @@ public abstract class AbstractCreateDataBackgroundCmd<T extends AbstractCreateDa
setStatusMsg(getName() + " completed successfully!");
return success;
}
- catch (AddressOutOfBoundsException | CodeUnitInsertionException | DataTypeConflictException
+ catch (AddressOutOfBoundsException | CodeUnitInsertionException
| InvalidDataTypeException e) {
handleErrorMessage(program, name, address, address, e);
return false;
diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/app/util/pdb/pdbapplicator/DataSymbolApplier.java b/Ghidra/Features/PDB/src/main/java/ghidra/app/util/pdb/pdbapplicator/DataSymbolApplier.java
index c17f499576..c6b888ee21 100644
--- a/Ghidra/Features/PDB/src/main/java/ghidra/app/util/pdb/pdbapplicator/DataSymbolApplier.java
+++ b/Ghidra/Features/PDB/src/main/java/ghidra/app/util/pdb/pdbapplicator/DataSymbolApplier.java
@@ -180,7 +180,7 @@ public class DataSymbolApplier extends MsSymbolApplier {
applicator.getProgram().getListing().createData(address, dataType);
}
}
- catch (CodeUnitInsertionException | DataTypeConflictException e) {
+ catch (CodeUnitInsertionException e) {
applicator.appendLogMsg("Unable to create " + dataType.getDisplayName() + " at 0x" +
address + ": " + e.getMessage());
}
@@ -191,7 +191,7 @@ public class DataSymbolApplier extends MsSymbolApplier {
address.add(dataTypeLength - 1), false);
applicator.getProgram().getListing().createData(address, dataType, dataTypeLength);
}
- catch (CodeUnitInsertionException | DataTypeConflictException e) {
+ catch (CodeUnitInsertionException e) {
applicator.appendLogMsg("Unable to replace " + dataType.getDisplayName() +
" at 0x" + address + ": " + e.getMessage());
}
diff --git a/Ghidra/Features/VersionTracking/src/main/java/ghidra/feature/vt/api/markuptype/DataTypeMarkupType.java b/Ghidra/Features/VersionTracking/src/main/java/ghidra/feature/vt/api/markuptype/DataTypeMarkupType.java
index 15b6cfa03e..e507d2c680 100644
--- a/Ghidra/Features/VersionTracking/src/main/java/ghidra/feature/vt/api/markuptype/DataTypeMarkupType.java
+++ b/Ghidra/Features/VersionTracking/src/main/java/ghidra/feature/vt/api/markuptype/DataTypeMarkupType.java
@@ -207,8 +207,7 @@ public class DataTypeMarkupType extends VTMarkupType {
private boolean setDataType(Program program, Address startAddress, DataType dataType,
int dataLength, VTMatchApplyChoices.ReplaceDataChoices replaceChoice)
- throws CodeUnitInsertionException, DataTypeConflictException,
- VersionTrackingApplyException {
+ throws CodeUnitInsertionException, VersionTrackingApplyException {
Listing listing = program.getListing();
// For now this will only clear the code unit at the address.
@@ -273,10 +272,6 @@ public class DataTypeMarkupType extends VTMarkupType {
tryToRestoreOriginalData(listing, startAddress, originalDataType, originalDataLength);
throw e;
}
- catch (DataTypeConflictException e) {
- tryToRestoreOriginalData(listing, startAddress, originalDataType, originalDataLength);
- throw e;
- }
return true;
}
@@ -293,13 +288,6 @@ public class DataTypeMarkupType extends VTMarkupType {
" after failing to set data type markup at " + address.toString() + ".\n" +
e2.getMessage());
}
- catch (DataTypeConflictException e2) {
- // If we get an error trying to put the original back then dump a message and bail out.
- Msg.error(this,
- "Couldn't restore data type of " + originalDataType.getName() +
- " after failing to set data type markup at " + address.toString() + ".\n" +
- e2.getMessage());
- }
}
@Override
@@ -349,11 +337,6 @@ public class DataTypeMarkupType extends VTMarkupType {
sourceDataLength, replaceChoice);
}
catch (CodeUnitInsertionException e) {
-
- throw new VersionTrackingApplyException(getApplyFailedMessage(sourceAddress,
- destinationAddress, e, sourceDataLength, destinationData.getLength()), e);
- }
- catch (DataTypeConflictException e) {
throw new VersionTrackingApplyException(getApplyFailedMessage(sourceAddress,
destinationAddress, e, sourceDataLength, destinationData.getLength()), e);
}
@@ -408,10 +391,6 @@ public class DataTypeMarkupType extends VTMarkupType {
throw new VersionTrackingApplyException("Couldn't unapply data type markup @ " +
destinationAddress.toString() + "." + e.getMessage() + ".", e);
}
- catch (DataTypeConflictException e) {
- throw new VersionTrackingApplyException("Couldn't unapply data type markup @ " +
- destinationAddress.toString() + "." + e.getMessage() + ".", e);
- }
}
@Override
diff --git a/Ghidra/Features/VersionTracking/src/test.slow/java/ghidra/feature/vt/api/VTMatchAcceptTest.java b/Ghidra/Features/VersionTracking/src/test.slow/java/ghidra/feature/vt/api/VTMatchAcceptTest.java
index f0407473a0..5410e4342e 100644
--- a/Ghidra/Features/VersionTracking/src/test.slow/java/ghidra/feature/vt/api/VTMatchAcceptTest.java
+++ b/Ghidra/Features/VersionTracking/src/test.slow/java/ghidra/feature/vt/api/VTMatchAcceptTest.java
@@ -15,9 +15,8 @@
*/
package ghidra.feature.vt.api;
-import static ghidra.feature.vt.db.VTTestUtils.addr;
-import static ghidra.feature.vt.db.VTTestUtils.createMatchSetWithOneDataMatch;
-import static org.junit.Assert.assertEquals;
+import static ghidra.feature.vt.db.VTTestUtils.*;
+import static org.junit.Assert.*;
import java.util.*;
@@ -157,7 +156,7 @@ public class VTMatchAcceptTest extends AbstractGhidraHeadedIntegrationTest {
}
private Data setData(DataType dataType, int dtLength, Address address, Program program)
- throws CodeUnitInsertionException, DataTypeConflictException {
+ throws CodeUnitInsertionException {
Listing listing = program.getListing();
Data data = null;
diff --git a/Ghidra/Features/VersionTracking/src/test.slow/java/ghidra/feature/vt/api/VTMatchApplyTest.java b/Ghidra/Features/VersionTracking/src/test.slow/java/ghidra/feature/vt/api/VTMatchApplyTest.java
index b4f5608003..875845305e 100644
--- a/Ghidra/Features/VersionTracking/src/test.slow/java/ghidra/feature/vt/api/VTMatchApplyTest.java
+++ b/Ghidra/Features/VersionTracking/src/test.slow/java/ghidra/feature/vt/api/VTMatchApplyTest.java
@@ -1847,7 +1847,7 @@ public class VTMatchApplyTest extends AbstractGhidraHeadedIntegrationTest {
}
private Data setData(DataType dataType, int dtLength, Address address, Program program)
- throws CodeUnitInsertionException, DataTypeConflictException {
+ throws CodeUnitInsertionException {
Listing listing = program.getListing();
Data data = null;
diff --git a/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/database/ListingDB.java b/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/database/ListingDB.java
index 7fe4341940..2c289d585e 100644
--- a/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/database/ListingDB.java
+++ b/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/database/ListingDB.java
@@ -279,13 +279,13 @@ class ListingDB implements Listing {
@Override
public Data createData(Address addr, DataType dataType)
- throws CodeUnitInsertionException, DataTypeConflictException {
+ throws CodeUnitInsertionException {
return codeMgr.createCodeUnit(addr, dataType, dataType.getLength());
}
@Override
public Data createData(Address addr, DataType dataType, int length)
- throws CodeUnitInsertionException, DataTypeConflictException {
+ throws CodeUnitInsertionException {
return codeMgr.createCodeUnit(addr, dataType, length);
}
diff --git a/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/data/DataTypeConflictException.java b/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/data/DataTypeConflictException.java
deleted file mode 100644
index 701114f315..0000000000
--- a/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/data/DataTypeConflictException.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/* ###
- * IP: GHIDRA
- * REVIEWED: YES
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package ghidra.program.model.data;
-
-/**
- * Exception thrown when an attempt is made to add a data type to a category
- * and the category has a data type by that name but the types do not
- * match.
- */
-public class DataTypeConflictException extends RuntimeException {
- DataType datatype1;
- DataType datatype2;
-
- /**
- * Construct a new DataTypeConflictException with no message
- */
- public DataTypeConflictException() {
- super();
- }
-
- /**
- * Construct a new DataTypeConflictException with the given message
- *
- * @param msg the exception message
- */
- public DataTypeConflictException(String msg) {
- super(msg);
- }
-
- /**
- * Construct a new DataTypeConflictException with the given datatypes.
- * The message will indicate there is a conflict between the two data types.
- *
- * @param dt1 the first of the two conflicting data types.
- * (The new data type.)
- * @param dt2 the second of the two conflicting data types.
- * (The existing data type.)
- */
- public DataTypeConflictException(DataType dt1, DataType dt2) {
- super("Data type \"" + dt1.getPathName() + "\" conflicts\nwith data type \"" +
- dt2.getPathName() + "\".\n");
- this.datatype1 = dt1;
- this.datatype2 = dt2;
- }
-
- /**
- * Returns the conflicting data types in a Data Type array of size 2.
- * The first entry is the first data type in conflict.
- * The second entry is the second data type in conflict.
- * <P>Note: These values can be null. They are only known if this
- * object was created using the constructor that has the conflicting
- * data types as parameters.
- * @return the two conflicting data types or nulls.
- */
- public DataType[] getConflictingDataTypes() {
- return new DataType[] { this.datatype1, this.datatype2 };
- }
-}
diff --git a/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/listing/Listing.java b/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/listing/Listing.java
index 6d2e66f220..aa0b8e31c2 100644
--- a/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/listing/Listing.java
+++ b/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/listing/Listing.java
@@ -635,11 +635,9 @@ public interface Listing {
* @return newly created data unit
* @exception CodeUnitInsertionException thrown if the new Instruction would
* overlap and existing Instruction or defined data.
- * @throws DataTypeConflictException if the given datatype conflicts (same
- * name, but not equal) with an existing datatype.
*/
public Data createData(Address addr, DataType dataType, int length)
- throws CodeUnitInsertionException, DataTypeConflictException;
+ throws CodeUnitInsertionException;
/**
* Creates a new defined Data object at the given address. This ignores the
@@ -651,11 +649,9 @@ public interface Listing {
* @return newly created data unit
* @exception CodeUnitInsertionException thrown if the new Instruction would
* overlap and existing Instruction or defined data.
- * @throws DataTypeConflictException if the given datatype conflicts (same
- * name, but not equal) with an existing datatype.
*/
public Data createData(Address addr, DataType dataType)
- throws CodeUnitInsertionException, DataTypeConflictException;
+ throws CodeUnitInsertionException;
/**
* Clears any code units in the given range returning everything to "db"s,
diff --git a/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/listing/ListingStub.java b/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/listing/ListingStub.java
index 3fbeda071a..5d0bf1bf11 100644
--- a/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/listing/ListingStub.java
+++ b/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/listing/ListingStub.java
@@ -299,13 +299,13 @@ public class ListingStub implements Listing {
@Override
public Data createData(Address addr, DataType dataType, int length)
- throws CodeUnitInsertionException, DataTypeConflictException {
+ throws CodeUnitInsertionException {
throw new UnsupportedOperationException();
}
@Override
public Data createData(Address addr, DataType dataType)
- throws CodeUnitInsertionException, DataTypeConflictException {
+ throws CodeUnitInsertionException {
throw new UnsupportedOperationException();
}
diff --git a/Ghidra/Processors/ARM/src/main/java/ghidra/app/plugin/core/analysis/ArmAnalyzer.java b/Ghidra/Processors/ARM/src/main/java/ghidra/app/plugin/core/analysis/ArmAnalyzer.java
index 9e8d9c9730..585de43828 100644
--- a/Ghidra/Processors/ARM/src/main/java/ghidra/app/plugin/core/analysis/ArmAnalyzer.java
+++ b/Ghidra/Processors/ARM/src/main/java/ghidra/app/plugin/core/analysis/ArmAnalyzer.java
@@ -636,9 +636,6 @@ public class ArmAnalyzer extends ConstantPropagationAnalyzer {
catch (CodeUnitInsertionException e) {
data = program.getListing().getDefinedDataAt(address);
}
- catch (DataTypeConflictException e) {
- // ignore data type conflict
- }
int addrByteSize = dt.getLength();
//data = program.getListing().getDefinedDataAt(address);
if (data != null) {
diff --git a/Ghidra/Processors/PowerPC/src/main/java/ghidra/app/plugin/core/analysis/PowerPCAddressAnalyzer.java b/Ghidra/Processors/PowerPC/src/main/java/ghidra/app/plugin/core/analysis/PowerPCAddressAnalyzer.java
index 0d698a4737..9e5172060f 100644
--- a/Ghidra/Processors/PowerPC/src/main/java/ghidra/app/plugin/core/analysis/PowerPCAddressAnalyzer.java
+++ b/Ghidra/Processors/PowerPC/src/main/java/ghidra/app/plugin/core/analysis/PowerPCAddressAnalyzer.java
@@ -626,9 +626,6 @@ public class PowerPCAddressAnalyzer extends ConstantPropagationAnalyzer {
catch (CodeUnitInsertionException e) {
// ignore
}
- catch (DataTypeConflictException e) {
- // ignore
- }
}
}
}