Merge branch 'GT-3362_ryanmkurtz_PR-1287_astrelsky_DocumentationFixes'

Conflicts:
	Ghidra/Framework/Docking/src/main/java/docking/action/DockingAction.java
This commit is contained in:
Ryan Kurtz
2019-12-02 13:22:08 -05:00
659 changed files with 1740 additions and 4136 deletions
@@ -58,7 +58,7 @@ import ghidra.util.task.*;
* indicates locations for where classes for plugins and data types should
* be searched; the Plugin path can include jar files just like a classpath.
* The Plugin path can be changed by using the <i>Edit Plugin Path</i> dialog,
* displayed from the <i>Edit->Edit Plugin Path...</i> menu option on the main
* displayed from the <i>Edit-&gt;Edit Plugin Path...</i> menu option on the main
* Ghidra project window.
*
* @see ghidra.GhidraLauncher
@@ -31,7 +31,7 @@ import ghidra.util.task.TaskMonitor;
* in the area will be replaced with the new dataType, except when the existing data
* or the given dataType is a pointer. If the existing dataType is a pointer, then
* it will be changed into a pointer to the given dataType. If the given dataType
* is a pointer and the existing data is >= to the size of a pointer, it will become
* is a pointer and the existing data is &gt;= to the size of a pointer, it will become
* a pointer to the existing type. If the existing dataType is less than the size
* of a pointer, then a pointer to dataType will only be created if there are
* enough undefined bytes following to make a pointer.
@@ -31,7 +31,7 @@ import ghidra.program.model.listing.Program;
* the existing data will be changed into a pointer to the given dataType. If the given dataType
* is a default-pointer, it will become a pointer to the existing type.
*
* @see DataUtilities#createData(Program, Address, DataType, boolean, ghidra.program.model.data.DataUtilities.ClearDataMode)
* @see DataUtilities#createData(Program, Address, DataType, int, boolean, DataUtilities.ClearDataMode)
*/
public class CreateDataCmd implements Command {
@@ -48,9 +48,8 @@ public class ArmDisassembleCommand extends DisassembleCommand {
}
/**
* Constructor for DisassembleCommand.
* @param startSet set of addresses to be the start of a disassembly. The
* Command object will attempt to start a disassembly at each address in this set.
* Constructor for ArmDisassembleCommand.
* @param start address to be the start of a disassembly.
* @param restrictedSet addresses that can be disassembled.
* a null set implies no restrictions
* @param thumbMode pass true if the disassembling in Thumb Mode
@@ -70,10 +69,6 @@ public class ArmDisassembleCommand extends DisassembleCommand {
throw new UnsupportedOperationException();
}
/**
*
* @see ghidra.framework.cmd.BackgroundCommand#applyTo(ghidra.framework.model.DomainObject, ghidra.util.task.TaskMonitor)
*/
@Override
synchronized public boolean applyTo(DomainObject obj, TaskMonitor monitor) {
Program program = (Program) obj;
@@ -110,7 +110,7 @@ public class DisassembleCommand extends BackgroundCommand {
* {@link #setSeedContext(DisassemblerContextImpl)} method.
* The defaultSeedContext should remain unchanged while disassembler command
* is actively running.
* @param contextOverrideValue context override value or null
* @param initialContextValue the initial context value to set or null to clear it
*/
public void setInitialContext(RegisterValue initialContextValue) {
if (initialContextValue != null) {
@@ -129,9 +129,6 @@ public class DisassembleCommand extends BackgroundCommand {
this.enableAnalysis = enable;
}
/**
* @see ghidra.framework.cmd.Command#getStatusMsg()
*/
@Override
public String getStatusMsg() {
if (disassemblyPerformed) {
@@ -147,10 +144,6 @@ public class DisassembleCommand extends BackgroundCommand {
return "Disassembler requires a start which is an undefined code unit";
}
/**
*
* @see ghidra.framework.cmd.BackgroundCommand#applyTo(ghidra.framework.model.DomainObject, ghidra.util.task.TaskMonitor)
*/
@Override
synchronized public boolean applyTo(DomainObject obj, TaskMonitor monitor) {
Program program = (Program) obj;
@@ -48,9 +48,8 @@ public class Hcs12DisassembleCommand extends DisassembleCommand {
}
/**
* Constructor for DisassembleCommand.
* @param startSet set of addresses to be the start of a disassembly. The
* Command object will attempt to start a disassembly at each address in this set.
* Constructor for Hcs12DisassembleCommand.
* @param start address to be the start of a disassembly.
* @param restrictedSet addresses that can be disassembled.
* a null set implies no restrictions
* @param xgMode pass true if the disassembling in XGATE Mode
@@ -70,10 +69,6 @@ public class Hcs12DisassembleCommand extends DisassembleCommand {
throw new UnsupportedOperationException();
}
/**
*
* @see ghidra.framework.cmd.BackgroundCommand#applyTo(ghidra.framework.model.DomainObject, ghidra.util.task.TaskMonitor)
*/
@Override
synchronized public boolean applyTo(DomainObject obj, TaskMonitor monitor) {
Program program = (Program) obj;
@@ -27,7 +27,7 @@ import ghidra.util.exception.CancelledException;
import ghidra.util.task.TaskMonitor;
/**
* Command object for performing Arm/Thumb disassembly
* Command object for performing Mips disassembly
*/
public class MipsDisassembleCommand extends DisassembleCommand {
@@ -48,9 +48,8 @@ public class MipsDisassembleCommand extends DisassembleCommand {
}
/**
* Constructor for DisassembleCommand.
* @param startSet set of addresses to be the start of a disassembly. The
* Command object will attempt to start a disassembly at each address in this set.
* Constructor for MipsDisassembleCommand.
* @param start address to be the start of a disassembly.
* @param restrictedSet addresses that can be disassembled.
* a null set implies no restrictions
* @param mips16Mode pass true if the disassembling in mips16e Mode
@@ -60,9 +59,6 @@ public class MipsDisassembleCommand extends DisassembleCommand {
this.mips16Mode = mips16Mode;
}
/**
* @see ghidra.framework.cmd.Command#getName()
*/
@Override
public String getName() {
return "Disassemble " + (mips16Mode ? "Mips16" : "Mips");
@@ -78,10 +74,6 @@ public class MipsDisassembleCommand extends DisassembleCommand {
throw new UnsupportedOperationException();
}
/**
*
* @see ghidra.framework.cmd.BackgroundCommand#applyTo(ghidra.framework.model.DomainObject, ghidra.util.task.TaskMonitor)
*/
@Override
synchronized public boolean applyTo(DomainObject obj, TaskMonitor monitor) {
Program program = (Program) obj;
@@ -50,8 +50,7 @@ public class PowerPCDisassembleCommand extends DisassembleCommand {
/**
* Constructor for PowerPCDisassembleCommand.
* @param startSet set of addresses to be the start of a disassembly. The
* Command object will attempt to start a disassembly at each address in this set.
* @param start address to be the start of a disassembly.
* @param restrictedSet addresses that can be disassembled.
* a null set implies no restrictions
* @param vleMode pass true if the disassembling in PowerISA VLE Mode, otherwise
@@ -62,9 +61,6 @@ public class PowerPCDisassembleCommand extends DisassembleCommand {
this.vleMode = vleMode;
}
/**
* @see ghidra.framework.cmd.Command#getName()
*/
@Override
public String getName() {
return "Disassemble " + (vleMode ? "PPC-VLE" : "PPC");
@@ -80,10 +76,6 @@ public class PowerPCDisassembleCommand extends DisassembleCommand {
throw new UnsupportedOperationException();
}
/**
*
* @see ghidra.framework.cmd.BackgroundCommand#applyTo(ghidra.framework.model.DomainObject, ghidra.util.task.TaskMonitor)
*/
@Override
synchronized public boolean applyTo(DomainObject obj, TaskMonitor monitor) {
Program program = (Program) obj;
@@ -49,11 +49,15 @@ public class ApplyFunctionDataTypesCmd extends BackgroundCommand {
* Constructs a new command to apply all function signature data types
* in the given data type manager.
*
* @param dtm data type manager containing the function signature data types
* @param managers list of data type managers containing the function signature data types
* @param set set of addresses containing labels to match against function names.
* The addresses must not already be included in the body of any existing function.
* If null, all symbols will be processed
* @param source the source of this command
* @param source the source of this command.
* @param alwaysReplace true to always replace the existing function signature with the
* function signature data type.
* @param createBookmarksEnabled true to create a bookmark when a function signature
* has been applied.
*/
public ApplyFunctionDataTypesCmd(List<DataTypeManager> managers, AddressSetView set,
SourceType source, boolean alwaysReplace, boolean createBookmarksEnabled) {
@@ -112,7 +112,8 @@ public class CallDepthChangeInfo {
/**
* Construct a new CallDepthChangeInfo object.
* @param func function to examine
* @param function function to examine
* @param restrictSet set of addresses to restrict flow flowing to.
* @param frameReg register that is to have it's depth(value) change tracked
* @param monitor monitor used to cancel the operation
*
@@ -132,8 +133,8 @@ public class CallDepthChangeInfo {
* Construct a new CallDepthChangeInfo object.
*
* @param program program containing the function to examime
* @param restrictedSet set of addresses to restrict flow flowing to.
* @param addr address within the function to examine
* @param restrictSet set of addresses to restrict flow flowing to.
* @param frameReg register that is to have it's depth(value) change tracked
* @param monitor monitor used to cancel the operation
* @throws CancelledException
@@ -735,13 +736,13 @@ public class CallDepthChangeInfo {
return;
}
/**
* Checks the indicated function in the program to determine if it is a jump thunk
* through a function pointer.
* @param func the function to check
* @param monitor status monitor for indicating progress and allowing cancel.
* @returntrue if check if this is a jump thunk through a function pointer
*/
// /**
// * Checks the indicated function in the program to determine if it is a jump thunk
// * through a function pointer.
// * @param func the function to check
// * @param monitor status monitor for indicating progress and allowing cancel.
// * @return true if check if this is a jump thunk through a function pointer
// */
// private boolean checkThunk(Function func, TaskMonitor monitor) {
// Instruction instr = program.getListing().getInstructionAt(func.getEntryPoint());
// if (instr == null) {
@@ -832,16 +833,17 @@ public class CallDepthChangeInfo {
}
/**
* @param minAddress
* @return
* @param addr the address to get the stack pointer depth at.
* @return the stack pointer depth at the address.
*/
public int getSPDepth(Address addr) {
return getRegDepth(addr, stackReg);
}
/**
* @param minAddress
* @return
* @param addr the address to get the register depth at.
* @param reg the register to get the depth of.
* @return the depth of the register at the address.
*/
public int getRegDepth(Address addr, Register reg) {
// OK lets CHEAT...
@@ -874,8 +876,9 @@ public class CallDepthChangeInfo {
}
/**
* @param minAddress
* @return
* @param addr the address of the register value to get the representation of.
* @param reg the register to get the representation of.
* @return the string representation of the register value.
*/
public String getRegValueRepresentation(Address addr, Register reg) {
return symEval.getRegisterValueRepresentation(addr, reg);
@@ -665,10 +665,11 @@ public class CreateFunctionCmd extends BackgroundCommand {
/**
* Recompute function body. An open transaction must already exist.
* @param program the program the function is in.
* @param function the function to be fixed up. A null function will return false.
* @param func the function to be fixed up. A null function will return false.
* @param monitor task monitor
* @return true if successful, false if cancelled or unable to fixup function or
* @return true if successful, false if unable to fixup function or
* no function found containing the start address of the indicated instruction
* @throws CancelledException if the function fixup is cancelled.
*/
public static boolean fixupFunctionBody(Program program, Function func, TaskMonitor monitor)
throws CancelledException {
@@ -64,12 +64,12 @@ public class CreateThunkFunctionCmd extends BackgroundCommand {
* converted to a thunk, otherwise an error will result.
* @param referencedFunctionAddr the function address to which this thunk refers. If no function
* exists at that specified referencedFunctionAddr one will be created per the following scheme:
* <pre><ul>
* <li>If referencedFunctionAddr is not contained within a memory block, an external function will
* <br><ul>
* <li>If referencedFunctionAddr is not contained within a memory block, an external function will<br>
* be created (a check will be done to look for an previously defined external location)</li>
* <li>If referencedFunctionAddr corresponds to an instruction, a new function will be
* <li>If referencedFunctionAddr corresponds to an instruction, a new function will be<br>
* created at that address.</li>
* </ul></pre>
* </ul>
*/
public CreateThunkFunctionCmd(Address entry, AddressSetView body,
Address referencedFunctionAddr, List<Address> referringThunkAddresses) {
@@ -88,12 +88,12 @@ public class CreateThunkFunctionCmd extends BackgroundCommand {
* converted to a thunk, otherwise an error will result.
* @param referencedFunctionAddr the function address to which this thunk refers. If no function
* exists at that specified referencedFunctionAddr one will be created per the following scheme:
* <pre><ul>
* <li>If referencedFunctionAddr is not contained within a memory block, an external function will
* <br><ul>
* <li>If referencedFunctionAddr is not contained within a memory block, an external function will<br>
* be created (a check will be done to look for an previously defined external location)</li>
* <li>If referencedFunctionAddr corresponds to an instruction, a new function will be
* <li>If referencedFunctionAddr corresponds to an instruction, a new function will be<br>
* created at that address.</li>
* </ul></pre>
* </ul>
*/
public CreateThunkFunctionCmd(Address entry, AddressSetView body,
Address referencedFunctionAddr) {
@@ -113,14 +113,14 @@ public class CreateThunkFunctionCmd extends BackgroundCommand {
* converted to a thunk, otherwise an error will result.
* @param referencedSymbol the symbol which identifies the intended function to which this thunk refers.
* If no function exists at that specified referencedSymbol location, one will be created per the following scheme:
* <pre><ul>
* <li>If referencedFunctionAddr is not contained within a memory block, an external function will
* <br><ul>
* <li>If referencedFunctionAddr is not contained within a memory block, an external function will<br>
* be created (a check will be done to look for an previously defined external location)</li>
* <li>If referencedFunctionAddr corresponds to an instruction, a new function will be
* <li>If referencedFunctionAddr corresponds to an instruction, a new function will be<br>
* created at that address.</li>
* <li>If referencedSymbol corresponds to an external CODE symbol, it will be converted to an
* <li>If referencedSymbol corresponds to an external CODE symbol, it will be converted to an<br>
* external FUNCTION</li>
* </ul></pre>
* </ul>
*/
public CreateThunkFunctionCmd(Address entry, AddressSetView body, Symbol referencedSymbol) {
this(entry, body, (Address) null);
@@ -31,7 +31,7 @@ import ghidra.util.exception.InvalidInputException;
* <a name="examples"></a>
* Example strings:
* <ul>
* <li>global{@link NamespaceUtils#NAMESPACE_DELIMITER &lt;delimiter&gt;}child1{@link NamespaceUtils#NAMESPACE_DELIMITER &lt;delimiter&gt;}child2
* <li>global{@link Namespace#NAMESPACE_DELIMITER ::}child1{@link Namespace#NAMESPACE_DELIMITER ::}child2
* <li>child1
* </ul>
* <p>
@@ -34,17 +34,17 @@ import javax.swing.JComponent;
status = PluginStatus.HIDDEN,
packageName = CorePluginPackage.NAME,
category = PluginCategoryNames.UNMANAGED,
shortDescription = "Program Merge Manager",
description = "Manage merge of Programs"
shortDescription = "DataType Archive Merge Manager",
description = "Manage merge of DataType Archives"
)
//@formatter:on
public class DataTypeArchiveMergeManagerPlugin extends MergeManagerPlugin {
/**
* Constructor for plugin that handles multi-user merge of programs.
* @param tool the tool with the active program to be merged
* Constructor for plugin that handles multi-user merge of data type archives.
* @param tool the tool
* @param mergeManager the merge manager that will control the merge process
* @param program the current program
* @param dataTypeArchive the data type archive
*/
public DataTypeArchiveMergeManagerPlugin( PluginTool tool,
DataTypeArchiveMergeManager mergeManager,
@@ -68,9 +68,6 @@ public class DataTypeArchiveMergeManagerPlugin extends MergeManagerPlugin {
// }
}
/* (non-Javadoc)
* @see ghidra.framework.plugintool.Plugin#dispose()
*/
@Override
protected void dispose() {
provider.dispose();
@@ -606,9 +606,7 @@ public abstract class MergeManager implements DomainObjectMergeManager {
/**
* Updates the current phase progress area in the default merge panel.
* @param currentProgressPercentage the progress percentage completed for the current phase.
* This should be a value from 0 to 100.
* @param progressMessage a message indicating what is currently occurring in this phase.
* @param description a message describing what is currently occurring in this phase.
* Null indicates to use the default message.
*/
@Override
@@ -1,6 +1,5 @@
/* ###
* 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.
@@ -40,7 +39,7 @@ public abstract class MergeManagerPlugin extends Plugin implements ProgramaticUs
* Constructor for plugin that handles multi-user merge of programs.
* @param tool the tool with the active program to be merged
* @param mergeManager the merge manager that will control the merge process
* @param program the current program
* @param domainObject the current domain object
*/
public MergeManagerPlugin(PluginTool tool, MergeManager mergeManager,
UndoableDomainObject domainObject) {
@@ -233,9 +233,7 @@ public class ProgramMultiUserMergeManager extends MergeManager {
/**
* Show the listing merge panel.
* @param show true indicates to show the Listing merge panel.
* false indicates show the default component.
* @param goToAddress
* @param goToAddress the address to goto.
*/
public void showListingMergePanel(final Address goToAddress) {
SwingUtilities.invokeLater(() -> {
@@ -1345,7 +1345,7 @@ public class DataTypeMergeManager implements MergeResolver {
* Get the resolved data type for either the return type or a variable.
* @param id id of FunctionDefinition
* @param paramID ID of either the return type or a variable
* @param index >=0 is the index of the variable; <0 means the paramID is
* @param index &gt;=0 is the index of the variable; &lt;0 means the paramID is
* the return type
* @param resolvedDataTypes hashtable to use for resolving
* @return resolved data type or the default data type if the data type
@@ -2316,8 +2316,7 @@ abstract class AbstractFunctionMerger implements ListingMergeConstants {
/**
* Creates the panel for resolving a conflict due to a variable being removed.
* @param entryPt the function entry point for the function variables.
* @param vars variables from the different programs [0]=Original, [1]=Latest, [2]=My
* @param lvc the local variable conflict
* @param monitor status monitor
* @return the panel
*/
@@ -2390,7 +2389,7 @@ abstract class AbstractFunctionMerger implements ListingMergeConstants {
/**
* Updates the progress message details associated with this phase of the merge.
* @param progressMessage a message indicating what is currently occurring in this phase.
* @param message a message indicating what is currently occurring in this phase.
* Null indicates to use the default message.
*/
protected void updateProgressMessage(String message) {
@@ -190,7 +190,7 @@ abstract class AbstractListingMerger implements ListingMerger, ListingMergeConst
}
/** Return an address set that contains all addresses that make up the code
* units containing the indicated address in the LATEST, MY, & ORIGINAL programs.
* units containing the indicated address in the LATEST, MY, and ORIGINAL programs.
* @param addr the address
* @return the code unit address set
*/
@@ -199,8 +199,8 @@ abstract class AbstractListingMerger implements ListingMerger, ListingMergeConst
}
/** Return an address set that contains all addresses that make up the code
* units containing the indicated addresses in the LATEST, MY, & ORIGINAL programs.
* @param addr the addresses
* units containing the indicated addresses in the LATEST, MY, and ORIGINAL programs.
* @param addrs the addresses
* @return the code unit address set
*/
protected AddressSetView getCodeUnitAddressSet(AddressSet addrs) {
@@ -332,7 +332,7 @@ abstract class AbstractListingMerger implements ListingMerger, ListingMergeConst
/**
* Updates the progress bar associated with this phase of the merge.
* Before beginning to auto-merge the <code>totalChanges</code> and <code>changeNum<\code> must be set.
* Before beginning to auto-merge the <code>totalChanges</code> and <code>changeNum</code> must be set.
* This method should then be called as changes are made to update the change bar.
* This assumes that each change is equivalent in terms of shown progress.
* @param increment the number of changes completed relative to the total
@@ -353,7 +353,7 @@ abstract class AbstractListingMerger implements ListingMerger, ListingMergeConst
/**
* Updates the progress message details associated with this phase of the merge.
* @param progressMessage a message indicating what is currently occurring in this phase.
* @param message a message indicating what is currently occurring in this phase.
* Null indicates to use the default message.
*/
protected void updateProgressMessage(String message) {
@@ -376,7 +376,7 @@ abstract class AbstractListingMerger implements ListingMerger, ListingMergeConst
* phase of the merge.
* @param myPercentComplete the progress percentage completed for this merger.
* This should be a value from 0 to 100.
* @param progressMessage a message indicating what is currently occurring in this phase.
* @param message a message indicating what is currently occurring in this phase.
* Null indicates to use the default message.
*/
protected void updateProgress(int myPercentComplete, String message) {
@@ -45,9 +45,9 @@ import ghidra.util.task.TaskMonitor;
* program and the modified program being checked into version control.
* <br>Indirect conflicts include:
* <ul>
* <li>bytes & code units</li>
* <li>bytes & equates</li>
* <li>code units & equates</li>
* <li>bytes and code units</li>
* <li>bytes and equates</li>
* <li>code units and equates</li>
* </ul>
* <br>Important: This class is intended to be used only for a single program
* version merge. It should be constructed, followed by an autoMerge(), and lastly
@@ -919,10 +919,10 @@ class CodeUnitMerger extends AbstractListingMerger {
if (hasNewData) {
Data newData = resultListing.getDataAt(minAddress);
String[] settingNames = data.getNames();
for (int i = 0; i < settingNames.length; i++) {
Object obj = data.getValue(settingNames[i]);
for (String settingName : settingNames) {
Object obj = data.getValue(settingName);
if (obj != null) {
newData.setValue(settingNames[i], obj);
newData.setValue(settingName, obj);
}
}
}
@@ -53,7 +53,6 @@ public abstract class ConflictPanel extends ChoiceComponent {
* row or 0 is returned.
* Each button or check box has an associated value that can be bitwise 'OR'ed together
* to get the entire choice for the row.
* @param row the row of the conflict resolution table.
* @return the choice(s) currently selected.
*/
public abstract int getUseForAllChoice();
@@ -191,14 +191,8 @@ public class ExternalFunctionMerger extends AbstractFunctionMerger implements Li
/**
* Manages changes and conflicts for externals between the latest versioned
* program and the modified program being checked into version control.
* @param mergeManager the top level merge manager for merging a program version.
* @param resultPgm the program to be updated with the result of the merge.
* This is the program that will actually get checked in.
* @param originalPgm the program that was checked out.
* @param latestPgm the latest checked-in version of the program.
* @param myPgm the program requesting to be checked in.
* @param latestChanges the address set of changes between original and latest versioned program.
* @param myChanges the address set of changes between original and my modified program.
* @param listingMergeManager the top level merge manager for merging a program version.
* @param showListingPanel true to show the listing panel.
*/
public ExternalFunctionMerger(ListingMergeManager listingMergeManager,
boolean showListingPanel) {
@@ -1654,7 +1654,7 @@ class FunctionMerger extends AbstractFunctionMerger implements ListingMerger {
}
/** Return an address set that contains all addresses that make up the code
* units containing the indicated address in the LATEST, MY, & ORIGINAL programs.
* units containing the indicated address in the LATEST, MY, and ORIGINAL programs.
* @param addr the address
* @return the code unit address set
*/
@@ -1663,8 +1663,8 @@ class FunctionMerger extends AbstractFunctionMerger implements ListingMerger {
}
/** Return an address set that contains all addresses that make up the code
* units containing the indicated addresses in the LATEST, MY, & ORIGINAL programs.
* @param addr the addresses
* units containing the indicated addresses in the LATEST, MY, and ORIGINAL programs.
* @param addrs the addresses
* @return the code unit address set
*/
protected AddressSetView getCodeUnitAddressSet(AddressSet addrs) {
@@ -1762,7 +1762,7 @@ class FunctionMerger extends AbstractFunctionMerger implements ListingMerger {
/**
* Updates the progress bar associated with this phase of the merge.
* Before beginning to auto-merge the <code>totalChanges</code> and <code>changeNum<\code> must be set.
* Before beginning to auto-merge the <code>totalChanges</code> and <code>changeNum</code> must be set.
* This method should then be called as changes are made to update the change bar.
* This assumes that each change is equivalent in terms of shown progress.
* @param increment the number of changes completed relative to the total
@@ -1797,7 +1797,7 @@ class FunctionMerger extends AbstractFunctionMerger implements ListingMerger {
* phase of the merge.
* @param myPercentComplete the progress percentage completed for this merger.
* This should be a value from 0 to 100.
* @param progressMessage a message indicating what is currently occurring in this phase.
* @param message a message indicating what is currently occurring in this phase.
* Null indicates to use the default message.
*/
protected void updateProgress(int myPercentComplete, String message) {
@@ -42,7 +42,7 @@ import ghidra.util.task.TaskMonitor;
* <li>functions</li>
* <li>symbols</li>
* <li>references [memory, stack, and external]</li>
* <li>comments [plate, pre, end-of-line, repeatable, and post]/li>
* <li>comments [plate, pre, end-of-line, repeatable, and post]</li>
* <li>properties</li>
* <li>bookmarks</li>
* </ul>
@@ -1,6 +1,5 @@
/* ###
* 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.
@@ -35,10 +34,10 @@ interface ListingMerger {
* Performs the automatic merge for all changes in my Checked Out program version.
* It also determines the conflicts requiring manual resolution.
* @param monitor task monitor for informing the user of progress.
* @param progressMin minimum progress value, between 0 & 100, for this auto merge.
* @param progressMin minimum progress value, between 0 and 100, for this auto merge.
* The merge manager's progress should be updated from progressMin to progressMax
* as the autoMerge occurs.
* @param progressMax maximum progress value, between 0 & 100, for this auto merge.
* @param progressMax maximum progress value, between 0 and 100, for this auto merge.
* @throws ProgramConflictException if the programs for different versions are not compatible.
* @throws MemoryAccessException if memory can't be accessed to get/set byte values.
* @throws CancelledException if the user cancels the merge.
@@ -364,7 +364,8 @@ public class ListingMergePanel extends JPanel
}
/**
* @param navigator
* Adds a button press listener.
* @param listener the listener to add.
*/
public void addButtonPressedListener(ButtonPressedListener listener) {
for (ListingPanel listingPanel : listingPanels) {
@@ -42,7 +42,7 @@ public class ListingMergePanelPlugin extends Plugin implements ProgramaticUseOnl
/**
* Constructor
* @param tool merge tool
* @param mergeManager merge manager
* @param mergePanel merge panel
*/
public ListingMergePanelPlugin(PluginTool tool, ListingMergePanel mergePanel) {
super(tool);
@@ -15,6 +15,11 @@
*/
package ghidra.app.merge.tree;
import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import javax.swing.SwingUtilities;
import ghidra.app.merge.MergeResolver;
import ghidra.app.merge.ProgramMultiUserMergeManager;
import ghidra.app.util.HelpTopics;
@@ -26,11 +31,6 @@ import ghidra.util.SystemUtilities;
import ghidra.util.exception.*;
import ghidra.util.task.TaskMonitor;
import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import javax.swing.SwingUtilities;
/**
* Manages changes and conflicts between the latest versioned Program and the
* Program that is being checked into version control.
@@ -73,6 +73,7 @@ public class ProgramTreeMergeManager implements MergeResolver {
/**
* Construct a new manager for merging trees
* @param mergeManager the program merge manager
* @param resultProgram latest version of the Program that is the
* destination for changes applied from the source program
* @param myProgram source of changes to apply to the destination
@@ -82,7 +83,6 @@ public class ProgramTreeMergeManager implements MergeResolver {
* resultProgram and latestProgram start out as being identical
* @param latestChangeSet change set of the destination program
* @param myChangeSet change set for the source program
* @param monitor
*/
public ProgramTreeMergeManager(ProgramMultiUserMergeManager mergeManager,
Program resultProgram, Program myProgram, Program originalProgram,
@@ -153,15 +153,15 @@ public class ProgramTreeMergeManager implements MergeResolver {
mergeManager.updateProgress(0,
"Program Tree Merge is processing IDs changed in Checked Out...");
ArrayList<Long> changeList = new ArrayList<Long>();
for (int i = 0; i < myChangeIDs.length; i++) {
changeList.add(new Long(myChangeIDs[i]));
for (long myChangeID : myChangeIDs) {
changeList.add(new Long(myChangeID));
}
mergeManager.updateProgress(10,
"Program Tree Merge is processing IDs added in Checked Out...");
ArrayList<Long> myAddedList = new ArrayList<Long>();
for (int i = 0; i < myIDsAdded.length; i++) {
myAddedList.add(new Long(myIDsAdded[i]));
for (long element : myIDsAdded) {
myAddedList.add(new Long(element));
}
mergeManager.updateProgress(20, "Program Tree Merge is eliminating removed IDs...");
@@ -170,16 +170,16 @@ public class ProgramTreeMergeManager implements MergeResolver {
mergeManager.updateProgress(30, "Program Tree Merge is processing IDs added in Latest...");
ArrayList<Long> latestAddedList = new ArrayList<Long>();
for (int i = 0; i < latestIDsAdded.length; i++) {
latestAddedList.add(new Long(latestIDsAdded[i]));
for (long element : latestIDsAdded) {
latestAddedList.add(new Long(element));
}
conflictsChangeList = new ArrayList<Long>(changeList);
mergeManager.updateProgress(40, "Program Tree Merge is processing change IDs...");
ArrayList<Long> latestChangeList = new ArrayList<Long>();
for (int i = 0; i < latestChangeIDs.length; i++) {
latestChangeList.add(new Long(latestChangeIDs[i]));
for (long latestChangeID : latestChangeIDs) {
latestChangeList.add(new Long(latestChangeID));
}
mergeManager.updateProgress(50,
@@ -229,12 +229,12 @@ public class ProgramTreeMergeManager implements MergeResolver {
private void applyAdditions(ArrayList<Long> myList) throws CancelledException {
// add new trees
for (int i = 0; i < myList.size(); i++) {
for (Long element : myList) {
if (currentMonitor.isCancelled()) {
throw new CancelledException();
}
currentMonitor.setProgress(++progressIndex);
long treeID = myList.get(i).longValue();
long treeID = element.longValue();
ProgramModule sourceRoot = myListing.getRootModule(treeID);
if (sourceRoot != null) {
createTree(resultListing, getUniqueTreeName(sourceRoot.getTreeName()), sourceRoot);
@@ -272,13 +272,13 @@ public class ProgramTreeMergeManager implements MergeResolver {
*/
private void applyChanges(ArrayList<Long> changeList) throws CancelledException {
for (int i = 0; i < changeList.size(); i++) {
for (Long element : changeList) {
if (currentMonitor.isCancelled()) {
throw new CancelledException();
}
currentMonitor.setProgress(++progressIndex);
long treeID = changeList.get(i).longValue();
long treeID = element.longValue();
ProgramModule sourceRoot = myListing.getRootModule(treeID);
ProgramModule destRoot = resultListing.getRootModule(treeID);
@@ -375,8 +375,8 @@ public class ProgramTreeMergeManager implements MergeResolver {
removeEmptyFragments(root, fragmentNameList);
// remove the fragments that were created by default
for (int i = 0; i < names.length; i++) {
root.removeChild(names[i]);
for (String name : names) {
root.removeChild(name);
}
return root.getTreeID();
}
@@ -390,9 +390,9 @@ public class ProgramTreeMergeManager implements MergeResolver {
private void removeEmptyFragments(ProgramModule module, ArrayList<String> fragmentNameList) {
Group[] groups = module.getChildren();
for (int i = 0; i < groups.length; i++) {
if (groups[i] instanceof ProgramFragment) {
String name = groups[i].getName();
for (Group group : groups) {
if (group instanceof ProgramFragment) {
String name = group.getName();
if (!fragmentNameList.contains(name)) {
try {
module.removeChild(name);
@@ -403,7 +403,7 @@ public class ProgramTreeMergeManager implements MergeResolver {
}
}
else {
removeEmptyFragments((ProgramModule) groups[i], fragmentNameList);
removeEmptyFragments((ProgramModule) group, fragmentNameList);
}
}
}
@@ -413,16 +413,16 @@ public class ProgramTreeMergeManager implements MergeResolver {
parent.setComment(sourceParent.getComment());
Group[] kids = sourceParent.getChildren();
for (int i = 0; i < kids.length; i++) {
for (Group kid : kids) {
if (currentMonitor.isCancelled()) {
return;
}
String name = kids[i].getName();
if (kids[i] instanceof ProgramModule) {
createModule(parent, name, (ProgramModule) kids[i], fragmentNameList);
String name = kid.getName();
if (kid instanceof ProgramModule) {
createModule(parent, name, (ProgramModule) kid, fragmentNameList);
}
else {
createFragment(parent, name, (ProgramFragment) kids[i], fragmentNameList);
createFragment(parent, name, (ProgramFragment) kid, fragmentNameList);
}
}
}
@@ -477,8 +477,7 @@ public class ProgramTreeMergeManager implements MergeResolver {
while (iter.hasNext()) {
list.add(iter.next());
}
for (int i = 0; i < list.size(); i++) {
AddressRange range = list.get(i);
for (AddressRange range : list) {
try {
newFrag.move(range.getMinAddress(), range.getMaxAddress());
}
@@ -592,9 +591,9 @@ public class ProgramTreeMergeManager implements MergeResolver {
/**
* Covers case 6: dest content changed, source content changed;
* case 7: dest name change & content changed, source name changed & content changed
* case 8: dest name & content changed, source content changed
* case 9: dest content changed, source name & content changed
* case 7: dest name change and content changed, source name changed and content changed
* case 8: dest name and content changed, source content changed
* case 9: dest content changed, source name and content changed
* @throws CancelledException
*/
private void keepOtherOrCreateTree(ProgramModule origRoot, ProgramModule sourceRoot, ProgramModule destRoot,
@@ -738,7 +737,7 @@ public class ProgramTreeMergeManager implements MergeResolver {
}
/**
* Case 4: destination Name & content changed, source name changed
* Case 4: destination Name and content changed, source name changed
* @param sourceRoot source root module
* @param sourceTreeName source tree name
* @param destTreeName destination tree name
@@ -793,7 +792,7 @@ public class ProgramTreeMergeManager implements MergeResolver {
}
/**
* Case 5: destination Name changed, source name & content changed
* Case 5: destination Name changed, source name and content changed
* @param sourceRoot source root module
* @param sourceTreeName source tree name
* @param destTreeName destination tree name
@@ -164,7 +164,7 @@ public class ConflictUtility {
* Creates a standard address set conflict count message. This indicates
* which address or address range with conflicts you are resolving of some
* total number of addresses or address ranges with conflicts.
* @param caddressNum the current conflicting address number.
* @param addressNum the current conflicting address number.
* @param totalAddresses the total number of conflicting addresses.
* @param isRange true if the current conflict is for an address range.
* @return the message string containing HTML tags.
@@ -34,20 +34,24 @@ import ghidra.program.util.ProgramSelection;
* <p>
* Subclasses should override the following methods if they are interested
* in the corresponding events:
* <ul>
* <LI> <code>programOpened(Program)</code>
* <LI> <code>programClosed(Program)</code>
* <LI> <code>locationChanged(ProgramLocation)</code>
* <LI> <code>selectionChanged(ProgramSelection) </code>
* <LI> <code>highlightChanged(ProgramSelection) </code>
* </LI>
* </ul>
* <br>
* This class will handle the enablement and add to popup state for
* plugin actions when subclasses call any of the following methods:
* <ul>
* <LI><code>enableOnHighlight(PluginAction)</code>
* <LI><code>enableOnLocation(PluginAction)</code>
* <LI><code>enableOnProgram(PluginAction)</code>
* <LI><code>enableOnSelection(PluginAction)</code>
* </LI>
* </ul>
*
*/
public abstract class ProgramPlugin extends Plugin {
@@ -63,7 +67,6 @@ public abstract class ProgramPlugin extends Plugin {
/**
* Constructs a new program plugin
* @param name plugin name the name of this plugin
* @param plugintool tool the parent tool for this plugin
* @param consumeLocationChange true if this plugin should consume ProgramLocation events
* @param consumeSelectionChange true if this plugin should consume ProgramSelection events
@@ -1,6 +1,5 @@
/* ###
* 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.
@@ -40,10 +39,10 @@ public class AnalysisBackgroundCommand extends MergeableBackgroundCommand {
private boolean markAsAnalyzed;
/**
* When command is called, call this analyzer with the given address set
* Background Command to perform Auto Analysis on a program.
*
* @param analyzer the analyzer to call
* @param set the set to pass to the analyzer
* @param mgr the program's AutoAnalysisManager.
* @param markAsAnalyzed true to set the analyzed flag after analysis.
*/
public AnalysisBackgroundCommand(AutoAnalysisManager mgr, boolean markAsAnalyzed) {
super("Auto Analysis", true, true, false);
@@ -51,9 +50,6 @@ public class AnalysisBackgroundCommand extends MergeableBackgroundCommand {
this.markAsAnalyzed = markAsAnalyzed;
}
/* (non-Javadoc)
* @see ghidra.framework.cmd.BackgroundCommand#applyTo(ghidra.framework.model.DomainObject, ghidra.util.task.TaskMonitor)
*/
@Override
public boolean applyTo(DomainObject obj, TaskMonitor monitor) {
if (markAsAnalyzed) {
@@ -70,7 +70,7 @@ public class ArchiveDialog extends DialogComponentProvider {
/**
* Define the Main panel for the dialog here.
* @return JPanel the completed <CODE>Main Panel<\CODE>
* @return JPanel the completed <CODE>Main Panel</CODE>
*/
protected JPanel buildMainPanel() {
GridBagLayout gbl = new GridBagLayout();
@@ -217,7 +217,7 @@ public class AssembleDockingAction extends DockingAction {
}
/**
* Retrieve the location in the code viewer's {@link FieldPane} for the field at the given
* Retrieve the location in the code viewer's {@link FieldPanel} for the field at the given
* address having the given header text
* @param addr the address
* @param fieldName the name of the field
@@ -208,7 +208,7 @@ public class AssemblyDualTextField {
/**
* Represents the description of an error encountered during parsing or assembling
* @note not used until error descriptions improve
* NOTE: not used until error descriptions improve
*/
static class AssemblyError extends AssemblyCompletion {
private String text;
@@ -488,7 +488,7 @@ public class AssemblyDualTextField {
/**
* Set the visibility of the text box(es)
* @param determines whether both are hidden, the dual variant is shown, or the single variant is shown.
* @param visibility the VisibilityMode to set.
*/
public void setVisible(VisibilityMode visibility) {
switch (visibility) {
@@ -510,7 +510,7 @@ public class AssemblyDualTextField {
/**
* Add a focus listener to the box(es)
*
* @note The listener will not fire when focus passes among the linked boxes of the dual variant.
* NOTE: The listener will not fire when focus passes among the linked boxes of the dual variant.
* @param listener the listener
*/
public void addFocusListener(FocusListener listener) {
@@ -81,10 +81,6 @@ public class BlockModelServicePlugin extends ProgramPlugin
private StringWithChoicesEditor editor;
/**
* Constructor.
* @param plugintool tool
*/
public BlockModelServicePlugin(PluginTool tool) {
super(tool, false, false);
@@ -128,9 +124,8 @@ public class BlockModelServicePlugin extends ProgramPlugin
/**
* Handle an option change
* @param options options object containing the property that changed
* @param group
* @param name name of option that changed
* @param newOptions options object containing the property that changed
* @param optionName name of option that changed
* @param oldValue old value of the option
* @param newValue new value of the option
*/
@@ -1,6 +1,5 @@
/* ###
* 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.
@@ -162,9 +161,6 @@ public class BookmarkDeleteCmd implements Command {
return presentationName;
}
/**
* @see ghidra.framework.cmd.Command#applyTo(ghidra.framework.plugintool.PluginTool, ghidra.framework.model.DomainObject)
*/
@Override
public boolean applyTo(DomainObject obj) {
@@ -244,17 +240,11 @@ public class BookmarkDeleteCmd implements Command {
}
}
/**
* @see ghidra.framework.cmd.Command#getStatusMsg()
*/
@Override
public String getStatusMsg() {
return null;
}
/**
* @see ghidra.framework.cmd.Command#getName()
*/
@Override
public String getName() {
return presentationName;
@@ -1,6 +1,5 @@
/* ###
* 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.
@@ -43,10 +42,12 @@ public class BookmarkEditCmd implements Command {
private String presentationName;
/**
* Set a Bookmark. When setting a bookmark, all fields are used except the address
* Edit a Bookmark. When editing a bookmark, all fields are used except the address
* which is determined by the first address within each range of the set.
* @param template bookmark template
* @param set list off bookmark addresses
* @param set list of bookmark addresses.
* @param type the bookmark type.
* @param category the bookmark category.
* @param comment the bookmark comment.
*/
public BookmarkEditCmd(AddressSetView set, String type, String category, String comment) {
this.type = type;
@@ -59,10 +60,12 @@ public class BookmarkEditCmd implements Command {
}
/**
* Set a Bookmark. When setting a bookmark, all fields are used except the address
* Edit a Bookmark. When editing a bookmark, all fields are used except the address
* which is provided by the addrs parameter.
* @param template bookmark template
* @param set list off bookmark addresses
* @param addr the bookmark address.
* @param type the bookmark type.
* @param category the bookmark category.
* @param comment the bookmark comment.
*/
public BookmarkEditCmd(Address addr, String type, String category, String comment) {
this.type = type;
@@ -90,9 +93,7 @@ public class BookmarkEditCmd implements Command {
return presentationName;
}
/**
* @see ghidra.framework.cmd.Command#applyTo(ghidra.framework.plugintool.PluginTool, ghidra.framework.model.DomainObject)
*/
@Override
public boolean applyTo(DomainObject obj) {
BookmarkManager mgr = ((Program) obj).getBookmarkManager();
@@ -113,16 +114,12 @@ public class BookmarkEditCmd implements Command {
return true;
}
/**
* @see ghidra.framework.cmd.Command#getStatusMsg()
*/
@Override
public String getStatusMsg() {
return null;
}
/**
* @see ghidra.framework.cmd.Command#getName()
*/
@Override
public String getName() {
return presentationName;
}
@@ -63,7 +63,6 @@ public class ClearCmd extends BackgroundCommand {
* use {@link #ClearCmd(AddressSetView,ClearOptions)}.
*
* @param view the addresses over which to clear
* @param options the options used while clearing
*/
public ClearCmd(AddressSetView view) {
this(view, null, view.getNumAddresses() < EVENT_LIMIT);
@@ -71,9 +71,6 @@ public class ClearFlowAndRepairCmd extends BackgroundCommand {
this.repairFunctions = repair;
}
/**
* @see ghidra.framework.cmd.BackgroundCommand#applyTo(ghidra.framework.plugintool.PluginTool, ghidra.framework.model.DomainObject, ghidra.util.task.TaskMonitor)
*/
@Override
public boolean applyTo(DomainObject obj, TaskMonitor monitor) {
@@ -1,6 +1,5 @@
/* ###
* 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.
@@ -75,7 +74,7 @@ public interface ColorizingService {
* @param set The address at which the given color will be applied
* @param color The color to apply
*
* @see #clearBackgroundColor(AddressSetView))
* @see #clearBackgroundColor(AddressSetView)
* @see #getBackgroundColor(Address)
*/
public void setBackgroundColor(AddressSetView set, Color color);
@@ -839,11 +839,11 @@ public abstract class CompositeEditorPanel extends JPanel
/**
* Get the drag actions supported by this drag source:
* <UL>
* <ul>
* <li>DnDConstants.ACTION_MOVE
* <li>DnDConstants.ACTION_COPY
* <li>DnDConstants.ACTION_COPY_OR_MOVE
* </li>
* </ul>
*
* @return the drag actions
*/
@@ -1,6 +1,5 @@
/* ###
* 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.
@@ -16,6 +15,8 @@
*/
package ghidra.app.plugin.core.datamgr.archive;
import ghidra.program.model.data.DataTypeManager;
public interface ArchiveManagerListener {
/**
* Called when a new Archive is opened.
@@ -53,13 +53,13 @@ import ghidra.util.exception.UsrException;
*
*
*
* @todo Change the PseudoCodeUnit's getComment(int) method or change its
* TODO Change the PseudoCodeUnit's getComment(int) method or change its
* getPreview(int) method not to call getComment(int) and then change
* this class to not handle the UnsupportedOperationException.
* @todo are the category and names correct?
* @todo decide how to represent multiple selections in the display
* TODO are the category and names correct?
* TODO decide how to represent multiple selections in the display
*
* @todo Potential user options:
* TODO Potential user options:
* -look ahead count
* -to or to not display multiple selections
* -change the format of the preview displayed
@@ -92,7 +92,7 @@ class InstructionInfoProvider extends ComponentProviderAdapter implements Domain
/**
* Define the Main panel.
*
* @return JPanel the completed <CODE>Main Panel<\CODE>
* @return JPanel the completed <CODE>Main Panel</CODE>
*/
protected JPanel buildMainPanel(boolean isDynamic) {
@@ -77,7 +77,7 @@ public class MnemonicSearchPlugin extends Plugin {
/**
* Retrieves the selection region from the program, builds the search string, and pops
* up the @{link MemSearchDialog}.
* up the {@link MemSearchDialog}.
*
* @param context
* @param useOps
@@ -49,14 +49,16 @@ import docking.action.MenuData;
* tool. Selection is based on the initial selection or if there is no selection
* then on where the cursor is located in the program.<BR>
* This plugin provides the following types of selection:<BR>
* <UL>Select by following the flow from the specified address(es) onward.
* Properties indicate whether or not CALLS or JUMPS should be followed.</UL>
* <UL>Select the subroutine(s) for the specified address(es).</UL>
* <UL>Select the function(s) for the specified address(es).</UL>
* <UL>Select dead subroutine(s) for the specified address(es).</UL>
* <UL>Select the current program changes.</UL>
* <UL>Select by following the flow to the specified address(es).
* Properties indicate whether or not CALLS or JUMPS should be followed.</UL>
* <ul>
* <li>Select by following the flow from the specified address(es) onward.
* Properties indicate whether or not CALLS or JUMPS should be followed.</li>
* <li>Select the subroutine(s) for the specified address(es).</li>
* <li>Select the function(s) for the specified address(es).</li>
* <li>Select dead subroutine(s) for the specified address(es).</li>
* <li>Select the current program changes.</li>
* <li>Select by following the flow to the specified address(es).
* Properties indicate whether or not CALLS or JUMPS should be followed.</li>
* </UL>
*/
//@formatter:off
@PluginInfo(
@@ -32,7 +32,7 @@ import ghidra.util.table.field.*;
import ghidra.util.task.TaskMonitor;
/**
* Table model for the Search -> For Strings... result dialog.
* Table model for the Search -&gt; For Strings... result dialog.
* <p>
*/
public class StringTableModel extends AddressBasedTableModel<FoundString> {
@@ -52,7 +52,7 @@ import ghidra.util.task.TaskLauncher;
import resources.ResourceManager;
/**
* Component provider for the Search -> For Strings... result dialog.
* Component provider for the Search -&gt; For Strings... result dialog.
*/
public class StringTableProvider extends ComponentProviderAdapter implements DomainObjectListener {
private static final ImageIcon ICON = ResourceManager.loadImage("images/kmessedwords.png");
@@ -40,8 +40,6 @@ public class EditExternalLocationAction extends DockingAction {
* Creates the action for editing an existing external location or external function in the
* symbol tree.
* @param plugin the symbol tree plugin, which owns this action.
* @param contextClass context class specific to plugin to be used to differentiate
* ProgramSymbolActionContext instances.
*/
public EditExternalLocationAction(Plugin plugin) {
super("Edit External Location", plugin.getName());

Some files were not shown because too many files have changed in this diff Show More