GP-111_emteere_RTTI3_CreationFix minor doc changes

This commit is contained in:
emteere
2020-08-27 15:53:09 -04:00
parent 655b3a5a25
commit 107a8d09a0
2 changed files with 11 additions and 14 deletions
@@ -167,7 +167,7 @@ public abstract class AbstractCreateDataBackgroundCmd<T extends AbstractCreateDa
return false;
}
boolean didCreate = createData();
boolean dataWasCreated = createData();
boolean success = true;
@@ -182,9 +182,10 @@ public abstract class AbstractCreateDataBackgroundCmd<T extends AbstractCreateDa
success = false;
}
// If following data when applying, create any data referred to by the data just created.
if (didCreate && applyOptions.shouldFollowData() && !createAssociatedData()) {
success = false;
// If data type didn't exist (was created) and following data when applying,
if (dataWasCreated && applyOptions.shouldFollowData()) {
// create any data referred to by the data just created
success = createAssociatedData();
}
setStatusMsg(getName() + " completed successfully!");
return success;
@@ -200,7 +201,7 @@ public abstract class AbstractCreateDataBackgroundCmd<T extends AbstractCreateDa
* Creates data at this command's address using the data type obtained from the model.
* <br>If you need to create data other than by using the data type returned from getDataType(),
* you should override this method.
* @return true if had to create, false otherwise
* @return false if the data type was not created because it already exists, true otherwise
* @throws CodeUnitInsertionException if the data can't be created.
* @throws CancelledException if the user cancels this task.
*/
@@ -21,7 +21,6 @@ import ghidra.program.model.address.Address;
import ghidra.program.model.data.*;
import ghidra.program.model.listing.*;
import ghidra.program.model.util.CodeUnitInsertionException;
import ghidra.util.Msg;
import ghidra.util.exception.CancelledException;
import ghidra.util.exception.InvalidInputException;
@@ -90,13 +89,15 @@ public class CreateTypeDescriptorBackgroundCmd
* as its last component ( char[0] name ). The string data associated with this flexible char array will
* be applied as a sized character array immediately following the structure whose size does not include
* the char array bytes.
* @return true if the data type needed to be created
* @return false if the data type was not created because it already exists, true otherwise
* @throws CodeUnitInsertionException
* @throws CancelledException
*/
@Override
protected boolean createData() throws CodeUnitInsertionException, CancelledException {
super.createData(); // create the TypeDesciptor structure
if (!super.createData()) { // create the TypeDesciptor structure
return false;
}
// Determine the size of the flexible char array storage and create properly sized array
DataType dataType = model.getDataType();
@@ -110,12 +111,7 @@ public class CreateTypeDescriptorBackgroundCmd
Data nameData = DataUtilities.createData(program, arrayAddr, charArray,
charArray.getLength(), false, getClearDataMode());
if (nameData != null) {
nameData.setComment(CodeUnit.EOL_COMMENT, "TypeDescriptor.name");
}
else {
Msg.error(this, "Failed to create TypeDescriptor name at " + arrayAddr);
}
nameData.setComment(CodeUnit.EOL_COMMENT, "TypeDescriptor.name");
return true;
}