Skip to content

Ghidra is a software reverse engineering (SRE) framework

Removal of old deprecated methods

dragonmacherd05a57ae1a90
diff --git a/Ghidra/Debug/Framework-TraceModeling/src/main/java/ghidra/trace/database/program/DBTraceProgramViewSymbolTable.java b/Ghidra/Debug/Framework-TraceModeling/src/main/java/ghidra/trace/database/program/DBTraceProgramViewSymbolTable.java
index 0720a58ba0..88be90a743 100644
--- a/Ghidra/Debug/Framework-TraceModeling/src/main/java/ghidra/trace/database/program/DBTraceProgramViewSymbolTable.java
+++ b/Ghidra/Debug/Framework-TraceModeling/src/main/java/ghidra/trace/database/program/DBTraceProgramViewSymbolTable.java
@@ -87,12 +87,6 @@ public class DBTraceProgramViewSymbolTable implements SymbolTable {
return symbolManager.labels().create(program.snap, null, addr, name, global, source);
}
- @Override
- public Symbol createSymbol(Address addr, String name, SourceType source)
- throws InvalidInputException {
- return createLabel(addr, name, source);
- }
-
@Override
public Symbol createLabel(Address addr, String name, Namespace namespace, SourceType source)
throws InvalidInputException {
@@ -101,12 +95,6 @@ public class DBTraceProgramViewSymbolTable implements SymbolTable {
assertTraceNamespace(namespace), source);
}
- @Override
- public Symbol createSymbol(Address addr, String name, Namespace namespace, SourceType source)
- throws DuplicateNameException, InvalidInputException {
- return createLabel(addr, name, namespace, source);
- }
-
@Override
public boolean removeSymbolSpecial(Symbol sym) {
// TODO: I'm not sure I understand the point of this method...
@@ -196,26 +184,6 @@ public class DBTraceProgramViewSymbolTable implements SymbolTable {
return getSymbol(name, addr, global);
}
- @Override
- public Symbol getSymbol(String name, Namespace namespace) {
- try (LockHold hold = program.trace.lockRead()) {
- for (TraceSymbol sym : symbolManager.allSymbols()
- .getChildrenNamed(name,
- assertTraceNamespace(namespace))) {
- if (requireVisible(sym) == null) {
- continue;
- }
- return sym;
- }
- return null;
- }
- }
-
- @Override
- public Symbol getSymbol(String name) {
- return getSymbol(name, global);
- }
-
@Override
public List<Symbol> getSymbols(String name, Namespace namespace) {
TraceNamespaceSymbol parent = assertTraceNamespace(namespace);
diff --git a/Ghidra/Features/Base/ghidra_scripts/PropagateExternalParametersScript.java b/Ghidra/Features/Base/ghidra_scripts/PropagateExternalParametersScript.java
index 098e6afdf4..1eecf5918e 100644
--- a/Ghidra/Features/Base/ghidra_scripts/PropagateExternalParametersScript.java
+++ b/Ghidra/Features/Base/ghidra_scripts/PropagateExternalParametersScript.java
@@ -56,7 +56,7 @@ public class PropagateExternalParametersScript extends GhidraScript {
}
}
- // use the 'results' to propagate param info to the local variables, data, and params of
+ // use the 'results' to propagate param info to the local variables, data, and params of
// the calling function
//println("Processing propagation results - count: " + results.size());
for (int i = 0; i < results.size(); i++) {
@@ -68,7 +68,7 @@ public class PropagateExternalParametersScript extends GhidraScript {
continue;
}
- //If operand of pushed parameter points to data make a symbol and comment at that location
+ //If operand of pushed parameter points to data make a symbol and comment at that location
if (((opType & OperandType.ADDRESS) != 0) && (((opType & OperandType.DATA) != 0)) ||
((opType & OperandType.SCALAR) != 0) || ((opType & OperandType.DYNAMIC) != 0)) {
Reference[] refs = listing.getCodeUnitAt(ppi.getAddress()).getOperandReferences(0);
@@ -88,7 +88,9 @@ public class PropagateExternalParametersScript extends GhidraScript {
String newComment = new String(
ppi.getName() + " parameter of " + ppi.getCalledFunctionName() + "\n");
- if ((getSymbol(symbolName, null) == null) && (isString == false)) {
+ List<Symbol> symbols = getSymbols(symbolName, null);
+
+ if (symbols.isEmpty() && !isString) {
createLabel(dataAddress, symbolName, true, SourceType.USER_DEFINED);
}
@@ -101,8 +103,10 @@ public class PropagateExternalParametersScript extends GhidraScript {
}
if ((data != null) &&
- (listing.getCodeUnitAt(dataAddress).getMnemonicString().startsWith(
- "undefined"))) {
+ (listing.getCodeUnitAt(dataAddress)
+ .getMnemonicString()
+ .startsWith(
+ "undefined"))) {
clearListing(dataAddress);
}
if (listing.isUndefined(dataAddress, dataAddress.add(dt.getLength() - 1))) {
@@ -182,7 +186,7 @@ public class PropagateExternalParametersScript extends GhidraScript {
* PUSH arg 2 to call func2 |
* PUSH arg 1 to call func2 | -- want to bypass these
* CALL func2 ___|
- * PUSH arg 2 to call func1 ; put arg2 of func1 here
+ * PUSH arg 2 to call func1 ; put arg2 of func1 here
* PUSH arg 1 to call func1 ; put arg1 of func1 here
* CALL func1
*/
@@ -272,7 +276,7 @@ public class PropagateExternalParametersScript extends GhidraScript {
// need to take into account calls between the pushes and skip the pushes for those calls
// skip pushes that are used for another call
- // if label, then probably a branch, allow current push to be commented and
+ // if label, then probably a branch, allow current push to be commented and
// next time through stop
// can also be a branch if not label there but this case should still have parameters set
// before it as long as not an unconditional jump - this wouldn't make sense so it shouldn't happen
@@ -292,7 +296,7 @@ public class PropagateExternalParametersScript extends GhidraScript {
else {
setEOLComment(cu.getMinAddress(), params[index].getDataType().getDisplayName() +
" " + params[index].getName() + " for " + extFuncName);
- // add the following to the EOL comment to see the value of the optype
+ // add the following to the EOL comment to see the value of the optype
// +" " + toHexString(currentProgram.getListing().getInstructionAt(cu.getMinAddress()).getOperandType(0), false, true)
addResult(params[index].getName(), params[index].getDataType(),
cu.getMinAddress(), extFuncName);
diff --git a/Ghidra/Features/Base/src/main/java/ghidra/program/flatapi/FlatProgramAPI.java b/Ghidra/Features/Base/src/main/java/ghidra/program/flatapi/FlatProgramAPI.java
index c178e39a09..33933b397e 100644
--- a/Ghidra/Features/Base/src/main/java/ghidra/program/flatapi/FlatProgramAPI.java
+++ b/Ghidra/Features/Base/src/main/java/ghidra/program/flatapi/FlatProgramAPI.java
@@ -56,16 +56,14 @@ import ghidra.util.task.TaskMonitor;
* <p>
* NOTE:
* <ol>
- * <li>NO METHODS SHOULD EVER BE REMOVED FROM THIS CLASS.
- * <li>NO METHOD SIGNATURES SHOULD EVER BE CHANGED IN THIS CLASS.
+ * <li>NO METHODS *SHOULD* EVER BE REMOVED FROM THIS CLASS.
+ * <li>NO METHOD SIGNATURES *SHOULD* EVER BE CHANGED IN THIS CLASS.
* </ol>
* <p>
* This class is used by GhidraScript.
* <p>
* Changing this class will break user scripts.
* <p>
- * That is bad. Don't do that.
- * <p>
*/
public class FlatProgramAPI {
public static final int MAX_REFERENCES_TO = 0x1000;
@@ -239,7 +237,7 @@ public class FlatProgramAPI {
/**
* Clears the code unit (instruction or data) defined at the address.
* @param address the address to clear the code unit
- * @throws CancelledException
+ * @throws CancelledException if cancelled
*/
public final void clearListing(Address address) throws CancelledException {
clearListing(address, address);
@@ -249,7 +247,7 @@ public class FlatProgramAPI {
* Clears the code units (instructions or data) in the specified range.
* @param start the start address
* @param end the end address
- * @throws CancelledException
+ * @throws CancelledException if cancelled
*/
public final void clearListing(Address start, Address end) throws CancelledException {
currentProgram.getListing().clearCodeUnits(start, end, false, monitor);
@@ -258,7 +256,7 @@ public class FlatProgramAPI {
/**
* Clears the code units (instructions or data) in the specified set
* @param set the set to clear
- * @throws CancelledException
+ * @throws CancelledException if cancelled
*/
public final void clearListing(AddressSetView set) throws CancelledException {
AddressRangeIterator iter = set.getAddressRanges();
@@ -320,6 +318,7 @@ public class FlatProgramAPI {
* @param length the size of the block
* @param overlay true will create an overlay, false will not
* @return the newly created memory block
+ * @throws Exception if there is any exception
*/
public final MemoryBlock createMemoryBlock(String name, Address start, InputStream input,
long length, boolean overlay) throws Exception {
@@ -340,6 +339,7 @@ public class FlatProgramAPI {
* @param bytes the bytes of the memory block
* @param overlay true will create an overlay, false will not
* @return the newly created memory block
+ * @throws Exception if there is any exception
*/
public final MemoryBlock createMemoryBlock(String name, Address start, byte[] bytes,
boolean overlay) throws Exception {
@@ -384,6 +384,7 @@ public class FlatProgramAPI {
* NOTE: ALL ANNOTATION (disassembly, comments, etc) defined in this
* memory block will also be removed!
* @param block the block to be removed
+ * @throws Exception if there is any exception
*/
public final void removeMemoryBlock(MemoryBlock block) throws Exception {
currentProgram.getMemory().removeBlock(block, monitor);
@@ -396,6 +397,7 @@ public class FlatProgramAPI {
* @param name the name of the symbol
* @param makePrimary true if the symbol should be made primary
* @return the newly created code or function symbol
+ * @throws Exception if there is any exception
*/
public final Symbol createLabel(Address address, String name, boolean makePrimary)
throws Exception {
@@ -422,6 +424,7 @@ public class FlatProgramAPI {
* @param makePrimary true if the symbol should be made primary
* @param sourceType the source type.
* @return the newly created code or function symbol
+ * @throws Exception if there is any exception
*/
public final Symbol createLabel(Address address, String name, boolean makePrimary,
SourceType sourceType) throws Exception {
@@ -439,6 +442,7 @@ public class FlatProgramAPI {
* @param makePrimary true if the symbol should be made primary
* @param sourceType the source type.
* @return the newly created code or function symbol
+ * @throws Exception if there is any exception
*/
public final Symbol createLabel(Address address, String name, Namespace namespace,
boolean makePrimary, SourceType sourceType) throws Exception {
@@ -936,13 +940,16 @@ public class FlatProgramAPI {
* Search for sequences of Ascii strings in program memory. See {@link AsciiCharSetRecognizer}
* to see exactly what chars are considered ASCII for purposes of this search.
* @param addressSet The address set to search. Use null to search all memory;
- * @param minimumStringLength The smallest number of chars in a sequence to be considered a "string".
- * @param alignment specifies any alignment requirements for the start of the string. An alignment
- * of 1, means the string can start at any address. An alignment of 2 means the string must
- * start on an even address and so on. Only allowed values are 1,2, and 4.
+ * @param minimumStringLength The smallest number of chars in a sequence to be considered a
+ * "string".
+ * @param alignment specifies any alignment requirements for the start of the string. An
+ * alignment of 1, means the string can start at any address. An alignment of 2 means the
+ * string must start on an even address and so on. Only allowed values are 1,2, and 4.
* @param requireNullTermination If true, only strings that end in a null will be returned.
- * @param includeAllCharWidths if true, UTF16 and UTF32 size strings will be included in addition to UTF8.
- * @return a list of "FoundString" objects which contain the addresses, length, and type of possible strings.
+ * @param includeAllCharWidths if true, UTF16 and UTF32 size strings will be included in
+ * addition to UTF8.
+ * @return a list of "FoundString" objects which contain the addresses, length, and type of
+ * possible strings.
*/
public List<FoundString> findStrings(AddressSetView addressSet, int minimumStringLength,
int alignment, boolean requireNullTermination, boolean includeAllCharWidths) {
@@ -959,15 +966,18 @@ public class FlatProgramAPI {
}
/**
- * Search for sequences of Pascal Ascii strings in program memory. See {@link AsciiCharSetRecognizer}
- * to see exactly what chars are considered ASCII for purposes of this search.
+ * Search for sequences of Pascal Ascii strings in program memory. See
+ * {@link AsciiCharSetRecognizer} to see exactly what chars are considered ASCII for purposes
+ * of this search.
* @param addressSet The address set to search. Use null to search all memory;
- * @param minimumStringLength The smallest number of chars in a sequence to be considered a "string".
- * @param alignment specifies any alignment requirements for the start of the string. An alignment
- * of 1, means the string can start at any address. An alignment of 2 means the string must
- * start on an even address and so on. Only allowed values are 1,2, and 4.
+ * @param minimumStringLength The smallest number of chars in a sequence to be considered a
+ * "string".
+ * @param alignment specifies any alignment requirements for the start of the string. An
+ * alignment of 1, means the string can start at any address. An alignment of 2 means the
+ * string must start on an even address and so on. Only allowed values are 1,2, and 4.
* @param includePascalUnicode if true, UTF16 size strings will be included in addition to UTF8.
- * @return a list of "FoundString" objects which contain the addresses, length, and type of possible strings.
+ * @return a list of "FoundString" objects which contain the addresses, length, and type of
+ * possible strings.
*/
public List<FoundString> findPascalStrings(AddressSetView addressSet, int minimumStringLength,
int alignment, boolean includePascalUnicode) {
@@ -1061,7 +1071,7 @@ public class FlatProgramAPI {
return null;
}
Function func = iterator.next();
- // if the function found starts at the start addres, go to the next one.
+ // if the function found starts at the start address, go to the next one.
if (address.equals(func.getEntryPoint())) {
func = null;
if (iterator.hasNext()) {
@@ -1101,7 +1111,7 @@ public class FlatProgramAPI {
return null;
}
Function func = iterator.next();
- // if the function found starts at the start addres, go to the next one.
+ // if the function found starts at the start address, go to the next one.
if (address.equals(func.getEntryPoint())) {
func = null;
if (iterator.hasNext()) {
@@ -1176,6 +1186,7 @@ public class FlatProgramAPI {
/**
* Returns the first instruction in the function.
+ * @param function the function
* @return the first instruction in the function
*/
public final Instruction getFirstInstruction(Function function) {
@@ -1633,6 +1644,7 @@ public class FlatProgramAPI {
* @param address the address at which to create a new Data object.
* @param datatype the Data Type that describes the type of Data object to create.
* @return the newly created Data object
+ * @throws Exception if there is any exception
*/
public final Data createData(Address address, DataType datatype) throws Exception {
Listing listing = currentProgram.getListing();
@@ -1650,6 +1662,7 @@ public class FlatProgramAPI {
* Creates a byte datatype at the given address.
* @param address the address to create the byte
* @return the newly created Data object
+ * @throws Exception if there is any exception
*/
public final Data createByte(Address address) throws Exception {
return createData(address, new ByteDataType());
@@ -1659,6 +1672,7 @@ public class FlatProgramAPI {
* Creates a word datatype at the given address.
* @param address the address to create the word
* @return the newly created Data object
+ * @throws Exception if there is any exception
*/
public final Data createWord(Address address) throws Exception {
return createData(address, new WordDataType());
@@ -1668,6 +1682,7 @@ public class FlatProgramAPI {
* Creates a dword datatype at the given address.
* @param address the address to create the dword
* @return the newly created Data object
+ * @throws Exception if there is any exception
*/
public final Data createDWord(Address address) throws Exception {
return createData(address, new DWordDataType());
@@ -1677,6 +1692,7 @@ public class FlatProgramAPI {
* Creates a list of dword datatypes starting at the given address.
* @param start the start address to create the dwords
* @param count the number of dwords to create
+ * @throws Exception if there is any exception
*/
public final void createDwords(Address start, int count) throws Exception {
for (int i = 0; i < count; ++i) {
@@ -1689,6 +1705,7 @@ public class FlatProgramAPI {
* Creates a qword datatype at the given address.
* @param address the address to create the qword
* @return the newly created Data object
+ * @throws Exception if there is any exception
*/
public final Data createQWord(Address address) throws Exception {
return createData(address, new QWordDataType());
@@ -1698,6 +1715,7 @@ public class FlatProgramAPI {
* Creates a float datatype at the given address.
* @param address the address to create the float
* @return the newly created Data object
+ * @throws Exception if there is any exception
*/
public final Data createFloat(Address address) throws Exception {
return createData(address, new FloatDataType());
@@ -1707,6 +1725,7 @@ public class FlatProgramAPI {
* Creates a double datatype at the given address.
* @param address the address to create the double
* @return the newly created Data object
+ * @throws Exception if there is any exception
*/
public final Data createDouble(Address address) throws Exception {
return createData(address, new DoubleDataType());
@@ -1716,6 +1735,7 @@ public class FlatProgramAPI {
* Creates a char datatype at the given address.
* @param address the address to create the char
* @return the newly created Data object
+ * @throws Exception if there is any exception
*/
public final Data createChar(Address address) throws Exception {
return createData(address, new CharDataType());
@@ -1726,6 +1746,7 @@ public class FlatProgramAPI {
* at the specified address.
* @param address the address to create the string
* @return the newly created Data object
+ * @throws Exception if there is any exception
*/
public final Data createAsciiString(Address address) throws Exception {
return createData(address, new TerminatedStringDataType());
@@ -1733,12 +1754,11 @@ public class FlatProgramAPI {
/**
* Create an ASCII string at the specified address.
- * @param address
+ * @param address the address
* @param length length of string (a value of 0 or negative will force use
* of dynamic null terminated string)
* @return string data created
- * @throws CodeUnitInsertionException
- * @throws DataTypeConflictException
+ * @throws CodeUnitInsertionException if there is a data conflict
*/
public final Data createAsciiString(Address address, int length)
throws CodeUnitInsertionException {
@@ -1761,11 +1781,10 @@ public class FlatProgramAPI {
}
/**
- * Creates a null terminated unicode string starting
- * at the specified address.
+ * Creates a null terminated unicode string starting at the specified address.
* @param address the address to create the string
* @return the newly created Data object
- * @throws Exception
+ * @throws Exception if there is any exception
*/
public final Data createUnicodeString(Address address) throws Exception {
return createData(address, new TerminatedUnicodeDataType());
@@ -1774,6 +1793,7 @@ public class FlatProgramAPI {
/**
* Removes the given data from the current program.
* @param data the data to remove
+ * @throws Exception if there is any exception
*/
public final void removeData(Data data) throws Exception {
clearListing(data.getMinAddress(), data.getMaxAddress());
@@ -1782,6 +1802,7 @@ public class FlatProgramAPI {
/**
* Removes the data containing the given address from the current program.
* @param address the address to remove data
+ * @throws Exception if there is any exception
*/
public final void removeDataAt(Address address) throws Exception {
Data data = getDataContaining(address);
@@ -1793,6 +1814,7 @@ public class FlatProgramAPI {
/**
* Removes the given instruction from the current program.
* @param instruction the instruction to remove
+ * @throws Exception if there is any exception
*/
public final void removeInstruction(Instruction instruction) throws Exception {
clearListing(instruction.getMinAddress(), instruction.getMaxAddress());
@@ -1801,6 +1823,7 @@ public class FlatProgramAPI {
/**
* Removes the instruction containing the given address from the current program.
* @param address the address to remove instruction
+ * @throws Exception if there is any exception
*/
public final void removeInstructionAt(Address address) throws Exception {
Instruction instruction = getInstructionContaining(address);
@@ -2259,6 +2282,7 @@ public class FlatProgramAPI {
* @param equateName the name of the equate
* @return the newly created equate
* @throws InvalidInputException if a scalar does not exist on the data
+ * @throws Exception if there is any exception
*/
public final Equate createEquate(Data data, String equateName) throws Exception {
Object value = data.getValue();
@@ -2273,18 +2297,6 @@ public class FlatProgramAPI {
"Unable to create equate on non-scalar value at " + data.getMinAddress());
}
- /**
- * Returns the equate defined at the operand index of the instruction.
- * @param instruction the instruction
- * @param operandIndex the operand index
- * @return the equate defined at the operand index of the instruction
- * @deprecated this form of getEquate is not supported and will throw a UnsupportedOperationException
- */
- @Deprecated
- public final Equate getEquate(Instruction instruction, int operandIndex) {
- throw new UnsupportedOperationException("this form of getEquate is unsupported");
- }
-
/**
* Returns the equate defined at the operand index of the instruction with the given value.
* @param instruction the instruction
@@ -2325,17 +2337,6 @@ public class FlatProgramAPI {
return null;
}
- /**
- * Removes the equate defined at the operand index of the instruction.
- * @param instruction the instruction
- * @param operandIndex the operand index
- * @deprecated this form of getEquate is not supported and will throw a UnsupportedOperationException
- */
- @Deprecated
- public final void removeEquate(Instruction instruction, int operandIndex) {
- throw new UnsupportedOperationException("this form of removeEquate is unsupported");
- }
-
/**
* Removes the equate defined at the operand index of the instruction with the given value.
* @param instruction the instruction
@@ -2431,6 +2432,8 @@ public class FlatProgramAPI {
* Opens a Data Type Archive
* @param archiveFile the archive file to open
* @param readOnly should file be opened read only
+ * @return the data type manager
+ * @throws Exception if there is any exception
*/
public final FileDataTypeManager openDataTypeArchive(File archiveFile, boolean readOnly)
throws Exception {
@@ -2445,7 +2448,7 @@ public class FlatProgramAPI {
* If a program already exists with the specified
* name, then a time stamp will be appended to the name to make it unique.
* @param program the program to save
- * @throws Exception
+ * @throws Exception if there is any exception
*/
public void saveProgram(Program program) throws Exception {
saveProgram(program, null);
@@ -2460,13 +2463,14 @@ public class FlatProgramAPI {
* If path is NULL, the program will be saved into the root folder. If parts of the path are
* missing, they will be created if possible.
* <p>
- * If a program already exists with the specified name, then a time stamp will be appended
+ * If a program already exists with the specified name, then a time stamp will be appended
* to the name to make it unique.
* <p>
* @param program the program to save
- * @param path list of string path elements (starting at the root of the project) that specify
- * the project folder to save the program info. Example: { "folder1", "subfolder2", "finalfolder" }
- * @throws Exception
+ * @param path list of string path elements (starting at the root of the project) that specify
+ * the project folder to save the program info. Example: { "folder1", "subfolder2",
+ * "final_folder" }
+ * @throws Exception if there is any exception
*/
public void saveProgram(Program program, List<String> path) throws Exception {
if (program == null) {
@@ -2533,12 +2537,6 @@ public class FlatProgramAPI {
return folder;
}
- /**
- *
- * @param type
- * @param text
- * @return
- */
private Address findComment(int type, String text) {
Listing listing = currentProgram.getListing();
Memory memory = currentProgram.getMemory();
diff --git a/Ghidra/Features/Base/src/test.slow/java/ghidra/app/plugin/core/datamgr/DataTypeManagerPluginTest.java b/Ghidra/Features/Base/src/test.slow/java/ghidra/app/plugin/core/datamgr/DataTypeManagerPluginTest.java
index 10b5c3c543..6f854fec5f 100644
--- a/Ghidra/Features/Base/src/test.slow/java/ghidra/app/plugin/core/datamgr/DataTypeManagerPluginTest.java
+++ b/Ghidra/Features/Base/src/test.slow/java/ghidra/app/plugin/core/datamgr/DataTypeManagerPluginTest.java
@@ -62,8 +62,8 @@ import ghidra.program.database.ProgramBuilder;
import ghidra.program.database.ProgramDB;
import ghidra.program.database.data.ProgramDataTypeManager;
import ghidra.program.model.data.*;
-import ghidra.test.*;
-import ghidra.util.task.TaskMonitor;
+import ghidra.test.AbstractGhidraHeadedIntegrationTest;
+import ghidra.test.TestEnv;
import util.CollectionUtils;
import utilities.util.FileUtilities;
@@ -1088,18 +1088,6 @@ public class DataTypeManagerPluginTest extends AbstractGhidraHeadedIntegrationTe
waitForTree();
}
- private void waitForActionToBeEnabled(DockingActionIf action) {
- int numWaits = 0;
- while (!action.isEnabled() && ++numWaits < 50) {
- try {
- Thread.sleep(100);
- }
- catch (InterruptedException e) {
- // don't care; will try again
- }
- }
- }
-
private void undo() throws Exception {
runSwing(() -> {
try {
@@ -1204,33 +1192,6 @@ public class DataTypeManagerPluginTest extends AbstractGhidraHeadedIntegrationTe
}
}
- private void compileJavaDataType() throws Exception {
-
- boolean success = false;
- try {
- File file = getTestDataTypeFile();
- File binDir = getClassesDirectory();
- if (!binDir.exists()) {
- if (!binDir.mkdir()) {
- Assert.fail("Could not create directory " + binDir.getAbsolutePath());
- }
- }
-
- File javaFile = new File(binDir, "TestDataType.java");
- FileUtilities.copyFile(file, javaFile, false, TaskMonitor.DUMMY);
- assertTrue(javaFile.exists());
-
- JavaCompiler j = new JavaCompiler();
- j.compile(javaFile);
- success = true;
- }
- finally {
- if (!success) {
- removeBinTestDir();
- }
- }
- }
-
private File getTestDataTypeFile() {
URL url = getClass().getResource("TestDataType.txt");
try {
diff --git a/Ghidra/Features/Decompiler/src/main/java/ghidra/app/decompiler/component/DecompilerHighlightService.java b/Ghidra/Features/Decompiler/src/main/java/ghidra/app/decompiler/component/DecompilerHighlightService.java
deleted file mode 100644
index 0cede23117..0000000000
--- a/Ghidra/Features/Decompiler/src/main/java/ghidra/app/decompiler/component/DecompilerHighlightService.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/* ###
- * IP: GHIDRA
- *
- * 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.app.decompiler.component;
-
-/**
- * A poorly designed interface that does not correctly allow for modifying highlights
- */
-@Deprecated // this will be removed after 9.2
-public interface DecompilerHighlightService {
-
- /**
- * Returns the layout model of the Decompiler
- * @return the layout model
- */
- @Deprecated
- public ClangLayoutController getLayoutModel();
-
- /**
- * Clears the <b>primary</b> highlights in the Decompiler
- */
- @Deprecated
- public void clearHighlights();
-
-}
diff --git a/Ghidra/Features/Decompiler/src/main/java/ghidra/app/plugin/core/decompile/DecompilePlugin.java b/Ghidra/Features/Decompiler/src/main/java/ghidra/app/plugin/core/decompile/DecompilePlugin.java
index 6fd33a3913..9dd0eb1336 100644
--- a/Ghidra/Features/Decompiler/src/main/java/ghidra/app/plugin/core/decompile/DecompilePlugin.java
+++ b/Ghidra/Features/Decompiler/src/main/java/ghidra/app/plugin/core/decompile/DecompilePlugin.java
@@ -20,7 +20,6 @@ import java.util.*;
import org.jdom.Element;
import ghidra.app.CorePluginPackage;
-import ghidra.app.decompiler.component.DecompilerHighlightService;
import ghidra.app.decompiler.component.hover.DecompilerHoverService;
import ghidra.app.events.*;
import ghidra.app.plugin.PluginCategoryNames;
@@ -46,14 +45,13 @@ import ghidra.util.task.SwingUpdateManager;
category = PluginCategoryNames.ANALYSIS,
shortDescription = "Decompiler",
description = "Plugin for producing high-level decompilation",
- servicesRequired = {
- GoToService.class, NavigationHistoryService.class, ClipboardService.class,
+ servicesRequired = {
+ GoToService.class, NavigationHistoryService.class, ClipboardService.class,
DataTypeManagerService.class /*, ProgramManager.class */
- },
- servicesProvided = { DecompilerHighlightService.class },
- eventsConsumed = {
- ProgramActivatedPluginEvent.class, ProgramOpenedPluginEvent.class,
- ProgramLocationPluginEvent.class, ProgramSelectionPluginEvent.class,
+ },
+ eventsConsumed = {
+ ProgramActivatedPluginEvent.class, ProgramOpenedPluginEvent.class,
+ ProgramLocationPluginEvent.class, ProgramSelectionPluginEvent.class,
ProgramClosedPluginEvent.class
}
)
@@ -79,17 +77,10 @@ public class DecompilePlugin extends Plugin {
});
public DecompilePlugin(PluginTool tool) {
-
super(tool);
disconnectedProviders = new ArrayList<>();
connectedProvider = new PrimaryDecompilerProvider(this);
-
- registerServices();
- }
-
- private void registerServices() {
- registerServiceProvided(DecompilerHighlightService.class, connectedProvider);
}
@Override
diff --git a/Ghidra/Features/Decompiler/src/main/java/ghidra/app/plugin/core/decompile/DecompilerProvider.java b/Ghidra/Features/Decompiler/src/main/java/ghidra/app/plugin/core/decompile/DecompilerProvider.java
index cb1139c2f7..336cdbd07e 100644
--- a/Ghidra/Features/Decompiler/src/main/java/ghidra/app/plugin/core/decompile/DecompilerProvider.java
+++ b/Ghidra/Features/Decompiler/src/main/java/ghidra/app/plugin/core/decompile/DecompilerProvider.java
@@ -55,8 +55,7 @@ import resources.ResourceManager;
import utility.function.Callback;
public class DecompilerProvider extends NavigatableComponentProviderAdapter
- implements DomainObjectListener, OptionsChangeListener, DecompilerCallbackHandler,
- DecompilerHighlightService {
+ implements DomainObjectListener, OptionsChangeListener, DecompilerCallbackHandler {
final static String OPTIONS_TITLE = "Decompiler";
private static Icon REFRESH_ICON = Icons.REFRESH_ICON;
@@ -1074,17 +1073,4 @@ public class DecompilerProvider extends NavigatableComponentProviderAdapter
public void programClosed(Program closedProgram) {
controller.programClosed(closedProgram);
}
-
- @Deprecated // to be removed post 9.2; replace with an API to manipulate primary highlights
- @Override
- public ClangLayoutController getLayoutModel() {
- return (ClangLayoutController) getDecompilerPanel().getLayoutModel();
- }
-
- @Deprecated // to be removed post 9.2; replace with an API to manipulate primary highlights
- @Override
- public void clearHighlights() {
- getDecompilerPanel().clearPrimaryHighlights();
- }
-
}
diff --git a/Ghidra/Features/GnuDemangler/ghidra_scripts/VxWorksSymTab_5_4.java b/Ghidra/Features/GnuDemangler/ghidra_scripts/VxWorksSymTab_5_4.java
index 47af9fb626..f0af2fe43e 100644
--- a/Ghidra/Features/GnuDemangler/ghidra_scripts/VxWorksSymTab_5_4.java
+++ b/Ghidra/Features/GnuDemangler/ghidra_scripts/VxWorksSymTab_5_4.java
@@ -15,14 +15,14 @@
*/
// VxWorksSymTab_5_4 is a copy of VxWorksSymTab_6_1 with a different value for SYM_ENTRY_SIZE
// It was replaced at the request of a customer who tested that it worked with the slight modification
-// VxWorksSymTab_6_1 is an adaptation of the vxWorksSymTab script. It was modified by a customer
+// VxWorksSymTab_6_1 is an adaptation of the vxWorksSymTab script. It was modified by a customer
// to use a single loop, instead of two. It also added demangling of C++ symbol names - at least
// those that Ghidra knows how to demangle.
//
// Extracts all symbols in a VxWorks symbol table and disassembles
// the global functions. Any existing symbols in the Ghidra symbol table
// that collide with symbols defined in the VxWorks symbol table are deleted.
-//
+//
// The VxWorks symbol table is an array of symbol table entries [0..n-1]
// followed by a 32-bit value that is equal to n (number of sym tbl entries).
// Each entry in the array has the following structure:
@@ -48,6 +48,7 @@
import java.io.FileOutputStream;
import java.io.PrintWriter;
+import java.util.List;
import ghidra.app.cmd.label.DemanglerCmd;
import ghidra.app.script.GhidraScript;
@@ -189,8 +190,11 @@ public class VxWorksSymTab_5_4 extends GhidraScript {
createLabel(symLocAddr, symName, true);
if (symDemangledName != null) {
new DemanglerCmd(symLocAddr, symName).applyTo(currentProgram, monitor);
- ghidraSymTbl.removeSymbolSpecial(getSymbol(symName,
- currentProgram.getGlobalNamespace()));
+ List<Symbol> symbols =
+ getSymbols(symName, currentProgram.getGlobalNamespace());
+ if (!symbols.isEmpty()) {
+ ghidraSymTbl.removeSymbolSpecial(symbols.get(0));
+ }
}
break;
case 4: // Local .text
@@ -205,8 +209,11 @@ public class VxWorksSymTab_5_4 extends GhidraScript {
if (symDemangledName != null) {
new DemanglerCmd(symLocAddr, symName).applyTo(currentProgram,
monitor);
- ghidraSymTbl.removeSymbolSpecial(getSymbol(symName,
- currentProgram.getGlobalNamespace()));
+ List<Symbol> symbols =
+ getSymbols(symName, currentProgram.getGlobalNamespace());
+ if (!symbols.isEmpty()) {
+ ghidraSymTbl.removeSymbolSpecial(symbols.get(0));
+ }
}
}
else {
@@ -216,8 +223,11 @@ public class VxWorksSymTab_5_4 extends GhidraScript {
if (symDemangledName != null) {
new DemanglerCmd(symLocAddr, symName).applyTo(currentProgram,
monitor);
- ghidraSymTbl.removeSymbolSpecial(getSymbol(symName,
- currentProgram.getGlobalNamespace()));
+ List<Symbol> symbols =
+ getSymbols(symName, currentProgram.getGlobalNamespace());
+ if (!symbols.isEmpty()) {
+ ghidraSymTbl.removeSymbolSpecial(symbols.get(0));
+ }
}
}
break;
diff --git a/Ghidra/Features/GnuDemangler/ghidra_scripts/VxWorksSymTab_6_1.java b/Ghidra/Features/GnuDemangler/ghidra_scripts/VxWorksSymTab_6_1.java
index a58aafd326..beeeab2a94 100644
--- a/Ghidra/Features/GnuDemangler/ghidra_scripts/VxWorksSymTab_6_1.java
+++ b/Ghidra/Features/GnuDemangler/ghidra_scripts/VxWorksSymTab_6_1.java
@@ -46,6 +46,7 @@
import java.io.FileOutputStream;
import java.io.PrintWriter;
+import java.util.List;
import ghidra.app.cmd.label.DemanglerCmd;
import ghidra.app.script.GhidraScript;
@@ -185,8 +186,11 @@ public class VxWorksSymTab_6_1 extends GhidraScript {
createLabel(symLocAddr, symName, true);
if (symDemangledName != null) {
new DemanglerCmd(symLocAddr, symName).applyTo(currentProgram, monitor);
- ghidraSymTbl.removeSymbolSpecial(
- getSymbol(symName, currentProgram.getGlobalNamespace()));
+ List<Symbol> symbols =
+ getSymbols(symName, currentProgram.getGlobalNamespace());
+ if (!symbols.isEmpty()) {
+ ghidraSymTbl.removeSymbolSpecial(symbols.get(0));
+ }
}
break;
case 4: // Local .text
@@ -201,8 +205,11 @@ public class VxWorksSymTab_6_1 extends GhidraScript {
if (symDemangledName != null) {
new DemanglerCmd(symLocAddr, symName).applyTo(currentProgram,
monitor);
- ghidraSymTbl.removeSymbolSpecial(
- getSymbol(symName, currentProgram.getGlobalNamespace()));
+ List<Symbol> symbols =
+ getSymbols(symName, currentProgram.getGlobalNamespace());
+ if (!symbols.isEmpty()) {
+ ghidraSymTbl.removeSymbolSpecial(symbols.get(0));
+ }
}
}
else {
@@ -212,8 +219,11 @@ public class VxWorksSymTab_6_1 extends GhidraScript {
if (symDemangledName != null) {
new DemanglerCmd(symLocAddr, symName).applyTo(currentProgram,
monitor);
- ghidraSymTbl.removeSymbolSpecial(
- getSymbol(symName, currentProgram.getGlobalNamespace()));
+ List<Symbol> symbols =
+ getSymbols(symName, currentProgram.getGlobalNamespace());
+ if (!symbols.isEmpty()) {
+ ghidraSymTbl.removeSymbolSpecial(symbols.get(0));
+ }
}
}
break;
diff --git a/Ghidra/Features/GnuDemangler/ghidra_scripts/VxWorksSymTab_Finder.java b/Ghidra/Features/GnuDemangler/ghidra_scripts/VxWorksSymTab_Finder.java
index 4878c8a422..c54945ac70 100644
--- a/Ghidra/Features/GnuDemangler/ghidra_scripts/VxWorksSymTab_Finder.java
+++ b/Ghidra/Features/GnuDemangler/ghidra_scripts/VxWorksSymTab_Finder.java
@@ -23,13 +23,13 @@
//
// Any existing Ghidra symbol table entries that collide with VxWorks symbol
// table entries are deleted. Mangled C++ symbol names are demangled.
-//
+//
// The VxWorks symbol table is an array [0..n-1] of (struct SYMBOL) entries.
// The table may be immediately followed or preceeded by an (int) vxSymTblLen
// value.
//
// Prerequisites:
-//
+//
// - Program memory block(s) is(are) aligned with actual load addresses
// (run something like MemAlignARM_LE.java)
//
@@ -41,6 +41,8 @@
//
// @category VxWorks
+import java.util.List;
+
import ghidra.app.cmd.disassemble.DisassembleCommand;
import ghidra.app.cmd.label.DemanglerCmd;
import ghidra.app.plugin.core.analysis.AutoAnalysisManager;
@@ -593,7 +595,7 @@ public class VxWorksSymTab_Finder extends GhidraScript {
* @param symTbl
* @param vxSymbol
* @param tableLen
- * @throws Exception
+ * @throws Exception
*/
private void markSymbolTableLen(Address symTbl, VxSymbol vxSymbol, int symTblLen)
throws Exception {
@@ -651,9 +653,11 @@ public class VxWorksSymTab_Finder extends GhidraScript {
if (demangled != null) {
new DemanglerCmd(addr, mangled).applyTo(currentProgram, monitor);
- currentProgram.getSymbolTable()
- .removeSymbolSpecial(
- getSymbol(mangled, currentProgram.getGlobalNamespace()));
+ List<Symbol> symbols =
+ getSymbols(mangled, currentProgram.getGlobalNamespace());
+ if (!symbols.isEmpty()) {
+ currentProgram.getSymbolTable().removeSymbolSpecial(symbols.get(0));
+ }
}
return;
@@ -735,7 +739,7 @@ public class VxWorksSymTab_Finder extends GhidraScript {
return;
}
- // Process VxWorks symbol table entries
+ // Process VxWorks symbol table entries
println("Processing symbol table entries.");
Address symEntry = symTbl;
for (int i = 0; (i < symTblLen) && !monitor.isCancelled(); i++, symEntry =
diff --git a/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/app/util/NamespaceUtils.java b/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/app/util/NamespaceUtils.java
index 94e7613e0e..af09b57b7a 100644
--- a/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/app/util/NamespaceUtils.java
+++ b/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/app/util/NamespaceUtils.java
@@ -36,7 +36,7 @@ import ghidra.util.exception.*;
* <b>Assumptions for creating namespaces from a path string: </b>
* <ul>
* <li>All elements of a namespace path should be namespace symbols and not other
- * symbol types.
+ * symbol types.
* <li>Absolute paths can optionally start with the global namespace.
* <li>You can provide a relative path that will start at the given
* parent namespace (or global if there is no parent provided).
@@ -96,20 +96,6 @@ public class NamespaceUtils {
return str;
}
- /**
- * Provide a standard method for splitting a symbol path into its
- * various namespace and symbol name elements. While the current implementation
- * uses a very simplistic approach, this may be improved upon in the future
- * to handle various grouping concepts.
- * @param path symbol namespace path (path will be trimmed before parse)
- * @return order list of namespace names
- * @deprecated use SymbolPath instead
- */
- @Deprecated
- public static List<String> splitNamespacePath(String path) {
- return Arrays.asList(path.trim().split(Namespace.DELIMITER));
- }
-
/**
* Get the library associated with the specified namespace
* @param namespace namespace
@@ -333,8 +319,8 @@ public class NamespaceUtils {
*
* <p>The root namespace can be a function.
*
- * <p>If an address is passed, then the path can contain a function name provided the
- * address is in the body of the function; otherwise the names must all be namespaces other
+ * <p>If an address is passed, then the path can contain a function name provided the
+ * address is in the body of the function; otherwise the names must all be namespaces other
* than functions.
*
* @param namespacePath The namespace name or path string to be parsed
@@ -387,11 +373,11 @@ public class NamespaceUtils {
/**
* Returns the existing Function at the given address if its {@link SymbolPath} matches the
- * given path
+ * given path
*
* @param program the program
* @param symbolPath the path of namespace
- * @param address the address
+ * @param address the address
* @return the namespace represented by the given path, or null if no such namespace exists
*/
public static Namespace getFunctionNamespaceAt(Program program, SymbolPath symbolPath,
@@ -412,12 +398,12 @@ public class NamespaceUtils {
}
/**
- * Returns the existing Function containing the given address if its
- * {@link SymbolPath} matches the given path
+ * Returns the existing Function containing the given address if its
+ * {@link SymbolPath} matches the given path
*
* @param program the program
* @param symbolPath the path of namespace
- * @param address the address
+ * @param address the address
* @return the namespace represented by the given path, or null if no such namespace exists
*/
public static Namespace getFunctionNamespaceContaining(Program program, SymbolPath symbolPath,
diff --git a/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/database/symbol/SymbolManager.java b/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/database/symbol/SymbolManager.java
index 31241e3d59..2c69e0a8f9 100644
--- a/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/database/symbol/SymbolManager.java
+++ b/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/database/symbol/SymbolManager.java
@@ -161,7 +161,7 @@ public class SymbolManager implements SymbolTable, ManagerDB {
}
if (oldVariableStorageMgr != null) {
- // migrate from old variable storage table which utilized namespace-specific
+ // migrate from old variable storage table which utilized namespace-specific
// storage addresses
migrateFromOldVariableStorageManager(monitor);
}
@@ -268,7 +268,7 @@ public class SymbolManager implements SymbolTable, ManagerDB {
Address storageAddr = oldAddress.getNewAddress(oldAddress.getOffset());
- // move variable references - eliminate variable symbol bindings which are no longer supported
+ // move variable references - eliminate variable symbol bindings no longer supported
refManager.moveReferencesTo(oldAddress, storageAddr, monitor);
try {
@@ -364,7 +364,7 @@ public class SymbolManager implements SymbolTable, ManagerDB {
}
/**
- * Create mem references for the external entry points; then delete the table.
+ * Create memory references for the external entry points; then delete the table.
*/
private void processOldExternalEntryPoints(TaskMonitor monitor)
throws IOException, CancelledException {
@@ -506,7 +506,7 @@ public class SymbolManager implements SymbolTable, ManagerDB {
DBRecord record =
adapter.createSymbol(newName, address, newParentID, SymbolType.LABEL, null,
null, null, source, true);
- symbol.setRecord(record);// symbol object was morphed
+ symbol.setRecord(record);
symbolAdded(symbol);
}
catch (IOException e) {
@@ -798,6 +798,7 @@ public class SymbolManager implements SymbolTable, ManagerDB {
return false;
}
+ @Override
public SymbolIterator getSymbolsAsIterator(Address addr) {
lock.acquire();
try {
@@ -920,7 +921,7 @@ public class SymbolManager implements SymbolTable, ManagerDB {
}
private Symbol searchNamespaceForSymbol(Namespace namespace, String name, Address address) {
- for (Symbol symbol : getSymbols(namespace)) {
+ for (Symbol symbol : getSymbols(namespace)) {// NOTE: thunks do not exist in external space
if (address.equals(symbol.getAddress()) && name.equals(symbol.getName())) {
return symbol;
}
@@ -933,36 +934,11 @@ public class SymbolManager implements SymbolTable, ManagerDB {
((FunctionSymbol) sym).isThunk();
}
- @Override
- public Symbol getSymbol(String name, Namespace namespace) {
- List<Symbol> symbols = getSymbols(name, namespace);
- return symbols.isEmpty() ? null : symbols.get(0);
- }
-
@Override
public Symbol getGlobalSymbol(String name, Address addr) {
return getSymbol(name, addr, program.getGlobalNamespace());
}
- @Override
- public Symbol getSymbol(String name) {
- lock.acquire();
- try {
- Namespace global = namespaceMgr.getGlobalNamespace();
- SymbolIterator it = getSymbols(name);
- while (it.hasNext()) {
- Symbol s = it.next();
- if (s.getParentNamespace().equals(global)) {
- return s;
- }
- }
- return null;
- }
- finally {
- lock.release();
- }
- }
-
@Override
public List<Symbol> getGlobalSymbols(String name) {
return getSymbols(name, namespaceMgr.getGlobalNamespace());
@@ -1057,7 +1033,7 @@ public class SymbolManager implements SymbolTable, ManagerDB {
return null;
}
- // note: this could be public; adding it may be confusing due to the potential for having
+ // note: this could be public; adding it may be confusing due to the potential for having
// multiple symbols and not knowing when to call which method.
private Symbol getFirstSymbol(String name, Namespace namespace, Predicate<Symbol> test) {
if (namespace == null) {
@@ -1417,9 +1393,9 @@ public class SymbolManager implements SymbolTable, ManagerDB {
@Override
public long getDynamicSymbolID(Address addr) {
- // Unique dynamic symbol ID produced from a dynamic symbol address map which has
- // a high-order bit set to avoid potential conflict
- // with stored symbol ID's which are assigned starting at 0.
+ // Unique dynamic symbol ID produced from a dynamic symbol address map which has a
+ // high-order bit set to avoid potential conflict with stored symbol ID's which are
+ // assigned starting at 0.
return dynamicSymbolAddressMap.getKey(addr);
}
@@ -1502,7 +1478,7 @@ public class SymbolManager implements SymbolTable, ManagerDB {
}
void primarySymbolSet(Symbol symbol, Symbol oldPrimarySymbol) {
- // fire event: oldValue=symbol address, newvalue = reference address
+ // fire event: old Value = symbol address, new value = reference address
program.symbolChanged(symbol, ChangeManager.DOCR_SYMBOL_SET_AS_PRIMARY, symbol.getAddress(),
null, oldPrimarySymbol, symbol);
}
@@ -2116,7 +2092,9 @@ public class SymbolManager implements SymbolTable, ManagerDB {
program.dbError(e);
it = new EmptyRecordIterator();
}
- return new SymbolRecordIterator(it, true, true); // NOTE: thunks do not exist in external space
+
+ // NOTE: thunks do not exist in external space
+ return new SymbolRecordIterator(it, true, true);
}
Lock getLock() {
@@ -2211,13 +2189,14 @@ public class SymbolManager implements SymbolTable, ManagerDB {
}
Address newAddress = toAddr.add(symbol.getAddress().subtract(fromAddr));
- // any address that has symbols added or removed may have a corrupted primary (too many or non-existent)
+ // any address that has symbols added or removed may have a corrupted primary
+ // (too many or non-existent)
primaryFixups.add(symbol.getAddress());
primaryFixups.add(newAddress);
moveSymbolForMemoryBlockMove((SymbolDB) symbol, newAddress);
}
- // go back and make sure there is a valid primary symbol at touched addressess
+ // go back and make sure there is a valid primary symbol at touched addresses
fixupPrimarySymbols(primaryFixups);
}
finally {
@@ -2665,7 +2644,7 @@ public class SymbolManager implements SymbolTable, ManagerDB {
return (Namespace) namespaceSymbol.getObject();
}
- // Note: We know there are no namespaces with the name; do we still have to check for
+ // Note: We know there are no namespaces with the name; do we still have to check for
// duplicates? Assuming yes, as another symbol type may exist with this name.
SymbolDB s =
doCreateSpecialSymbol(Address.NO_ADDRESS, name, parent, SymbolType.NAMESPACE, null,
@@ -2687,8 +2666,8 @@ public class SymbolManager implements SymbolTable, ManagerDB {
* @param name the name of the symbol
* @param parent the namespace for the symbol
* @param symbolType the type of the symbol
- * @param dataTypeId the id for an associated datatype or null
- * @param variableOffset this is the ordinal for params and firstUseOffset for locals
+ * @param dataTypeId the id for an associated datatype or null
+ * @param variableOffset this is the ordinal for params and firstUseOffset for locals
* @param stringData value whose meaning depends on the symbol type.
* @param source the SourceType for the new symbol
* @return the newly created symbol
@@ -2729,12 +2708,6 @@ public class SymbolManager implements SymbolTable, ManagerDB {
}
}
- @Override
- public Symbol createSymbol(Address addr, String name, SourceType source)
- throws InvalidInputException {
- return createLabel(addr, name, source);
- }
-
@Override
public Symbol createLabel(Address addr, String name, SourceType source)
throws InvalidInputException {
@@ -2742,12 +2715,6 @@ public class SymbolManager implements SymbolTable, ManagerDB {
return createLabel(addr, name, null, source);
}
- @Override
- public Symbol createSymbol(Address addr, String name, Namespace namespace, SourceType source)
- throws InvalidInputException, DuplicateNameException {
- return createLabel(addr, name, namespace, source);
- }
-
@Override
public Symbol createLabel(Address addr, String name, Namespace namespace, SourceType source)
throws InvalidInputException {
diff --git a/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/listing/Data.java b/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/listing/Data.java
index 0650651c83..dd4af0dc06 100644
--- a/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/listing/Data.java
+++ b/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/listing/Data.java
@@ -29,21 +29,20 @@ import ghidra.program.model.symbol.Reference;
*/
public interface Data extends CodeUnit, Settings {
- // TODO: Fix javadocs !!
-
/**
* Returns the value of the data item. The value may be an address, a scalar,
* register or null if no value.
+ * @return the value
*/
public Object getValue();
/**
* Get the class used to express the value of this data.
- * NOTE: This determination is made based upon data type
- * and settings only and does not examine memory bytes
- * which are used to construct the data value object.
- * @return value class or null if a consistent class is not
- * utilized.
+ *
+ * <p>NOTE: This determination is made based upon data type and settings only and does not
+ * examine memory bytes which are used to construct the data value object.
+ *
+ * @return value class or null if a consistent class is not utilized.
*/
public Class<?> getValueClass();
@@ -67,24 +66,28 @@ public interface Data extends CodeUnit, Settings {
public boolean isVolatile();
/**
- * Returns true if the data type is defined. Any address that has not been
- * defined to be code or data is treated as undefined data.
+ * Returns true if the data type is defined. Any address that has not been defined to be code
+ * or data is treated as undefined data.
+ * @return true if is defined
*/
public boolean isDefined();
/**
* Get the Data type for the data.
+ * @return the data type
*/
public DataType getDataType();
/**
- * If the dataType is a typeDef, then the typeDef's base type is returned,
- * otherwise, the datatType is returned.
+ * If the dataType is a typeDef, then the typeDef's base type is returned, otherwise, the
+ * datatType is returned.
+ * @return the data type
*/
public DataType getBaseDataType();
/**
* Get the references for the value.
+ * @return the references
*/
public Reference[] getValueReferences();
@@ -102,126 +105,136 @@ public interface Data extends CodeUnit, Settings {
public void removeValueReference(Address refAddr);
/**
- * Get the field name of this data item if it is "inside" another data item,
- * otherwise return null.
+ * Get the field name of this data item if it is "inside" another data item, otherwise return
+ * null.
* @return the name of this data as known from some parent data item or
* null if this data item is not a component of another data item.
*/
public String getFieldName();
/**
- * Returns the full path name (dot notation) for this field. This includes
- * the symbol name at this address.
+ * Returns the full path name (dot notation) for this field. This includes the symbol name at
+ * this address.
+ * @return the path name
*/
public String getPathName();
/**
* Returns the component path name (dot notation) for this field
+ * @return the component path name
*/
public String getComponentPathName();
/**
- * Returns true if this is a pointer, implies getValue() will
- * will return an Object that is an Address.
+ * Returns true if this is a pointer, implies getValue() will will return an Object that is an
+ * Address.
+ * @return true if a pointer
*/
public boolean isPointer();
/**
* Returns true if this data item is a Union.
+ * @return true if a union
*/
public boolean isUnion();
/**
* Returns true if this data item is a Structure.
+ * @return true if a structure
*/
public boolean isStructure();
/**
* Returns true if this data item is an Array of DataTypes
+ * @return true if an array
*/
public boolean isArray();
/**
* Returns true if this data item is a dynamic DataType.
+ * @return true if is dynamic
*/
public boolean isDynamic();
/**
- * Get the immediate parent data item of this data item or null if this data
- * item is not contained in another data item.
+ * Get the immediate parent data item of this data item or null if this data item is not
+ * contained in another data item.
+ * @return the data
*/
public Data getParent();
/**
- * Get the highest level Data item in a hierarchy of structures
- * containing this component.
+ * Get the highest level Data item in a hierarchy of structures containing this component.
+ * @return the data
*/
public Data getRoot();
/**
- * Get the offset of this Data item from the start of the root data item of
- * some hierarchy of structures.
+ * Get the offset of this Data item from the start of the root data item of some hierarchy of
+ * structures.
+ * @return the offset
*/
- int getRootOffset();
+ public int getRootOffset();
/**
- * Get the offset of this Data item from the start of its immediate
- * parent.
+ * Get the offset of this Data item from the start of its immediate parent.
+ * @return the offset
*/
- int getParentOffset();
+ public int getParentOffset();
/**
* Returns the immediate n'th component or null if none exists.
* @param index the index of the component to get.
+ * @return the component
*/
public Data getComponent(int index);
/**
- * Get a data item given the index path. Each integer in the array represents
- * an index into the data item at that level.
+ * Get a data item given the index path. Each integer in the array represents an index into
+ * the data item at that level.
* @param componentPath the array of indexes to use to find the requested data item.
+ * @return the component
*/
public Data getComponent(int[] componentPath);
/**
- * Get the component path if this is a component. The component path is an
- * array of integers that represent each index in the tree of data items. Top
- * level data items have an empty array for thier component path.
+ * Get the component path if this is a component. The component path is an array of integers
+ * that represent each index in the tree of data items. Top level data items have an empty
+ * array for their component path.
+ * @return the path
*/
public int[] getComponentPath();
/**
* Return the number of components that make up this data item.
* if this is an Array, return the number of elements in the array.
+ * @return the number of components
*/
public int getNumComponents();
/**
- * Return the first immediate child component that contains the byte
- * at the given offset. It is important to note that with certain
- * datatypes there may be more than one component containing the specified offset
- * (see {@link #getComponentsContaining(int)}).
+ * Return the first immediate child component that contains the byte at the given offset. It
+ * is important to note that with certain datatypes there may be more than one component
+ * containing the specified offset (see {@link #getComponentsContaining(int)}).
*
- * @param offset the amount to add to this data items address to get the
- * address of the requested data item.
+ * @param offset the amount to add to this data items address to get the address of the
+ * requested data item.
* @return first data component containing offset or null
- * @deprecated method name has been changed to better reflect behavior. The method
+ * @deprecated method name has been changed to better reflect behavior. The method
* {@link #getComponentContaining(int)} should be used instead.
*/
- @Deprecated
- Data getComponentAt(int offset);
+ @Deprecated(forRemoval = true, since = "10.1")
+ public Data getComponentAt(int offset);
/**
- * RReturn the first immediate child component that contains the byte
- * at the given offset. It is important to note that with certain
- * datatypes there may be more than one component containing the specified offset
- * (see {@link #getComponentsContaining(int)}).
+ * RReturn the first immediate child component that contains the byte at the given offset. It
+ * is important to note that with certain datatypes there may be more than one component
+ * containing the specified offset (see {@link #getComponentsContaining(int)}).
*
* @param offset the amount to add to this data items address to get the
- * @return first data component containing offset or null
- * address of the requested data item.
+ * @return first data component containing offset or null address of the requested data item.
*/
- Data getComponentContaining(int offset);
+ public Data getComponentContaining(int offset);
/**
* Returns a list of all the immediate child components that contain the byte at the
@@ -234,39 +247,42 @@ public interface Data extends CodeUnit, Settings {
* @return a list of all the immediate child components that contain the byte at the
* given offset or null if offset is out of bounds.
*/
- List<Data> getComponentsContaining(int offset);
+ public List<Data> getComponentsContaining(int offset);
/**
* Returns the primitive component containing this offset (i.e., one that does not
- * have sub-components). This is useful for data items which are made up of multiple
- * layers of other data items. This method immediately goes to the lowest level data item.
- * If the minimum offset of a component is specified, the only first component containing
+ * have sub-components). This is useful for data items which are made up of multiple
+ * layers of other data items. This method immediately goes to the lowest level data item.
+ * If the minimum offset of a component is specified, the only first component containing
* the offset will be considered (e.g., 0-element array).
+ * @param offset the offset
* @return primitive component containing this offset
*/
- Data getPrimitiveAt(int offset);
+ public Data getPrimitiveAt(int offset);
/**
* Get the index of this component in its parent
* @return -1 if this data item is not a component of another data item.
*/
- int getComponentIndex();
+ public int getComponentIndex();
/**
* Get this data's component level in its hierarchy of components.
* @return the level of this data item with 0 being the level of top data items.
*/
- int getComponentLevel();
+ public int getComponentLevel();
/**
* Returns a string that represents the data value without markup.
+ * @return the string
*/
public String getDefaultValueRepresentation();
/**
* Returns the appropriate string to use as the default label prefix or null if it has no
- * prefered default label prefix;
- * @param options
+ * preferred default label prefix;
+ * @param options the options
+ * @return the prefix
*/
public String getDefaultLabelPrefix(DataTypeDisplayOptions options);
}
diff --git a/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/symbol/RefType.java b/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/symbol/RefType.java
index c2b1622055..0c5e7f4fcc 100644
--- a/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/symbol/RefType.java
+++ b/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/symbol/RefType.java
@@ -68,10 +68,6 @@ public abstract class RefType {
static final byte __WRITE_IND = 105;
static final byte __READ_WRITE_IND = 106;
static final byte __UNKNOWNPARAM = 107;
- @Deprecated
- static final byte __STACK_READ = 110; // Use __READ instead
- @Deprecated
- static final byte __STACK_WRITE = 111; // Use __WRITE instead
static final byte __EXTERNAL_REF = 113;
static final byte __UNKNOWNDATA_IND = 114;
@@ -247,23 +243,8 @@ public abstract class RefType {
DataRefType.READX | DataRefType.WRITEX | DataRefType.INDX);
/**
- * Reference type assigned for stack variable being read.
- * @deprecated use {@link RefType#READ} instead
- */
- @Deprecated
- public static final RefType STACK_READ =
- new DataRefType(__STACK_READ, "STACK_READ", DataRefType.READX);
-
- /**
- * Reference type assigned for stack variable being written.
- * @deprecated use {@link RefType#WRITE} instead
- */
- @Deprecated
- public static final RefType STACK_WRITE =
- new DataRefType(__STACK_WRITE, "STACK_WRITE", DataRefType.WRITEX);
- /**
- * Reference type used internally to identify external entry points.
- * The use of this RefType for references to external library data or functions
+ * Reference type used internally to identify external entry points.
+ * The use of this RefType for references to external library data or functions
* is deprecated and should not be used for that purpose.
*/
public static final RefType EXTERNAL_REF = new DataRefType(__EXTERNAL_REF, "EXTERNAL", 0);
diff --git a/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/symbol/RefTypeFactory.java b/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/symbol/RefTypeFactory.java
index 37c3cc6f10..267fc845d3 100644
--- a/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/symbol/RefTypeFactory.java
+++ b/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/symbol/RefTypeFactory.java
@@ -31,7 +31,6 @@ import ghidra.util.datastruct.IntObjectHashtable;
/**
* Factory class to create RefType objects.
*/
-@SuppressWarnings("deprecation")
public class RefTypeFactory {
private static final IntObjectHashtable<RefType> REFTYPE_LOOKUP_BY_TYPE_MAP =
@@ -74,8 +73,6 @@ public class RefTypeFactory {
REFTYPE_LOOKUP_BY_TYPE_MAP.put(RefType.READ_IND.getValue(), RefType.READ_IND);
REFTYPE_LOOKUP_BY_TYPE_MAP.put(RefType.WRITE_IND.getValue(), RefType.WRITE_IND);
REFTYPE_LOOKUP_BY_TYPE_MAP.put(RefType.READ_WRITE_IND.getValue(), RefType.READ_WRITE_IND);
- REFTYPE_LOOKUP_BY_TYPE_MAP.put(RefType.STACK_READ.getValue(), RefType.STACK_READ);
- REFTYPE_LOOKUP_BY_TYPE_MAP.put(RefType.STACK_WRITE.getValue(), RefType.STACK_WRITE);
REFTYPE_LOOKUP_BY_TYPE_MAP.put(RefType.EXTERNAL_REF.getValue(), RefType.EXTERNAL_REF);
REFTYPE_LOOKUP_BY_TYPE_MAP.put(RefType.__CALL_OVERRIDE_UNCONDITIONAL,
RefType.CALL_OVERRIDE_UNCONDITIONAL);
@@ -148,10 +145,10 @@ public class RefTypeFactory {
}
/**
- * Get the default statck data RefType for the specified code-unit/opIndex and register
- * @param cu
- * @param reg
- * @param opIndex
+ * Get the default stack data RefType for the specified code-unit/opIndex and register
+ * @param cu the code unit
+ * @param reg the register
+ * @param opIndex the op index
* @return default RefType
*/
public static RefType getDefaultRegisterRefType(CodeUnit cu, Register reg, int opIndex) {
@@ -307,7 +304,7 @@ public class RefTypeFactory {
boolean simpleFlow =
(instr.getFlowType() != RefType.INVALID && instr.getDefaultFlows().length <= 1);
if (simpleFlow) {
- // only use default if simple flow
+ // only use default if simple flow
flowType = getDefaultJumpOrCallFlowType(instr);
}
@@ -321,7 +318,7 @@ public class RefTypeFactory {
}
// Assumption - it is assumed that any complex flow type is due to the presence of
- // multiple conditional flows. Does not handle use of constant offsets since
+ // multiple conditional flows. Does not handle use of constant offsets since
// language should be using Address locations for all flow pcode!
// TODO: Verify that above assumption is valid !!
@@ -348,7 +345,7 @@ public class RefTypeFactory {
}
/**
- * Determine default computed FlowType for a specified instruction. It is assumed
+ * Determine default computed FlowType for a specified instruction. It is assumed
* that all computed flows utilize a register in its destination specification/computation.
* @param instr instruction
* @return FlowType or null if unable to determine
@@ -361,7 +358,7 @@ public class RefTypeFactory {
}
// Assumption - it is assumed that any complex flow type is due to the presence of
- // multiple conditional flows.
+ // multiple conditional flows.
// TODO: Verify that above assumption is valid !!
@@ -388,9 +385,9 @@ public class RefTypeFactory {
/**
* Get the default memory flow/data RefType for the specified code unit and opIndex.
- * @param cu
- * @param opIndex
- * @param toAddr reference destination
+ * @param cu the code unit
+ * @param opIndex the op index
+ * @param toAddr reference destination
* @param ignoreExistingReferences if true existing references will not influence default
* reference type returned.
* @return default RefType
@@ -453,8 +450,10 @@ public class RefTypeFactory {
}
if (!ignoreExistingReferences) {
- Reference[] refs = cu.getProgram().getReferenceManager().getReferencesFrom(
- cu.getMinAddress(), opIndex);
+ Reference[] refs = cu.getProgram()
+ .getReferenceManager()
+ .getReferencesFrom(
+ cu.getMinAddress(), opIndex);
for (Reference ref : refs) {
if (ref.getToAddress().equals(toAddr)) {
return ref.getReferenceType();
@@ -486,7 +485,7 @@ public class RefTypeFactory {
/**
* Return default flow-type without terminator
- * @param inst
+ * @param inst the instruction
* @return call/jump flow type or null
*/
private static FlowType getDefaultJumpOrCallFlowType(Instruction inst) {
diff --git a/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/symbol/SymbolTable.java b/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/symbol/SymbolTable.java
index 8e017fb020..68c4cac74d 100644
--- a/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/symbol/SymbolTable.java
+++ b/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/symbol/SymbolTable.java
@@ -69,14 +69,6 @@ public interface SymbolTable {
public Symbol createLabel(Address addr, String name, SourceType source)
throws InvalidInputException;
- /**
- * @deprecated use {@link #createLabel(Address, String, SourceType)} instead.
- * Deprecated in version 7.5, will be removed a few versions later.
- */
- @Deprecated
- public Symbol createSymbol(Address addr, String name, SourceType source)
- throws InvalidInputException;
-
/**
* Create a label symbol with the given name associated to the given
* Address and namespace. The symbol will be of type SymbolType.CODE.
@@ -99,14 +91,6 @@ public interface SymbolTable {
public Symbol createLabel(Address addr, String name, Namespace namespace, SourceType source)
throws InvalidInputException;
- /**
- * @deprecated use {@link #createLabel(Address, String, Namespace, SourceType)} instead.
- * Deprecated in version 7.5, will be removed a few versions later.
- */
- @Deprecated
- public Symbol createSymbol(Address addr, String name, Namespace namespace, SourceType source)
- throws DuplicateNameException, InvalidInputException;
-
/**
* Removes the specified symbol from the symbol table. If removing any <b>non-function</b>
* symbol the behavior will be the same as invoking {@link Symbol#delete()} on the
@@ -128,21 +112,10 @@ public interface SymbolTable {
* symbol specific binding.
*
* @param sym the symbol to be removed.
- *
* @return false, if removal of the symbol fails
*/
public boolean removeSymbolSpecial(Symbol sym);
-// /**
-// * This method is just a pass-through for {@link #removeSymbolSpecial(Symbol)}.
-// *
-// * @see #removeSymbolSpecial(Symbol)
-// * @deprecated Call instead {@link #removeSymbolSpecial(Symbol)} or {@link Symbol#delete()}.
-// * Deprecated in version 7.4, will be removed a few versions later.
-// */
-// @Deprecated
-// public boolean removeSymbol(Symbol sym);
-
/**
* Get the symbol for the given symbol ID.
* @param symbolID the id of the symbol to be retrieved.
@@ -153,16 +126,19 @@ public interface SymbolTable {
/**
* Get the symbol with the given name, address, and namespace.
* <P>
- * Note that for a symbol to be uniquely specified, all these parameters are required. Any method
- * that queries for symbols using just one or two of these parameters will return a list of symbols.
- * This method will not return a default thunk (i.e., thunk function symbol with default source type)
- * since it mirrors the name and parent namespace of the function it thunks.
- * </P>
+ * Note that for a symbol to be uniquely specified, all these parameters are required. Any
+ * method that queries for symbols using just one or two of these parameters will return a list
+ * of symbols. This method will not return a default thunk (i.e., thunk function symbol with
+ * default source type) since it mirrors the name and parent namespace of the function it
+ * thunks.
+ *
* @param name the name of the symbol to retrieve
* @param addr the address of the symbol to retrieve
- * @param namespace the namespace of the symbol to retrieve. May be null which indicates global namespace.
- * @return the symbol which matches the specified crieria or null if not found
- * @see #getGlobalSymbol(String, Address) for a convenience method if the namespace is the global namespace.
+ * @param namespace the namespace of the symbol to retrieve. May be null which indicates global
+ * namespace.
+ * @return the symbol which matches the specified criteria or null if not found
+ * @see #getGlobalSymbol(String, Address) for a convenience method if the namespace is the
+ * global namespace.
*/
public Symbol getSymbol(String name, Address addr, Namespace namespace);
@@ -172,56 +148,24 @@ public interface SymbolTable {
* at the same address and namespace (in this case the global namespace).
*
* <P>This is just a convenience method for {@link #getSymbol(String, Address, Namespace)} where
- * the namespace is the global namespace.</P>
+ * the namespace is the global namespace.
*
- * <p>NOTE: This method will not return a default thunk (i.e., thunk function symbol with default source type)
- * since it mirrors the name and parent namespace of the function it thunks.</p>
+ * <p>NOTE: This method will not return a default thunk (i.e., thunk function symbol with
+ * default source type) since it mirrors the name and parent namespace of the function it
+ * thunks.
*
* @param name the name of the symbol to retrieve
* @param addr the address of the symbol to retrieve
- * @return the symbol which matches the specified crieria in the global namespace or null if not found
- * @see #getSymbol(String, Address, Namespace)
+ * @return the symbol which matches the specified criteria in the global namespace or null if
+ * not found
+ * @see #getSymbol(String, Address, Namespace)
*/
public Symbol getGlobalSymbol(String name, Address addr);
- /**
- * Returns the first symbol with the given name found in the given namespace. Ghidra now
- * allows multiple symbols with the same name in the same namespace, so using this method
- * is likely to produce unintended results. Use {@link #getSymbols(String, Namespace)} instead.
- *
- * <p>NOTE: This method will not return a default thunk (i.e.,
- * thunk function symbol with default source type).</p>
- *
- * @param name the name of the symbol to retreive
- * @param namespace the namespace of the symbol to retrieve (null assumes global namespace)
- * @return the first symbol which satisifies specified criteria or null if not found
- * @deprecated This method is no longer useful as Ghidra allows duplicate symbol names in
- * the same namespace. Use {@link #getSymbols(String, Namespace)} instead.
- * Deprecated in version 7.5, will be removed a few versions later.
- */
- @Deprecated
- public Symbol getSymbol(String name, Namespace namespace);
-
- /**
- * Returns the first global symbol that it finds with the given name. Now that Ghidra
- * allows duplicate symbol names, this method is practically useless.
- *
- * <p>NOTE: This method will not return a default thunk (i.e.,
- * thunk function symbol with default source type).</p>
- *
- * @param name the name of the symbol to be retrieved.
- * @return first symbol found with specified name or null if no global symbol has that name
- * @deprecated Use {@link #getGlobalSymbols(String)} instead. Ghidra now allows
- * multiple symbols in any namespace to have the same name. Deprecated in Ghidra 7.5
- * Deprecated in version 7.5, will be removed a few versions later.
- */
- @Deprecated
- public Symbol getSymbol(String name);
-
/**
* Returns a list of all global symbols with the given name.
*
- * <p>NOTE: This method will not return default thunks (i.e.,
+ * <p>NOTE: This method will not return default thunks (i.e.,
* thunk function symbol with default source type).</p>
*
* @param name the name of the symbols to retrieve.
@@ -283,7 +227,7 @@ public interface SymbolTable {
/**
* Returns a list of all symbols with the given name in the given namespace.
*
- * <p>NOTE: The resulting iterator will not return default thunks (i.e.,
+ * <p>NOTE: The resulting iterator will not return default thunks (i.e.,
* thunk function symbol with default source type).</p>
*
* @param name the name of the symbols to retrieve.
@@ -295,7 +239,7 @@ public interface SymbolTable {
/**
* Returns a symbol that is either a parameter or local variable. There can be only
* one because these symbol types have a unique name requirement.
- * @param name the naem of the variable.
+ * @param name the name of the variable.
* @param function the function to search.
* @return a parameter or local variable symbol with the given name.
*/
@@ -314,7 +258,7 @@ public interface SymbolTable {
/**
* Returns all the symbols with the given name.
*
- * <p>NOTE: The resulting iterator will not return default thunks (i.e.,
+ * <p>NOTE: The resulting iterator will not return default thunks (i.e.,
* thunk function symbol with default source type).</p>
*
* @param name the name of symbols to search for.
@@ -353,8 +297,8 @@ public interface SymbolTable {
* the primary symbol will be returned in array slot 0.
* WARNING! Use of this method with a Variable address is highly discouraged since
* a single Variable address could be used multiple times by many functions.
- * Note that unless all the symbols are needed at once, you should consider using
- * the {@link #getSymbolsAsIterator(Address)} method instead.
+ * Note that unless all the symbols are needed at once, you should consider using
+ * the {@link #getSymbolsAsIterator(Address)} method instead.
* @param addr the address at which to retrieve all symbols.
* @return a zero-length array when no symbols are defined at address.
* @see #getSymbolsAsIterator(Address)
@@ -362,8 +306,8 @@ public interface SymbolTable {
public Symbol[] getSymbols(Address addr);
/**
- * Returns a symbol iterator over all the symbols at the given address. Use this instead of
- * {@link #getSymbols(Address)} when you do not need to get all symbols, but rather are
+ * Returns a symbol iterator over all the symbols at the given address. Use this instead of
+ * {@link #getSymbols(Address)} when you do not need to get all symbols, but rather are
* searching for a particular symbol. This method prevents all symbols at the given address
* from being loaded up front.
*
@@ -383,7 +327,7 @@ public interface SymbolTable {
/**
* Returns an iterator over all the symbols in the given namespace
*
- * <p>NOTE: The resulting iterator will not return default thunks (i.e.,
+ * <p>NOTE: The resulting iterator will not return default thunks (i.e.,
* thunk function symbol with default source type).</p>
*
* @param namespace the namespace to search for symbols.
@@ -394,7 +338,7 @@ public interface SymbolTable {
/**
* Returns an iterator over all the symbols in the given namespace
*
- * <p>NOTE: This method will not return a default thunk (i.e.,
+ * <p>NOTE: This method will not return a default thunk (i.e.,
* thunk function symbol with default source type).</p>
*
* @param namespaceID the namespace ID to search for symbols.
@@ -410,8 +354,8 @@ public interface SymbolTable {
public boolean hasSymbol(Address addr);
/**
- * Get the unique symbol ID for a dynamic symbol associated with the speified addr.
- * The generation of this symbol ID does not reflect the presence of a dyanmic symbol
+ * Get the unique symbol ID for a dynamic symbol associated with the specified addr.
+ * The generation of this symbol ID does not reflect the presence of a dynamic symbol
* at the specified addr. This symbol ID should not be permanently stored since the encoding
* may change between software releases.
* @param addr dynamic symbol address
@@ -422,9 +366,9 @@ public interface SymbolTable {
/**
* Returns a an iterator over all symbols that match the given search string.
*
- * <p>NOTE: The iterator is in the forward direction only and will not return default thunk functions.
- * The resulting iterator will not return default thunks (i.e.,
- * thunk function symbol with default source type).</p>
+ * <p>NOTE: The iterator is in the forward direction only and will not return default thunk
+ * functions. The resulting iterator will not return default thunks (i.e.,
+ * thunk function symbol with default source type).
*
* @param searchStr the string to search for (may contain * to match any sequence
* or ? to match a single char)
@@ -575,8 +519,7 @@ public interface SymbolTable {
public Namespace getNamespace(Address addr);
/**
- * Returns all Class Namespaces defined within the program in an
- * arbitrary ordering.
+ * Returns all Class Namespaces defined within the program in an arbitrary ordering.
* @return iterator of {@link GhidraClass}
*/
public Iterator<GhidraClass> getClassNamespaces();
@@ -587,8 +530,8 @@ public interface SymbolTable {
* @param name name of the namespace
* @param source the source of this class namespace's symbol
* @return new class namespace
- * @throws DuplicateNameException thrown if another non function or label symbol
- * exists with the given name
+ * @throws DuplicateNameException thrown if another non function or label symbol exists with
+ * the given name
* @throws InvalidInputException throw if the name has invalid characters or is null
* @throws IllegalArgumentException if you try to set the source to 'Symbol.DEFAULT'.
*/
@@ -598,8 +541,8 @@ public interface SymbolTable {
/**
* Returns an iterator over all symbols that have the given symbol as its parent.
*
- * <p>NOTE: The resulting iterator will not return default thunks (i.e.,
- * thunk function symbol with default source type).</p>
+ * <p>NOTE: The resulting iterator will not return default thunks (i.e., thunk function symbol
+ * with default source type).
*
* @param parentSymbol the parent symbol
* @return symbol iterator
@@ -613,7 +556,7 @@ public interface SymbolTable {
* @return the new Library namespace.
* @throws InvalidInputException if the name is invalid.
* @throws IllegalArgumentException if you try to set the source to 'Symbol.DEFAULT'.
- * @throws DuplicateNameException thrown if another non function or label
+ * @throws DuplicateNameException thrown if another non function or label
* symbol exists with the given name
*/
public Library createExternalLibrary(String name, SourceType source)
@@ -625,7 +568,7 @@ public interface SymbolTable {
* @param name the name of the new namespace
* @param source the source of this namespace's symbol
* @return the new Namespace object.
- * @throws DuplicateNameException thrown if another non function or label symbol
+ * @throws DuplicateNameException thrown if another non function or label symbol
* exists with the given name
* @throws InvalidInputException if the name is invalid.
* @throws IllegalArgumentException if you try to set the source to 'Symbol.DEFAULT'.
@@ -647,12 +590,12 @@ public interface SymbolTable {
/**
* Gets an existing namespace with the given name in the given parent. If no namespace exists,
* then one will be created.
- *
+ *
* @param parent the parent namespace
* @param name the namespace name
* @param source the source type for the namespace if one is created
* @return the namespace
- * @throws DuplicateNameException thrown if another non function or label symbol exists with
+ * @throws DuplicateNameException thrown if another non function or label symbol exists with
* the given name
* @throws InvalidInputException if the name is invalid
* @throws IllegalArgumentException if the given parent namespace is from a different program