diff --git a/Ghidra/Features/Base/src/main/help/help/topics/ExporterPlugin/exporter.htm b/Ghidra/Features/Base/src/main/help/help/topics/ExporterPlugin/exporter.htm index 2166be79db..7cc81d3288 100644 --- a/Ghidra/Features/Base/src/main/help/help/topics/ExporterPlugin/exporter.htm +++ b/Ghidra/Features/Base/src/main/help/help/topics/ExporterPlugin/exporter.htm @@ -308,7 +308,7 @@ address space.
  • Record Size - Specifies the size (in bytes) of each record in the output file. The default 16.
  • -
  • Force - If checked, this will ensure that only records matching +
  • Drop Extra Bytes - If checked, this will ensure that only records matching the record size will be output. eg: if you set the record size to 16 but there are 18 bytes selected, you will see only one line of 16 bytes in the output; the remaining 2 bytes will be dropped.
  • diff --git a/Ghidra/Features/Base/src/main/help/help/topics/ExporterPlugin/images/Intel_Hex_Options.png b/Ghidra/Features/Base/src/main/help/help/topics/ExporterPlugin/images/Intel_Hex_Options.png index 19ecef3db6..8d6087886a 100644 Binary files a/Ghidra/Features/Base/src/main/help/help/topics/ExporterPlugin/images/Intel_Hex_Options.png and b/Ghidra/Features/Base/src/main/help/help/topics/ExporterPlugin/images/Intel_Hex_Options.png differ diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/util/exporter/IntelHexExporter.java b/Ghidra/Features/Base/src/main/java/ghidra/app/util/exporter/IntelHexExporter.java index eaf04de5bc..7b86e60c4d 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/app/util/exporter/IntelHexExporter.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/app/util/exporter/IntelHexExporter.java @@ -39,8 +39,8 @@ import ghidra.util.task.TaskMonitor; *

    * The output defaults to lines of 16-bytes but this is configurable using the * {@link #recordSizeOption} attribute. This allows users to select any record size - * up to the max of 0xFF. Users may also choose to force a record size for every line - * of output, which will only print out lines that match the max record size; any other + * up to the max of 0xFF. Users may also choose to Drop Extra Bytes, which will + * cause only lines that match the max record size to be printed; any other * bytes will be dropped. If this option is not set, every byte will be represented in the output. */ public class IntelHexExporter extends Exporter { @@ -100,8 +100,8 @@ public class IntelHexExporter extends Exporter { /** * Option for exporting Intel Hex records that allows users to specify a record size for the - * output. Users may also optionally specify a force option that will only output - * lines that match this maximum size. + * output. Users may also optionally select the Drop Extra Bytes option that + * will cause only those records that match the maximum size to be output to the file. * * @see RecordSizeComponent */ @@ -140,8 +140,8 @@ public class IntelHexExporter extends Exporter { return Integer.class; } - public boolean getForce() { - return comp.getForce(); + public boolean dropExtraBytes() { + return comp.dropExtraBytes(); } } @@ -151,28 +151,28 @@ public class IntelHexExporter extends Exporter { *

    * - * Note: If the force option is set, any bytes that are left over after outputting - * all lines that match the record size will be dropped on the floor. + * Note: If the Drop Extra Bytes option is set, any bytes that are left over + * after outputting all lines that match the record size will be omitted from the output. */ private class RecordSizeComponent extends JPanel { private HintTextField input; - private JCheckBox forceCb; + private JCheckBox dropCb; public RecordSizeComponent(int recordSize) { setLayout(new BorderLayout()); input = new HintTextField(String.valueOf(recordSize), false, new BoundedIntegerVerifier()); - forceCb = new JCheckBox("force"); + dropCb = new JCheckBox("Drop Extra Bytes"); input.setText(String.valueOf(recordSize)); add(input, BorderLayout.CENTER); - add(forceCb, BorderLayout.EAST); + add(dropCb, BorderLayout.EAST); } public int getValue() { @@ -184,8 +184,8 @@ public class IntelHexExporter extends Exporter { return Integer.valueOf(val); } - public boolean getForce() { - return forceCb.isSelected(); + public boolean dropExtraBytes() { + return dropCb.isSelected(); } } @@ -276,9 +276,9 @@ public class IntelHexExporter extends Exporter { AddressSetView addrSetView, TaskMonitor monitor) throws MemoryAccessException { int size = (int) recordSizeOption.getValue(); - boolean forceSize = recordSizeOption.getForce(); + boolean dropBytes = recordSizeOption.dropExtraBytes(); - IntelHexRecordWriter writer = new IntelHexRecordWriter(size, forceSize); + IntelHexRecordWriter writer = new IntelHexRecordWriter(size, dropBytes); AddressSet set = new AddressSet(addrSetView); diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/util/opinion/IntelHexRecordWriter.java b/Ghidra/Features/Base/src/main/java/ghidra/app/util/opinion/IntelHexRecordWriter.java index 471842790e..16d21698c1 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/app/util/opinion/IntelHexRecordWriter.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/app/util/opinion/IntelHexRecordWriter.java @@ -22,7 +22,7 @@ import ghidra.program.model.address.*; public class IntelHexRecordWriter { private final int maxBytesPerLine; - private final boolean forceSize; + private final boolean dropExtraBytes; private Address startAddress = null; private Long oldSegment = null; @@ -36,15 +36,15 @@ public class IntelHexRecordWriter { * Constructor * * @param maxBytesPerLine the maximum number of bytes to write per line in the hex output - * @param forceSize if true, only lines matching {@link #maxBytesPerLine} will be output; + * @param dropExtraBytes if true, only lines matching {@link #maxBytesPerLine} will be output; * remaining bytes will be left out */ - public IntelHexRecordWriter(int maxBytesPerLine, boolean forceSize) { + public IntelHexRecordWriter(int maxBytesPerLine, boolean dropExtraBytes) { if (maxBytesPerLine > IntelHexRecord.MAX_RECORD_LENGTH) { throw new IllegalArgumentException("maxBytesPerLine > IntelHexRecord.MAX_RECORD_LENGTH"); } this.maxBytesPerLine = maxBytesPerLine; - this.forceSize = forceSize; + this.dropExtraBytes = dropExtraBytes; } public void addByte(Address address, byte b) { @@ -129,8 +129,9 @@ public class IntelHexRecordWriter { public List finish(Address entryPoint) { // Before finalizing things, write out any remaining bytes that haven't yet been written, if - // the user has specified to do so via the force option (false = write out everything). - if (bytes.size() > 0 && !forceSize) { + // the user has specified to do so via the drop extra bytes option (false = + // write out everything). + if (bytes.size() > 0 && !dropExtraBytes) { emitData(); }