mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-04 10:19:23 +02:00
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:
commit
6e6bdffe86
659 changed files with 1740 additions and 4136 deletions
|
@ -318,7 +318,7 @@ public class EmulatorHelper implements MemoryFaultHandler, EmulatorConfiguration
|
|||
|
||||
/**
|
||||
* Establish breakpoint
|
||||
* @param address memory address for new breakpoint
|
||||
* @param addr memory address for new breakpoint
|
||||
*/
|
||||
public void setBreakpoint(Address addr) {
|
||||
emulator.getBreakTable().registerAddressCallback(addr, addressBreak);
|
||||
|
@ -326,7 +326,7 @@ public class EmulatorHelper implements MemoryFaultHandler, EmulatorConfiguration
|
|||
|
||||
/**
|
||||
* Clear breakpoint
|
||||
* @param address memory address for breakpoint to be cleared
|
||||
* @param addr memory address for breakpoint to be cleared
|
||||
*/
|
||||
public void clearBreakpoint(Address addr) {
|
||||
emulator.getBreakTable().unregisterAddressCallback(addr);
|
||||
|
@ -363,8 +363,8 @@ public class EmulatorHelper implements MemoryFaultHandler, EmulatorConfiguration
|
|||
* Register callback for language defined pcodeop (call other).
|
||||
* WARNING! Using this method may circumvent the default CALLOTHER emulation support
|
||||
* when supplied by the Processor module.
|
||||
* @param pcodeOpName
|
||||
* @param callback
|
||||
* @param pcodeOpName the name of the pcode op
|
||||
* @param callback the callback to register
|
||||
*/
|
||||
public void registerCallOtherCallback(String pcodeOpName, BreakCallBack callback) {
|
||||
emulator.getBreakTable().registerPcodeCallback(pcodeOpName, callback);
|
||||
|
@ -374,8 +374,7 @@ public class EmulatorHelper implements MemoryFaultHandler, EmulatorConfiguration
|
|||
* Register default callback for language defined pcodeops (call other).
|
||||
* WARNING! Using this method may circumvent the default CALLOTHER emulation support
|
||||
* when supplied by the Processor module.
|
||||
* @param pcodeOpName
|
||||
* @param callback
|
||||
* @param callback the default callback to register
|
||||
*/
|
||||
public void registerDefaultCallOtherCallback(BreakCallBack callback) {
|
||||
emulator.getBreakTable().registerPcodeCallback("*", callback);
|
||||
|
@ -383,7 +382,7 @@ public class EmulatorHelper implements MemoryFaultHandler, EmulatorConfiguration
|
|||
|
||||
/**
|
||||
* Unregister callback for language defined pcodeop (call other).
|
||||
* @param pcodeOpName
|
||||
* @param pcodeOpName the name of the pcode op
|
||||
*/
|
||||
public void unregisterCallOtherCallback(String pcodeOpName) {
|
||||
emulator.getBreakTable().unregisterPcodeCallback(pcodeOpName);
|
||||
|
|
|
@ -39,7 +39,7 @@ public interface Assembler {
|
|||
* implement this method without a program binding. In that case, the returned instruction
|
||||
* block will refer to pseudo instructions.
|
||||
*
|
||||
* @note There must be an active transaction on the bound program for this method to succeed.
|
||||
* NOTE: There must be an active transaction on the bound program for this method to succeed.
|
||||
*
|
||||
* @param at the location where the resulting instructions should be placed
|
||||
* @param listing a new-line separated or array sequence of instructions
|
||||
|
@ -136,7 +136,7 @@ public interface Assembler {
|
|||
/**
|
||||
* Assemble a line instruction at the given address.
|
||||
*
|
||||
* This method works like {@link #resolveLine(Address, String, AssemblyPatternBlock), except
|
||||
* This method works like {@link #resolveLine(Address, String, AssemblyPatternBlock)}, except
|
||||
* that it derives the context using {@link #getContextAt(Address)}.
|
||||
* @param at the location of the start of the instruction
|
||||
* @param line the textual assembly code
|
||||
|
@ -149,7 +149,7 @@ public interface Assembler {
|
|||
/**
|
||||
* Assemble a line instruction at the given address, assuming the given context.
|
||||
*
|
||||
* This method works like {@link #assembleLine(Address,String,AssemblyPatternBlock}, except
|
||||
* This method works like {@link #assembleLine(Address, String, AssemblyPatternBlock)}, except
|
||||
* that it returns all possible resolutions for the parse trees that pass the
|
||||
* {@link AssemblySelector}.
|
||||
* @param at the location of the start of the instruction
|
||||
|
|
|
@ -29,7 +29,7 @@ import ghidra.program.model.listing.Program;
|
|||
* The primary class for obtaining an {@link Assembler} for a Ghidra-supported language.
|
||||
*
|
||||
* The general flow is: First, obtain an assembler for a language or program. Second, call its
|
||||
* {@link Assembler#assemble(Address, String)} and related methods to perform assembly. More
|
||||
* {@link Assembler#assemble(Address, String...)} and related methods to perform assembly. More
|
||||
* advanced uses pass a {@link AssemblySelector} to control certain aspects of assembly instruction
|
||||
* selection, and to obtain advanced diagnostics, like detailed errors and code completion.
|
||||
*
|
||||
|
|
|
@ -60,7 +60,7 @@ public class SleighAssembler implements Assembler {
|
|||
* @param program the program to bind to (must have same language as parser)
|
||||
* @param parser the parser for the SLEIGH language
|
||||
* @param defaultContext the default context for the language
|
||||
* @param recGraphs the map of recursion graphs (shared by assemblers of this language)
|
||||
* @param ctxGraph the context graph
|
||||
*/
|
||||
protected SleighAssembler(AssemblySelector selector, Program program, AssemblyParser parser,
|
||||
AssemblyDefaultContext defaultContext, AssemblyContextGraph ctxGraph) {
|
||||
|
@ -76,13 +76,13 @@ public class SleighAssembler implements Assembler {
|
|||
/**
|
||||
* Construct a SleighAssembler.
|
||||
*
|
||||
* @note This variant does not permit {@link #assemble(Address, String)}.
|
||||
* NOTE: This variant does not permit {@link #assemble(Address, String...)}.
|
||||
*
|
||||
* @param selector a method of selecting one result from many
|
||||
* @param lang the SLEIGH language (must be same as to create the parser)
|
||||
* @param parser the parser for the SLEIGH language
|
||||
* @param ctxGraph
|
||||
* @param recGraphs the map of recursion graphs (shared by assemblers of this language)
|
||||
* @param defaultContext the default context for the language
|
||||
* @param ctxGraph the context graph
|
||||
*/
|
||||
protected SleighAssembler(AssemblySelector selector, SleighLanguage lang, AssemblyParser parser,
|
||||
AssemblyDefaultContext defaultContext, AssemblyContextGraph ctxGraph) {
|
||||
|
@ -224,7 +224,7 @@ public class SleighAssembler implements Assembler {
|
|||
* A convenience to obtain a map of program labels strings to long values
|
||||
* @return the map
|
||||
*
|
||||
* @TODO Use a Map<String, Address> instead so that, if possible, symbol values can be checked
|
||||
* {@literal TODO Use a Map<String, Address> instead so that, if possible, symbol values can be checked}
|
||||
* lest they be an invalid substitution for a given operand.
|
||||
*/
|
||||
protected Map<String, Long> getProgramLabels() {
|
||||
|
|
|
@ -75,9 +75,9 @@ import ghidra.util.SystemUtilities;
|
|||
* semantic errors, then the overall result is an error.
|
||||
*
|
||||
* Some productions are "purely recursive," e.g., {@code :^instruction} lines in the SLEIGH. These
|
||||
* are ignored during parser construction. Let such a production be given as I => I. When resolving
|
||||
* are ignored during parser construction. Let such a production be given as I => I. When resolving
|
||||
* the parse tree to bytes, and we encounter a production with I on the left hand side, we then
|
||||
* consider the possible application of the production I => I and its consequential constructors.
|
||||
* consider the possible application of the production I => I and its consequential constructors.
|
||||
* Ideally, we could repeat this indefinitely, stopping when all further applications result in
|
||||
* semantic errors; however, there is no guarantee in the SLEIGH specification that such an
|
||||
* algorithm will actually halt, so a maximum number (default of 1) of applications are attempted.
|
||||
|
|
|
@ -130,7 +130,7 @@ public abstract class AbstractBinaryExpressionSolver<T extends BinaryExpression>
|
|||
/**
|
||||
* Compute the right-hand-side value given that the result and the left are known
|
||||
*
|
||||
* @note Assumes commutativity by default
|
||||
* NOTE: Assumes commutativity by default
|
||||
* @param lval the left-hand-side value
|
||||
* @param goal the result
|
||||
* @return the right-hand-side value solution
|
||||
|
|
|
@ -72,7 +72,7 @@ public abstract class AbstractUnaryExpressionSolver<T extends UnaryExpression>
|
|||
/**
|
||||
* Compute the input value given that the result is known
|
||||
*
|
||||
* @note Assumes an involution by default
|
||||
* NOTE: Assumes an involution by default
|
||||
* @param goal the result
|
||||
* @return the input value solution
|
||||
*/
|
||||
|
|
|
@ -18,7 +18,7 @@ package ghidra.app.plugin.assembler.sleigh.expr;
|
|||
import ghidra.app.plugin.processors.sleigh.expression.AndExpression;
|
||||
|
||||
/**
|
||||
* Solves expressions of the form A & B
|
||||
* Solves expressions of the form {@code A & B}
|
||||
*/
|
||||
public class AndExpressionSolver extends AbstractBinaryExpressionSolver<AndExpression> {
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ import ghidra.app.plugin.processors.sleigh.expression.EndInstructionValue;
|
|||
* Works like the constant solver, but takes the value of {@code inst_next}, which is given by the
|
||||
* assembly address and the resulting instruction length.
|
||||
*
|
||||
* @note This solver requires backfill.
|
||||
* NOTE: This solver requires backfill.
|
||||
*/
|
||||
public class EndInstructionValueSolver extends AbstractExpressionSolver<EndInstructionValue> {
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@ import ghidra.app.plugin.processors.sleigh.expression.LeftShiftExpression;
|
|||
import ghidra.util.Msg;
|
||||
|
||||
/**
|
||||
* Solves expressions of the form A << B
|
||||
* {@literal Solves expressions of the form A << B}
|
||||
*/
|
||||
public class LeftShiftExpressionSolver extends AbstractBinaryExpressionSolver<LeftShiftExpression> {
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@ import ghidra.app.plugin.processors.sleigh.expression.TokenField;
|
|||
import ghidra.util.NumericUtilities;
|
||||
|
||||
/**
|
||||
* A 64-bit value where each bit is {@code 0}, {@code 1}, or {@code x} (undefined)
|
||||
* A {@code 64}-bit value where each bit is {@code 0}, {@code 1}, or {@code x} (undefined)
|
||||
*/
|
||||
public class MaskedLong implements Comparable<MaskedLong> {
|
||||
public static final MaskedLong ZERO = new MaskedLong(-1, 0);
|
||||
|
@ -129,7 +129,7 @@ public class MaskedLong implements Comparable<MaskedLong> {
|
|||
* Any {@code 0} bit in {@code msk} will result in an undefined bit in the result. {@code 1}
|
||||
* bits result in a copy of the corresponding bit in the result.
|
||||
*
|
||||
* @param msk the mask to apply
|
||||
* @param mask the mask to apply
|
||||
* @return the result.
|
||||
*/
|
||||
public MaskedLong mask(long mask) {
|
||||
|
@ -519,14 +519,14 @@ public class MaskedLong implements Comparable<MaskedLong> {
|
|||
*
|
||||
* To handle unknown bits, the result is derived from the following truth table:
|
||||
*
|
||||
* <pre>
|
||||
* <pre>{@literal
|
||||
* 0 x 1 <= A (this)
|
||||
* 0 0 0 0
|
||||
* x 0 x x
|
||||
* 1 0 x 1
|
||||
* ^
|
||||
* B (that)
|
||||
* </pre>
|
||||
* }</pre>
|
||||
*
|
||||
* @param that the other masked long ({@code B}).
|
||||
* @return the result.
|
||||
|
@ -546,19 +546,19 @@ public class MaskedLong implements Comparable<MaskedLong> {
|
|||
}
|
||||
|
||||
/**
|
||||
* Solves the expression A & B = C, for B, given C and A
|
||||
*
|
||||
* Solves the expression {@code A & B = C, for B, given C and A}
|
||||
* <p>
|
||||
* To handle unknown bits, the solution is derived from the following truth table, where
|
||||
* {@code *} indicates no solution:
|
||||
*
|
||||
* <pre>
|
||||
* <pre>{@literal
|
||||
* 0 x 1 <= A (that)
|
||||
* 0 x x 0
|
||||
* x x x x
|
||||
* 1 * 1 1
|
||||
* ^
|
||||
* B (this)
|
||||
* </pre>
|
||||
* }</pre>
|
||||
*
|
||||
* @param that the other masked long ({@code B}).
|
||||
* @return the result.
|
||||
|
@ -589,14 +589,14 @@ public class MaskedLong implements Comparable<MaskedLong> {
|
|||
*
|
||||
* To handle unknown bits, the result is derived from the following truth table:
|
||||
*
|
||||
* <pre>
|
||||
* <pre>{@literal
|
||||
* 0 x 1 <= A (this)
|
||||
* 0 0 x 1
|
||||
* x x x 1
|
||||
* 1 1 1 1
|
||||
* ^
|
||||
* B (that)
|
||||
* </pre>
|
||||
* }</pre>
|
||||
*
|
||||
* @param that the other masked long ({@code B}).
|
||||
* @return the result.
|
||||
|
@ -623,14 +623,14 @@ public class MaskedLong implements Comparable<MaskedLong> {
|
|||
* To handle unknown bits, the solution is derived from the following truth table, where
|
||||
* {@code *} indicates no solution:
|
||||
*
|
||||
* <pre>
|
||||
* <pre>{@literal
|
||||
* 0 x 1 <= A (that)
|
||||
* 0 0 0 *
|
||||
* x x x x
|
||||
* 1 1 x x
|
||||
* ^
|
||||
* B (this)
|
||||
* </pre>
|
||||
* }</pre>
|
||||
*
|
||||
* @param that the other masked long ({@code B}).
|
||||
* @return the result.
|
||||
|
@ -660,14 +660,14 @@ public class MaskedLong implements Comparable<MaskedLong> {
|
|||
*
|
||||
* To handle unknown bits, the result is derived from the following truth table:
|
||||
*
|
||||
* <pre>
|
||||
* <pre>{@literal
|
||||
* 0 x 1 <= A (this)
|
||||
* 0 0 x 1
|
||||
* x x x x
|
||||
* 1 1 x 0
|
||||
* ^
|
||||
* B (that)
|
||||
* </pre>
|
||||
* }</pre>
|
||||
*
|
||||
* @param that the other masked long ({@code B}).
|
||||
* @return the result.
|
||||
|
@ -698,10 +698,10 @@ public class MaskedLong implements Comparable<MaskedLong> {
|
|||
*
|
||||
* To handle unknown bits, the result is derived from the following truth table:
|
||||
*
|
||||
* <pre>
|
||||
* <pre>{@literal
|
||||
* 0 x 1 <= A (this)
|
||||
* 1 x 0
|
||||
* </pre>
|
||||
* }</pre>
|
||||
*
|
||||
* @return the result.
|
||||
*/
|
||||
|
@ -959,7 +959,8 @@ public class MaskedLong implements Comparable<MaskedLong> {
|
|||
* Check if this and another object agree
|
||||
*
|
||||
* @param that a {@link MaskedLong} or {@link Long} to check.
|
||||
* @see {@link #agrees(MaskedLong)} and {@link #agrees(long)}.
|
||||
* @see #agrees(MaskedLong)
|
||||
* @see #agrees(long)
|
||||
* @return true if this and that agree.
|
||||
*/
|
||||
public boolean agrees(Object that) {
|
||||
|
|
|
@ -33,7 +33,7 @@ import ghidra.app.plugin.processors.sleigh.expression.PatternExpression;
|
|||
* the solution, positioned in the field. If the expression is constant, it checks that the goal
|
||||
* agrees. If not, an error is returned.
|
||||
*
|
||||
* @TODO This whole mechanism ought to just be factored directly into {@link PatternExpression}.
|
||||
* TODO This whole mechanism ought to just be factored directly into {@link PatternExpression}.
|
||||
*/
|
||||
public class RecursiveDescentSolver {
|
||||
protected static final DbgTimer dbg = DbgTimer.INACTIVE;
|
||||
|
@ -110,7 +110,6 @@ public class RecursiveDescentSolver {
|
|||
* @param description a description to attached to the encoded solution
|
||||
* @return the encoded solution
|
||||
* @throws NeedsBackfillException a solution may exist, but a required symbol is missing
|
||||
* @throws SolverException a solution does not exist
|
||||
*/
|
||||
protected AssemblyResolution solve(PatternExpression exp, MaskedLong goal,
|
||||
Map<String, Long> vals, Map<Integer, Object> res, AssemblyResolvedConstructor cur,
|
||||
|
@ -141,7 +140,7 @@ public class RecursiveDescentSolver {
|
|||
* {@link NeedsBackfillException}. The symbols, when known, are provided to the solver via the
|
||||
* {@code vals} parameter.
|
||||
*
|
||||
* Expressions involving {@link OperandValue}s are a little more complicated, because they
|
||||
* Expressions involving {@link OperandValueSolver}s are a little more complicated, because they
|
||||
* specify an offset that affects its encoding in the instruction. To compute this offset, the
|
||||
* lengths of other surrounding operands must be known. Thus, when solving a context change for
|
||||
* a given constructor, its resolved subconstructors must be provided to the solver via the
|
||||
|
@ -154,7 +153,6 @@ public class RecursiveDescentSolver {
|
|||
* @param description a description to attached to the encoded solution
|
||||
* @return the encoded solution
|
||||
* @throws NeedsBackfillException a solution may exist, but a required symbol is missing
|
||||
* @throws SolverException a solution does not exist
|
||||
*/
|
||||
public AssemblyResolution solve(PatternExpression exp, MaskedLong goal, Map<String, Long> vals,
|
||||
Map<Integer, Object> res, AssemblyResolvedConstructor cur, String description)
|
||||
|
@ -168,7 +166,7 @@ public class RecursiveDescentSolver {
|
|||
* @param exp the (sub-)expression to fold
|
||||
* @param vals any defined symbols (usually {@code inst_start}, and {@code inst_next})
|
||||
* @param res resolved subconstructors, by operand index (see
|
||||
* {@link #solve(PatternExpression, MaskedLong, Map, Map, String)})
|
||||
* {@link #solve(PatternExpression, MaskedLong, Map, Map, AssemblyResolvedConstructor, String)})
|
||||
* @return the masked solution
|
||||
* @throws NeedsBackfillException it may be folded, but a required symbol is missing
|
||||
*/
|
||||
|
@ -191,7 +189,7 @@ public class RecursiveDescentSolver {
|
|||
*
|
||||
* @param exp the expression, presumably containing a token field
|
||||
* @param res resolved subconstructors, by operand index (see
|
||||
* {@link #solve(PatternExpression, MaskedLong, Map, Map, String)})
|
||||
* {@link #solve(PatternExpression, MaskedLong, Map, Map, AssemblyResolvedConstructor, String)})
|
||||
* @return the anticipated length, in bytes, of the instruction encoding
|
||||
*/
|
||||
public int getInstructionLength(PatternExpression exp, Map<Integer, Object> res) {
|
||||
|
|
|
@ -24,7 +24,7 @@ import ghidra.app.plugin.processors.sleigh.expression.RightShiftExpression;
|
|||
import ghidra.util.Msg;
|
||||
|
||||
/**
|
||||
* Solves expressions of the form A >> B
|
||||
* {@literal Solves expressions of the form A >> B}
|
||||
*/
|
||||
public class RightShiftExpressionSolver
|
||||
extends AbstractBinaryExpressionSolver<RightShiftExpression> {
|
||||
|
|
|
@ -41,14 +41,13 @@ import ghidra.generic.util.datastruct.TreeSetValuedTreeMap;
|
|||
*
|
||||
* To define a grammar, simply construct an appropriate subclass (probably {@link AssemblyGrammar})
|
||||
* and call {@link #addProduction(AbstractAssemblyProduction)} or
|
||||
* {@link #addProduction(AssemblyNonTerminal, AssemblySentential). The grammar object will collect
|
||||
* {@link #addProduction(AssemblyNonTerminal, AssemblySentential)}. The grammar object will collect
|
||||
* the non-terminals and terminals.
|
||||
*
|
||||
* By default, the start symbol is taken from the left-hand side of the first production added to
|
||||
* the grammar.
|
||||
*
|
||||
* @param <NT> the type of non-terminals
|
||||
* @param <T> the type of terminals
|
||||
* @param <P> the type of productions, which must have the same types of (non-)terminals.
|
||||
*/
|
||||
public abstract class AbstractAssemblyGrammar<NT extends AssemblyNonTerminal, P extends AbstractAssemblyProduction<NT>>
|
||||
|
@ -115,7 +114,7 @@ public abstract class AbstractAssemblyGrammar<NT extends AssemblyNonTerminal, P
|
|||
}
|
||||
|
||||
/**
|
||||
* Check if the given production is purely recursive, i.e., of the form I => I
|
||||
* Check if the given production is purely recursive, i.e., of the form I => I
|
||||
* @param prod the production to check
|
||||
* @return true iff the production is purely recursive
|
||||
*/
|
||||
|
|
|
@ -27,7 +27,6 @@ import ghidra.app.plugin.assembler.sleigh.symbol.AssemblySymbol;
|
|||
*
|
||||
* @see AbstractAssemblyGrammar
|
||||
* @param <NT> the type of non-terminals
|
||||
* @param <T> the type of terminals
|
||||
*/
|
||||
public abstract class AbstractAssemblyProduction<NT extends AssemblyNonTerminal>
|
||||
extends AbstractListDecorator<AssemblySymbol>
|
||||
|
|
|
@ -28,7 +28,7 @@ import ghidra.app.plugin.processors.sleigh.pattern.DisjointPattern;
|
|||
* Defines a context free grammar, used to parse mnemonic assembly instructions
|
||||
*
|
||||
* This stores the CFG and the associated semantics for each production. It also has mechanisms for
|
||||
* tracking "purely recursive" productions. These are productions of the form I => I, and they
|
||||
* tracking "purely recursive" productions. These are productions of the form I => I, and they
|
||||
* necessarily create ambiguity. Thus, when constructing a parser, it is useful to identify them
|
||||
* early.
|
||||
*/
|
||||
|
|
|
@ -30,7 +30,6 @@ import ghidra.app.plugin.assembler.sleigh.tree.AssemblyParseToken;
|
|||
* in the grammar starting with the start symbol. We ignore that if only for the sake of naming.
|
||||
*
|
||||
* @param <NT> the type of non-terminals
|
||||
* @param <T> the type of terminals
|
||||
*/
|
||||
public class AssemblySentential<NT extends AssemblyNonTerminal> extends
|
||||
AbstractListDecorator<AssemblySymbol> implements Comparable<AssemblySentential<NT>> {
|
||||
|
|
|
@ -27,7 +27,7 @@ public class AssemblyParseAcceptResult extends AssemblyParseResult {
|
|||
private final AssemblyParseBranch tree;
|
||||
|
||||
/**
|
||||
* @see {@link AssemblyParseResult#accept(AssemblyParseBranch)}
|
||||
* @see AssemblyParseResult#accept(AssemblyParseBranch)
|
||||
*/
|
||||
protected AssemblyParseAcceptResult(AssemblyParseBranch tree) {
|
||||
this.tree = tree;
|
||||
|
|
|
@ -26,7 +26,7 @@ public class AssemblyParseErrorResult extends AssemblyParseResult {
|
|||
private final Set<String> suggestions;
|
||||
|
||||
/**
|
||||
* @see {@link AssemblyParseResult#error(String, Set)}
|
||||
* @see AssemblyParseResult#error(String, Set)
|
||||
*/
|
||||
protected AssemblyParseErrorResult(String got, Set<String> suggestions) {
|
||||
this.buffer = got;
|
||||
|
|
|
@ -37,7 +37,7 @@ public class AssemblyParseTransitionTable {
|
|||
* @param newState the destination state
|
||||
* @return the previous value for newState
|
||||
*
|
||||
* @note Generally, if this return non-null, something is probably wrong with your LR(0)
|
||||
* NOTE: Generally, if this return non-null, something is probably wrong with your LR(0)
|
||||
* machine generator
|
||||
*/
|
||||
public Integer put(int fromState, AssemblySymbol next, int newState) {
|
||||
|
|
|
@ -49,7 +49,6 @@ public class AssemblyConstructorSemantic implements Comparable<AssemblyConstruct
|
|||
|
||||
/**
|
||||
* Build a new SLEIGH constructor semantic
|
||||
* @param pattern the encoding pattern associated with the constructor
|
||||
* @param cons the SLEIGH constructor
|
||||
* @param indices the indices of RHS non-terminals in the associated production that represent an
|
||||
* operand in the SLEIGH constructor
|
||||
|
@ -155,8 +154,8 @@ public class AssemblyConstructorSemantic implements Comparable<AssemblyConstruct
|
|||
* This takes a given pattern, and searches the rest of the language for any patterns that
|
||||
* would take precedence, and combines them as forbidden patterns with the given pattern.
|
||||
*
|
||||
* @param pat2 the given pattern
|
||||
* @returns the same pattern with forbidden records added
|
||||
* @param pat the given pattern
|
||||
* @return the same pattern with forbidden records added
|
||||
*/
|
||||
protected AssemblyResolvedConstructor withComputedForbids(AssemblyResolvedConstructor pat) {
|
||||
// Forbid anything more specific (or otherwise takes precedence) over me.
|
||||
|
@ -240,7 +239,7 @@ public class AssemblyConstructorSemantic implements Comparable<AssemblyConstruct
|
|||
* reverse, the context is solved immediately before applying the selected constructor
|
||||
* patterns.
|
||||
*
|
||||
* @see AssemblyTreeResolver#resolveSelectedChildren(AssemblyProduction, List, List, Collection)
|
||||
* @see AssemblyTreeResolver#resolveSelectedChildren(AssemblyProduction, List, ImmutableList, Collection)
|
||||
*/
|
||||
public AssemblyResolution solveContextChanges(AssemblyResolvedConstructor res,
|
||||
Map<String, Long> vals, Map<Integer, Object> opvals) {
|
||||
|
|
|
@ -34,7 +34,7 @@ import ghidra.graph.algo.DijkstraShortestPathsAlgorithm;
|
|||
* A graph of possible context changes via the application of various constructors
|
||||
*
|
||||
* This is used primarily to find optimal paths for the application of recursive rules, i.e., those
|
||||
* of the form I => I. These cannot be resolved without some form of semantic analysis. The most
|
||||
* of the form I => I. These cannot be resolved without some form of semantic analysis. The most
|
||||
* notable disadvantage to all of this is that you no longer get all of the possible assemblies,
|
||||
* but only those with the fewest rule applications.
|
||||
*
|
||||
|
@ -99,7 +99,7 @@ public class AssemblyContextGraph implements GImplicitDirectedGraph<Vertex, Edge
|
|||
* @return a collection of sequences of constructor applications from {@code src} to
|
||||
* {@code dst}
|
||||
*
|
||||
* @note For assembly, the sequences will need to be applied right-to-left.
|
||||
* NOTE: For assembly, the sequences will need to be applied right-to-left.
|
||||
*/
|
||||
public Collection<Deque<AssemblyConstructorSemantic>> computeOptimalApplications(
|
||||
AssemblyPatternBlock src, String srcTable, AssemblyPatternBlock dst, String dstTable) {
|
||||
|
|
|
@ -39,7 +39,7 @@ import ghidra.util.StringUtilities;
|
|||
* It is suitable for the assembler because it is represented byte-by-byte, and it offers a number
|
||||
* of useful conversions and operations.
|
||||
*
|
||||
* @TODO A lot of this could probably be factored into the {@link PatternBlock} class, but it was
|
||||
* TODO A lot of this could probably be factored into the {@link PatternBlock} class, but it was
|
||||
* best to experiment in another class altogether to avoid breaking things.
|
||||
*/
|
||||
public class AssemblyPatternBlock implements Comparable<AssemblyPatternBlock> {
|
||||
|
@ -100,7 +100,7 @@ public class AssemblyPatternBlock implements Comparable<AssemblyPatternBlock> {
|
|||
|
||||
/**
|
||||
* Convert the given long to a pattern block (having offset 0 and a full mask)
|
||||
* @note The result will be 8 bytes in length
|
||||
* NOTE: The result will be 8 bytes in length
|
||||
* @param value the value to convert
|
||||
* @return the pattern block containing the big-endian representation of the value
|
||||
*/
|
||||
|
@ -118,7 +118,7 @@ public class AssemblyPatternBlock implements Comparable<AssemblyPatternBlock> {
|
|||
|
||||
/**
|
||||
* Convert the given masked long to a pattern block (having offset 0)
|
||||
* @note The result will be 8 bytes in length
|
||||
* NOTE: The result will be 8 bytes in length
|
||||
* @param ml the masked long, whose values and mask to convert
|
||||
* @return the pattern block containing the big-endian representation of the value
|
||||
*/
|
||||
|
@ -139,7 +139,7 @@ public class AssemblyPatternBlock implements Comparable<AssemblyPatternBlock> {
|
|||
|
||||
/**
|
||||
* Convert a string representation to a pattern block
|
||||
* @see StringUtilities#convertHexStringToMaskedValue(AtomicLong, AtomicLong, String, int, int, String)
|
||||
* @see NumericUtilities#convertHexStringToMaskedValue(AtomicLong, AtomicLong, String, int, int, String)
|
||||
* @param str the string to convert
|
||||
* @return the resulting pattern block
|
||||
*/
|
||||
|
@ -517,7 +517,7 @@ public class AssemblyPatternBlock implements Comparable<AssemblyPatternBlock> {
|
|||
/**
|
||||
* Encode the given value into a copy of this pattern block as specified by a context operation
|
||||
*
|
||||
* @note this method is given as a special operation, instead of a conversion factory method,
|
||||
* NOTE: this method is given as a special operation, instead of a conversion factory method,
|
||||
* because this is a write operation, not a combine operation. As such, the bits (including
|
||||
* undefined bits) replace the bits in the existing pattern block. Were this a conversion
|
||||
* method, we would lose the distinction between unknown bits being written, and bits whose
|
||||
|
@ -795,7 +795,7 @@ public class AssemblyPatternBlock implements Comparable<AssemblyPatternBlock> {
|
|||
* }
|
||||
* </pre>
|
||||
*
|
||||
* @note A single byte array is instantiated with the call to {@link Iterable#iterator()}. Each
|
||||
* NOTE: A single byte array is instantiated with the call to {@link Iterable#iterator()}. Each
|
||||
* call to {@link Iterator#next()} modifies the one byte array and returns it. As such, if you
|
||||
* intend to preserve the value in the array for later use, you <em>must</em> make a copy.
|
||||
* @return the iterable.
|
||||
|
|
|
@ -67,7 +67,7 @@ public abstract class AssemblyResolution implements Comparable<AssemblyResolutio
|
|||
/**
|
||||
* Build the result of successfully resolving a SLEIGH constructor
|
||||
*
|
||||
* @note This is not used strictly for resolved SLEIGH constructors. It may also be used to
|
||||
* NOTE: This is not used strictly for resolved SLEIGH constructors. It may also be used to
|
||||
* store intermediates, e.g., encoded operands, during constructor resolution.
|
||||
* @param ins the instruction pattern block
|
||||
* @param ctx the context pattern block
|
||||
|
@ -83,7 +83,7 @@ public abstract class AssemblyResolution implements Comparable<AssemblyResolutio
|
|||
|
||||
/**
|
||||
* Build an instruction-only successful resolution result
|
||||
* @see #resolved(AssemblyPatternBlock, AssemblyPatternBlock, String, List)
|
||||
* @see #resolved(AssemblyPatternBlock, AssemblyPatternBlock, String, ImmutableList)
|
||||
* @param ins the instruction pattern block
|
||||
* @param description a description of the resolution
|
||||
* @param children the children selected to resolve this constructor, or null
|
||||
|
@ -96,7 +96,7 @@ public abstract class AssemblyResolution implements Comparable<AssemblyResolutio
|
|||
|
||||
/**
|
||||
* Build a context-only successful resolution result
|
||||
* @see #resolved(AssemblyPatternBlock, AssemblyPatternBlock, String, List)
|
||||
* @see #resolved(AssemblyPatternBlock, AssemblyPatternBlock, String, ImmutableList)
|
||||
* @param ctx the context pattern block
|
||||
* @param description a description of the resolution
|
||||
* @param children the children selected to resolve this constructor, or null
|
||||
|
|
|
@ -45,7 +45,7 @@ public class AssemblyResolutionResults extends AbstractSetDecorator<AssemblyReso
|
|||
/**
|
||||
* Construct an immutable single-entry set consisting of the one given resolution
|
||||
*
|
||||
* @param res the single resolution entry
|
||||
* @param rc the single resolution entry
|
||||
* @return the new resolution set
|
||||
*/
|
||||
public static AssemblyResolutionResults singleton(AssemblyResolvedConstructor rc) {
|
||||
|
|
|
@ -27,7 +27,7 @@ import ghidra.app.plugin.processors.sleigh.expression.PatternExpression;
|
|||
* before the final result(s) are assembled. This is typically required by instructions that refer
|
||||
* to the {@code inst_next} symbol.
|
||||
*
|
||||
* @note These are used internally. The user ought never to see these from the assembly API.
|
||||
* NOTE: These are used internally. The user ought never to see these from the assembly API.
|
||||
*/
|
||||
public class AssemblyResolvedBackfill extends AssemblyResolution {
|
||||
protected final PatternExpression exp;
|
||||
|
|
|
@ -37,9 +37,10 @@ import ghidra.util.StringUtilities;
|
|||
/**
|
||||
* A {@link AssemblyResolution} indicating successful application of a constructor
|
||||
*
|
||||
* This is almost analogous to {@link DisjointPattern}, in that is joins an instruction
|
||||
* {@link AssemblyPatternBlock} with a corresponding context {@link AssemblyPatternBlock}. However,
|
||||
* this object is mutable, and it collects backfill records, as well as forbidden patterns.
|
||||
* This is almost analogous to {@link ghidra.app.plugin.processors.sleigh.pattern.DisjointPattern
|
||||
* DisjointPattern}, in that is joins an instruction {@link AssemblyPatternBlock} with a corresponding
|
||||
* context {@link AssemblyPatternBlock}. However, this object is mutable, and it collects backfill records,
|
||||
* as well as forbidden patterns.
|
||||
*
|
||||
* When the applied constructor is from the "instruction" subtable, this represents a fully-
|
||||
* constructed instruction with required context. All backfill records ought to be resolved and
|
||||
|
@ -112,7 +113,8 @@ public class AssemblyResolvedConstructor extends AssemblyResolution {
|
|||
*
|
||||
* This was used primarily in testing, to specify expected results.
|
||||
* @param str the string representation: "{@code ins:[pattern],ctx:[pattern]}"
|
||||
* @see StringUtilities#convertHexStringToMaskedValue(AtomicLong, AtomicLong, String, int, int, String)
|
||||
* @see ghidra.util.NumericUtilities#convertHexStringToMaskedValue(AtomicLong, AtomicLong, String, int, int, String)
|
||||
* NumericUtilities.convertHexStringToMaskedValue(AtomicLong, AtomicLong, String, int, int, String)
|
||||
* @param description a description of the resolution
|
||||
* @param children any children involved in the resolution
|
||||
* @return the decoded resolution
|
||||
|
@ -176,7 +178,7 @@ public class AssemblyResolvedConstructor extends AssemblyResolution {
|
|||
/**
|
||||
* Truncate (unshift) the resolved instruction pattern from the left
|
||||
*
|
||||
* @note This drops all backfill and forbidden pattern records, since this method is typically
|
||||
* NOTE: This drops all backfill and forbidden pattern records, since this method is typically
|
||||
* used to read token fields rather than passed around for resolution.
|
||||
* @param amt the number of bytes to remove from the left
|
||||
* @return the result
|
||||
|
@ -338,7 +340,7 @@ public class AssemblyResolvedConstructor extends AssemblyResolution {
|
|||
* Duplicate this resolution, with additional description text appended
|
||||
* @param append the text to append
|
||||
* @return the duplicate
|
||||
* @note An additional separator {@code ": "} is inserted
|
||||
* NOTE: An additional separator {@code ": "} is inserted
|
||||
*/
|
||||
public AssemblyResolvedConstructor copyAppendDescription(String append) {
|
||||
AssemblyResolvedConstructor cp = new AssemblyResolvedConstructor(
|
||||
|
@ -453,8 +455,8 @@ public class AssemblyResolvedConstructor extends AssemblyResolution {
|
|||
* This is used to ensure each operand is encoded at the correct offset
|
||||
* @return the length of the instruction block
|
||||
*
|
||||
* @note this DOES include the offset
|
||||
* @note this DOES include pending backfills
|
||||
* NOTE: this DOES include the offset
|
||||
* NOTE: this DOES include pending backfills
|
||||
*/
|
||||
public int getInstructionLength() {
|
||||
int inslen = ins.length();
|
||||
|
@ -468,8 +470,8 @@ public class AssemblyResolvedConstructor extends AssemblyResolution {
|
|||
* Get the length of the instruction encoding, excluding trailing undefined bytes
|
||||
* @return the length of the defined bytes in the instruction block
|
||||
*
|
||||
* @note this DOES include the offset
|
||||
* @note this DOES NOT include pending backfills
|
||||
* NOTE: this DOES include the offset
|
||||
* NOTE: this DOES NOT include pending backfills
|
||||
*/
|
||||
public int getDefinedInstructionLength() {
|
||||
byte[] imsk = ins.getMask();
|
||||
|
@ -628,7 +630,7 @@ public class AssemblyResolvedConstructor extends AssemblyResolution {
|
|||
* the sequence mentioned above, since {@link AssemblyPatternBlock#possibleVals()} on its own
|
||||
* may yield bytes that do not produce the desired instruction.
|
||||
*
|
||||
* @note The implementation is based on {@link AssemblyPatternBlock#possibleVals()}, so be
|
||||
* NOTE: The implementation is based on {@link AssemblyPatternBlock#possibleVals()}, so be
|
||||
* aware that a single array is reused for each iterate. You should not retain a pointer to the
|
||||
* array, but rather make a copy.
|
||||
*
|
||||
|
|
|
@ -63,7 +63,7 @@ public class AssemblyNumericTerminal extends AssemblyTerminal {
|
|||
/**
|
||||
* This is only a convenience for testing
|
||||
*
|
||||
* Please use {@link #match(String, AssemblyGrammar, Map<String, Long>)}.
|
||||
* Please use {@link #match(String, int, AssemblyGrammar, Map) match(String, int, AssemblyGrammar, Map<String, Long>)}.
|
||||
* @param buffer the input buffer
|
||||
* @return the parsed token
|
||||
*/
|
||||
|
|
|
@ -27,7 +27,7 @@ import ghidra.app.plugin.processors.sleigh.symbol.VarnodeListSymbol;
|
|||
/**
|
||||
* A terminal that accepts only a particular set of strings, mapping each to a numeric value
|
||||
*
|
||||
* @see NameSymbol
|
||||
* @see ghidra.app.plugin.processors.sleigh.symbol.NameSymbol NameSymbol
|
||||
* @see VarnodeListSymbol
|
||||
*/
|
||||
public class AssemblyStringMapTerminal extends AssemblyTerminal {
|
||||
|
|
|
@ -53,7 +53,7 @@ class SleighPcodeTraversal implements VisitorResults {
|
|||
* An interface for visiting Pcode operations in a constructor
|
||||
*
|
||||
* @see SleighPcodeTraversal#traverse(OnlyPcodeOpEntryVisitor)
|
||||
* @note This is meant for internal use only
|
||||
* NOTE: This is meant for internal use only
|
||||
*/
|
||||
static interface OnlyPcodeOpEntryVisitor extends VisitorResults {
|
||||
public int visit(OpTpl op);
|
||||
|
|
|
@ -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.
|
||||
|
@ -60,8 +59,8 @@ public class ConstantTemplate implements Serializable {
|
|||
|
||||
/**
|
||||
* Constructor ConstantTemplate.
|
||||
* @param o
|
||||
* @param i
|
||||
* @param o the operand
|
||||
* @param sel1 the first selection
|
||||
*/
|
||||
public ConstantTemplate(Operand o, int sel1) throws SledException {
|
||||
this(o,sel1,0);
|
||||
|
@ -84,9 +83,8 @@ public class ConstantTemplate implements Serializable {
|
|||
|
||||
/**
|
||||
* Method resolve.
|
||||
* @param handles
|
||||
* @param position
|
||||
* @param off
|
||||
* @param position the position of the constant to resolve
|
||||
* @param off the offset of the constant
|
||||
* @return long
|
||||
*/
|
||||
public long resolve(Position position, int off) throws Exception {
|
||||
|
@ -111,9 +109,8 @@ public class ConstantTemplate implements Serializable {
|
|||
}
|
||||
|
||||
/**
|
||||
* @param handles
|
||||
* @param position
|
||||
* @param off
|
||||
* @param handles optional map of handles to be used for resolving
|
||||
* @see #resolve(Position, int)
|
||||
* @return long
|
||||
*/
|
||||
public long resolve(HashMap<Object, Handle> handles, Position position, int off) throws Exception {
|
||||
|
|
|
@ -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.
|
||||
|
@ -22,6 +21,7 @@ import ghidra.program.model.mem.MemBuffer;
|
|||
import java.io.Serializable;
|
||||
import java.util.Hashtable;
|
||||
|
||||
// TODO needs documentation
|
||||
/**
|
||||
*
|
||||
*/
|
||||
|
@ -58,8 +58,8 @@ public class ExpressionTerm implements Serializable {
|
|||
public ExpressionValue getValue() { return val; }
|
||||
|
||||
/**
|
||||
* Method addSpace.
|
||||
* @param id
|
||||
* Sets the address space of the expression value
|
||||
* @param space the address space to set
|
||||
*/
|
||||
public void setSpace(AddressSpace space) throws SledException {
|
||||
if (val.getClass() != BinaryExpression.class)
|
||||
|
|
|
@ -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.
|
||||
|
@ -22,9 +21,9 @@ import ghidra.program.model.mem.MemBuffer;
|
|||
*
|
||||
*
|
||||
* To change this generated comment edit the template variable "typecomment":
|
||||
* Window>Preferences>Java>Templates.
|
||||
* {@literal Window>Preferences>Java>Templates.}
|
||||
* To enable and disable the creation of type comments go to
|
||||
* Window>Preferences>Java>Code Generation.
|
||||
* {@literal Window>Preferences>Java>Code Generation.}
|
||||
*/
|
||||
public class Label implements ExpressionValue {
|
||||
|
||||
|
|
|
@ -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.
|
||||
|
@ -130,11 +129,7 @@ public class Operand implements Serializable {
|
|||
}
|
||||
|
||||
/**
|
||||
* Return l
|
||||
* @param list
|
||||
* @param buf
|
||||
* @param i
|
||||
* @return
|
||||
* @see OperandValue#toList(ArrayList, Position, int)
|
||||
*/
|
||||
public void toList(ArrayList<Handle> list, Position position, int off) throws Exception {
|
||||
op.toList(list, position, offset.getOffset(position.buffer(),off));
|
||||
|
|
|
@ -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.
|
||||
|
@ -51,9 +50,9 @@ public interface OperandValue extends Serializable {
|
|||
/**
|
||||
* Construct operand representation as a list of objects
|
||||
*
|
||||
* @param list
|
||||
* @param buf
|
||||
* @param i
|
||||
* @param list the list to fill
|
||||
* @param position the operand position
|
||||
* @param off the offset
|
||||
*/
|
||||
public void toList(ArrayList<Handle> list, Position position, int off) throws Exception;
|
||||
|
||||
|
|
|
@ -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.
|
||||
|
@ -24,9 +23,9 @@ import ghidra.program.model.mem.MemBuffer;
|
|||
*
|
||||
*
|
||||
* To change this generated comment edit the template variable "typecomment":
|
||||
* Window>Preferences>Java>Templates.
|
||||
* {@literal Window>Preferences>Java>Templates.}
|
||||
* To enable and disable the creation of type comments go to
|
||||
* Window>Preferences>Java>Code Generation.
|
||||
* {@literal Window>Preferences>Java>Code Generation.}
|
||||
*/
|
||||
public class Position {
|
||||
|
||||
|
|
|
@ -25,9 +25,9 @@ import ghidra.program.model.pcode.Varnode;
|
|||
*
|
||||
*
|
||||
* To change this generated comment edit the template variable "typecomment":
|
||||
* Window>Preferences>Java>Templates.
|
||||
* {@literal Window>Preferences>Java>Templates.}
|
||||
* To enable and disable the creation of type comments go to
|
||||
* Window>Preferences>Java>Code Generation.
|
||||
* {@literal Window>Preferences>Java>Code Generation.}
|
||||
*/
|
||||
public class VarnodeTemplate implements Serializable {
|
||||
|
||||
|
@ -92,9 +92,11 @@ public class VarnodeTemplate implements Serializable {
|
|||
}
|
||||
|
||||
/**
|
||||
* @param position
|
||||
* @param off
|
||||
* @return Varnode
|
||||
* Resolves a varnode at the given position and buffer offset
|
||||
* @param position the position
|
||||
* @param bufoff the buffer offset
|
||||
* @return the resolved {@link Varnode raw varnode}. (<b>Only</b> contains an address and size)
|
||||
* @throws Exception if an error occurs resolving the varnode
|
||||
*/
|
||||
public Varnode resolve(Position position, int bufoff) throws Exception {
|
||||
int spaceID = (int) space.resolve(position, bufoff);
|
||||
|
|
|
@ -283,8 +283,9 @@ public class Constructor implements Comparable<Constructor> {
|
|||
/**
|
||||
* Apply any operations on context for this Constructor to a
|
||||
* particular InstructionContext
|
||||
* @param pos
|
||||
* @throws MemoryAccessException
|
||||
* @param walker the parser walker
|
||||
* @param debug the debug logger
|
||||
* @throws MemoryAccessException if the context failed to be applied.
|
||||
*/
|
||||
public void applyContext(ParserWalker walker, SleighDebugLogger debug)
|
||||
throws MemoryAccessException {
|
||||
|
|
|
@ -50,8 +50,8 @@ public class ParserWalker {
|
|||
|
||||
/**
|
||||
* For use with pcode cross-build
|
||||
* @param c
|
||||
* @param nextAddr
|
||||
* @param c context
|
||||
* @param cross cross context
|
||||
*/
|
||||
public ParserWalker(SleighParserContext c, SleighParserContext cross) {
|
||||
this(c);
|
||||
|
|
|
@ -59,7 +59,8 @@ public class PcodeEmitPacked extends PcodeEmit {
|
|||
|
||||
/**
|
||||
* Pcode emitter constructor for producing a packed binary representation.
|
||||
* @param delayContexts delay slotted instruction contexts
|
||||
* @param walk parser walker
|
||||
* @param ictx instruction contexts
|
||||
* @param fallOffset default instruction fall offset (i.e., instruction length including delay slotted instructions)
|
||||
* @param override required if pcode overrides are to be utilized
|
||||
* @param uniqueFactory required when override specified or if overlay normalization is required
|
||||
|
|
|
@ -67,9 +67,10 @@ public class SleighDebugLogger {
|
|||
|
||||
/**
|
||||
* Performs a parse debug at the specified memory location within program.
|
||||
* @param buf
|
||||
* @param programContext
|
||||
* @param verbose if true extended debug information may be provided
|
||||
* @param buf the memory buffer
|
||||
* @param context the processor context
|
||||
* @param language the sleigh language
|
||||
* @param mode the sleigh debug mode
|
||||
* @throws IllegalArgumentException if program language provider is not Sleigh
|
||||
*/
|
||||
public SleighDebugLogger(MemBuffer buf, ProcessorContextView context, Language language,
|
||||
|
@ -141,9 +142,9 @@ public class SleighDebugLogger {
|
|||
|
||||
/**
|
||||
* Performs a parse debug at the specified memory location within program.
|
||||
* @param program
|
||||
* @param start
|
||||
* @param verbose if true extended debug information may be provided
|
||||
* @param program the program the memory location is found in
|
||||
* @param start the start address of the memory location
|
||||
* @param mode the sleigh debug mode
|
||||
* @throws IllegalArgumentException if program language provider is not Sleigh
|
||||
*/
|
||||
public SleighDebugLogger(Program program, Address start, SleighDebugMode mode) {
|
||||
|
@ -199,7 +200,7 @@ public class SleighDebugLogger {
|
|||
|
||||
/**
|
||||
* @return true if a parse error was detected, otherwise false is returned.
|
||||
* The methods getMaskedInstructionBytes() and getInstructionBitMask() should
|
||||
* The methods getMaskedBytes() and getInstructionMask() should
|
||||
* only be invoked if this method returns false.
|
||||
*/
|
||||
public boolean parseFailed() {
|
||||
|
@ -297,7 +298,7 @@ public class SleighDebugLogger {
|
|||
* NOTE: Method has no affect unless constructed with VERBOSE logging mode.
|
||||
* @param value integer array
|
||||
* @param startbit identifies the first most-significant bit within the
|
||||
* bracketed range (left-most value[0] bit is bit-0, right-most value[n] bit is bit-<32(n+1)-1> ).
|
||||
* {@literal bracketed range (left-most value[0] bit is bit-0, right-most value[n] bit is bit-<32(n+1)-1> ).}
|
||||
* @param bitcount number of bits included within range
|
||||
*/
|
||||
public void append(int[] value, int startbit, int bitcount) {
|
||||
|
@ -323,7 +324,7 @@ public class SleighDebugLogger {
|
|||
* NOTE: Method has no affect unless constructed with VERBOSE logging mode.
|
||||
* @param value byte array
|
||||
* @param startbit identifies the first most-significant bit within the
|
||||
* bracketed range (left-most value[0] bit is bit-0, right-most value[n] bit is bit-<8(n+1)-1> ).
|
||||
* {@literal bracketed range (left-most value[0] bit is bit-0, right-most value[n] bit is bit-<8(n+1)-1> ).}
|
||||
* @param bitcount number of bits included within range
|
||||
*/
|
||||
public void append(byte[] value, int startbit, int bitcount) {
|
||||
|
@ -914,7 +915,7 @@ public class SleighDebugLogger {
|
|||
* the instruction (includes addressing modes, generally excludes register selector bits
|
||||
* associated with attaches or immediate values used in for semantic values only).
|
||||
* @throws IllegalStateException if prototype parse failed
|
||||
* @see SleighDebugLogger#getMaskedInstructionBytes()
|
||||
* @see #getFormattedInstructionMask(int) getFormattedInstructionMask(-1)
|
||||
*/
|
||||
public byte[] getInstructionMask() {
|
||||
buildMasks();
|
||||
|
|
|
@ -190,7 +190,7 @@ public class SleighInstructionPrototype implements InstructionPrototype {
|
|||
/**
|
||||
* Walk the pcode templates in the order they would be emitted.
|
||||
* Collect flowFlags FlowRecords
|
||||
* @param sectionnum is the named section to walk
|
||||
* @param walker the pcode template walker
|
||||
*/
|
||||
public static FlowSummary walkTemplates(OpTplWalker walker) {
|
||||
FlowSummary res = new FlowSummary();
|
||||
|
|
|
@ -209,9 +209,8 @@ public class ConstTpl {
|
|||
/**
|
||||
* Fill in the space portion of a FixedHandle, based
|
||||
* on this const.
|
||||
* @param hand = handle to fillin
|
||||
* @param pos = current context
|
||||
* @param treeLoc
|
||||
* @param hand handle to fillin
|
||||
* @param walker current parser walker
|
||||
*/
|
||||
public void fillinSpace(FixedHandle hand, ParserWalker walker) {
|
||||
switch (type) {
|
||||
|
@ -243,9 +242,8 @@ public class ConstTpl {
|
|||
* appropriately. We don't just fill in the temporary
|
||||
* variable offset, like "fix". Assume that hand.space is
|
||||
* already filled in
|
||||
* @param hand = the handle to fillin
|
||||
* @param pos = current context
|
||||
* @param treeLoc
|
||||
* @param hand handle to fillin
|
||||
* @param walker current parser walker
|
||||
*/
|
||||
public void fillinOffset(FixedHandle hand, ParserWalker walker) {
|
||||
if (type == HANDLE) {
|
||||
|
|
|
@ -29,7 +29,7 @@ import ghidra.util.exception.*;
|
|||
* <a name="examples"></a>
|
||||
* Example string format:
|
||||
* <ul>
|
||||
* <li>global{@link Namespace#NAMESPACE_DELIMITER <delimiter>}child1{@link Namespace#NAMESPACE_DELIMITER <delimiter>}child2
|
||||
* <li>global{@link Namespace#NAMESPACE_DELIMITER ::}child1{@link Namespace#NAMESPACE_DELIMITER ::}child2
|
||||
* <li>child1
|
||||
* </ul>
|
||||
* <a name="assumptions"></a>
|
||||
|
|
|
@ -148,9 +148,6 @@ abstract class PseudoCodeUnit implements CodeUnit {
|
|||
return isValid;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.listing.CodeUnit#getAddressString(boolean, boolean)
|
||||
*/
|
||||
@Override
|
||||
public String getAddressString(boolean showBlockName, boolean pad) {
|
||||
Address cuAddress = address;
|
||||
|
@ -400,9 +397,6 @@ abstract class PseudoCodeUnit implements CodeUnit {
|
|||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.listing.CodeUnit#propertyNames()
|
||||
*/
|
||||
@Override
|
||||
public Iterator<String> propertyNames() {
|
||||
throw new UnsupportedOperationException();
|
||||
|
@ -539,9 +533,6 @@ abstract class PseudoCodeUnit implements CodeUnit {
|
|||
return this.getMaxAddress().isSuccessor(min);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.listing.CodeUnit#getComment(int)
|
||||
*/
|
||||
@Override
|
||||
public String getComment(int commentType) {
|
||||
return comments.get(commentType);
|
||||
|
@ -763,7 +754,7 @@ abstract class PseudoCodeUnit implements CodeUnit {
|
|||
|
||||
/**
|
||||
* Add a user defined reference to the operand at the given index.
|
||||
* @see ghidra.program.model.listing.CodeUnit#addOperandReference(int, ghidra.program.model.address.Address, ghidra.program.model.symbol.RefType, SourceType)
|
||||
* @see CodeUnit#addOperandReference(int, Address, RefType, SourceType)
|
||||
*/
|
||||
@Override
|
||||
public void addOperandReference(int opIndex, Address refAddr, RefType type,
|
||||
|
@ -853,11 +844,6 @@ abstract class PseudoCodeUnit implements CodeUnit {
|
|||
return refMgr.getPrimaryReferenceFrom(address, index);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see ghidra.program.model.listing.CodeUnit#setPrimaryMemoryReference(ghidra.program.model.symbol.Reference)
|
||||
*/
|
||||
@Override
|
||||
public void setPrimaryMemoryReference(Reference ref) {
|
||||
if (refMgr == null)
|
||||
|
@ -865,23 +851,14 @@ abstract class PseudoCodeUnit implements CodeUnit {
|
|||
refMgr.setPrimary(ref, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.listing.CodeUnit#getStackReference(int)
|
||||
*/
|
||||
public StackReference getStackReference(int opIndex) {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.listing.CodeUnit#removeStackReference(int)
|
||||
*/
|
||||
public void removeStackReference(int opIndex) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.listing.CodeUnit#getExternalReference(int)
|
||||
*/
|
||||
@Override
|
||||
public ExternalReference getExternalReference(int opIndex) {
|
||||
if (refMgr == null)
|
||||
|
@ -895,17 +872,11 @@ abstract class PseudoCodeUnit implements CodeUnit {
|
|||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.listing.CodeUnit#removeExternalReference(int)
|
||||
*/
|
||||
@Override
|
||||
public void removeExternalReference(int opIndex) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.listing.CodeUnit#getReferenceIteratorTo()
|
||||
*/
|
||||
@Override
|
||||
public ReferenceIterator getReferenceIteratorTo() {
|
||||
if (refMgr == null)
|
||||
|
@ -915,17 +886,11 @@ abstract class PseudoCodeUnit implements CodeUnit {
|
|||
|
||||
// ///////////////////////////////////////////////////////////////////
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.listing.CodeUnit#getProgram()
|
||||
*/
|
||||
@Override
|
||||
public Program getProgram() {
|
||||
return program;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see java.lang.Object#equals(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public abstract boolean equals(Object obj);
|
||||
|
||||
|
|
|
@ -86,26 +86,17 @@ public class PseudoData extends PseudoCodeUnit implements Data {
|
|||
return length;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.listing.Data#addValueReference(ghidra.program.model.address.Address, ghidra.program.model.symbol.RefType)
|
||||
*/
|
||||
@Override
|
||||
public void addValueReference(Address refAddr, RefType type) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.listing.Data#removeValueReference(ghidra.program.model.address.Address)
|
||||
*/
|
||||
@Override
|
||||
public void removeValueReference(Address refAddr) {
|
||||
throw new UnsupportedOperationException();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.listing.Data#getComponent(int)
|
||||
*/
|
||||
@Override
|
||||
public Data getComponent(int index) {
|
||||
if (index < 0 || index >= getNumComponents()) {
|
||||
|
@ -142,9 +133,6 @@ public class PseudoData extends PseudoCodeUnit implements Data {
|
|||
return data;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.listing.CodeUnit#getAddress(int)
|
||||
*/
|
||||
@Override
|
||||
public Address getAddress(int opIndex) {
|
||||
if (opIndex == 0) {
|
||||
|
@ -156,9 +144,6 @@ public class PseudoData extends PseudoCodeUnit implements Data {
|
|||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.listing.CodeUnit#getByteCodeString()
|
||||
*/
|
||||
public String getByteCodeString() {
|
||||
StringBuffer bytesStr = new StringBuffer();
|
||||
|
||||
|
@ -186,10 +171,6 @@ public class PseudoData extends PseudoCodeUnit implements Data {
|
|||
return bytesStr.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see ghidra.program.model.listing.CodeUnit#toString()
|
||||
*/
|
||||
@Override
|
||||
public String toString() {
|
||||
String valueRepresentation = getDefaultValueRepresentation();
|
||||
|
@ -200,9 +181,6 @@ public class PseudoData extends PseudoCodeUnit implements Data {
|
|||
return mnemonicString + " " + valueRepresentation;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.listing.Data#getDefaultValueRepresentation()
|
||||
*/
|
||||
@Override
|
||||
public String getDefaultValueRepresentation() {
|
||||
if (getLength() < dataType.getLength()) {
|
||||
|
@ -212,25 +190,16 @@ public class PseudoData extends PseudoCodeUnit implements Data {
|
|||
return dataType.getRepresentation(this, this, getLength());
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.listing.CodeUnit#getMnemonicString()
|
||||
*/
|
||||
@Override
|
||||
public String getMnemonicString() {
|
||||
return dataType.getMnemonic(this);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.listing.CodeUnit#getNumOperands()
|
||||
*/
|
||||
@Override
|
||||
public int getNumOperands() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.listing.CodeUnit#getScalar(int)
|
||||
*/
|
||||
@Override
|
||||
public Scalar getScalar(int opIndex) {
|
||||
if (opIndex == 0) {
|
||||
|
@ -247,58 +216,36 @@ public class PseudoData extends PseudoCodeUnit implements Data {
|
|||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.listing.Data#getBaseDataType()
|
||||
*/
|
||||
@Override
|
||||
public DataType getBaseDataType() {
|
||||
return baseDataType;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see ghidra.program.model.data.Settings#clearSetting(java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
public void clearSetting(String name) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.docking.settings.Settings#getByteArray(java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
public byte[] getByteArray(String name) {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.docking.settings.Settings#getLong(java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
public Long getLong(String name) {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.docking.settings.Settings#getNames()
|
||||
*/
|
||||
@Override
|
||||
public String[] getNames() {
|
||||
return new String[0];
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.docking.settings.Settings#getString(java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
public String getString(String name) {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.docking.settings.Settings#getValue(java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
public Object getValue(String name) {
|
||||
if (baseDataType != null) {
|
||||
|
@ -307,41 +254,26 @@ public class PseudoData extends PseudoCodeUnit implements Data {
|
|||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.docking.settings.Settings#setByteArray(java.lang.String, byte[])
|
||||
*/
|
||||
@Override
|
||||
public void setByteArray(String name, byte[] value) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.docking.settings.Settings#setLong(java.lang.String, long)
|
||||
*/
|
||||
@Override
|
||||
public void setLong(String name, long value) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.docking.settings.Settings#setString(java.lang.String, java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
public void setString(String name, String value) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.docking.settings.Settings#setValue(java.lang.String, java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public void setValue(String name, Object value) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.listing.Data#getComponent(int[])
|
||||
*/
|
||||
@Override
|
||||
public Data getComponent(int[] componentPath) {
|
||||
if (componentPath == null || componentPath.length <= level) {
|
||||
|
@ -351,9 +283,6 @@ public class PseudoData extends PseudoCodeUnit implements Data {
|
|||
return (component == null ? null : component.getComponent(componentPath));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.listing.Data#getComponentAt(int)
|
||||
*/
|
||||
@Override
|
||||
public Data getComponentAt(int offset) {
|
||||
if (offset < 0 || offset >= length) {
|
||||
|
@ -424,33 +353,21 @@ public class PseudoData extends PseudoCodeUnit implements Data {
|
|||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.listing.Data#getComponentIndex()
|
||||
*/
|
||||
@Override
|
||||
public int getComponentIndex() {
|
||||
return -1;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.listing.Data#getComponentLevel()
|
||||
*/
|
||||
@Override
|
||||
public int getComponentLevel() {
|
||||
return level;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.listing.Data#getComponentPath()
|
||||
*/
|
||||
@Override
|
||||
public int[] getComponentPath() {
|
||||
return EMPTY_PATH;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.listing.Data#getComponentPathName()
|
||||
*/
|
||||
@Override
|
||||
public String getComponentPathName() {
|
||||
return null;
|
||||
|
@ -491,25 +408,16 @@ public class PseudoData extends PseudoCodeUnit implements Data {
|
|||
// return retData;
|
||||
// }
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.listing.Data#getDataType()
|
||||
*/
|
||||
@Override
|
||||
public DataType getDataType() {
|
||||
return dataType;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.listing.Data#getFieldName()
|
||||
*/
|
||||
@Override
|
||||
public String getFieldName() {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.listing.Data#getNumComponents()
|
||||
*/
|
||||
@Override
|
||||
public int getNumComponents() {
|
||||
if (length < dataType.getLength()) {
|
||||
|
@ -527,25 +435,16 @@ public class PseudoData extends PseudoCodeUnit implements Data {
|
|||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.listing.Data#getParent()
|
||||
*/
|
||||
@Override
|
||||
public Data getParent() {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.listing.Data#getParentOffset()
|
||||
*/
|
||||
@Override
|
||||
public int getParentOffset() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.listing.Data#getPathName()
|
||||
*/
|
||||
@Override
|
||||
public String getPathName() {
|
||||
if (program != null) {
|
||||
|
@ -558,9 +457,6 @@ public class PseudoData extends PseudoCodeUnit implements Data {
|
|||
return "DAT" + address.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.listing.Data#getPrimitiveAt(int)
|
||||
*/
|
||||
@Override
|
||||
public Data getPrimitiveAt(int offset) {
|
||||
if (offset < 0 || offset >= length) {
|
||||
|
@ -573,25 +469,16 @@ public class PseudoData extends PseudoCodeUnit implements Data {
|
|||
return dc.getPrimitiveAt(offset - dc.getParentOffset());
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.listing.Data#getRoot()
|
||||
*/
|
||||
@Override
|
||||
public Data getRoot() {
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.listing.Data#getRootOffset()
|
||||
*/
|
||||
@Override
|
||||
public int getRootOffset() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.listing.Data#getValue()
|
||||
*/
|
||||
@Override
|
||||
public Object getValue() {
|
||||
return baseDataType.getValue(this, this, length);
|
||||
|
@ -611,9 +498,6 @@ public class PseudoData extends PseudoCodeUnit implements Data {
|
|||
return String.class.equals(getValueClass());
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.listing.Data#getValueReferences()
|
||||
*/
|
||||
@Override
|
||||
public Reference[] getValueReferences() {
|
||||
if (refMgr == null) {
|
||||
|
@ -622,65 +506,41 @@ public class PseudoData extends PseudoCodeUnit implements Data {
|
|||
return refMgr.getReferencesFrom(address, OP_INDEX);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.listing.Data#isArray()
|
||||
*/
|
||||
@Override
|
||||
public boolean isArray() {
|
||||
return baseDataType instanceof Array;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.listing.Data#isDefined()
|
||||
*/
|
||||
@Override
|
||||
public boolean isDefined() {
|
||||
return !(dataType instanceof DefaultDataType);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.listing.Data#isPointer()
|
||||
*/
|
||||
@Override
|
||||
public boolean isPointer() {
|
||||
return baseDataType instanceof Pointer;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.listing.Data#isStructure()
|
||||
*/
|
||||
@Override
|
||||
public boolean isStructure() {
|
||||
return baseDataType instanceof Structure;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.listing.Data#isDynamic()
|
||||
*/
|
||||
@Override
|
||||
public boolean isDynamic() {
|
||||
return baseDataType instanceof DynamicDataType;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.listing.Data#isUnion()
|
||||
*/
|
||||
@Override
|
||||
public boolean isUnion() {
|
||||
return baseDataType instanceof Union;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.docking.settings.Settings#clearAllSettings()
|
||||
*/
|
||||
@Override
|
||||
public void clearAllSettings() {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.docking.settings.Settings#isEmpty()
|
||||
*/
|
||||
@Override
|
||||
public boolean isEmpty() {
|
||||
if (dataMgr == null) {
|
||||
|
@ -725,9 +585,6 @@ public class PseudoData extends PseudoCodeUnit implements Data {
|
|||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.docking.settings.Settings#getDefaultSettings()
|
||||
*/
|
||||
@Override
|
||||
public Settings getDefaultSettings() {
|
||||
return dataType.getDefaultSettings();
|
||||
|
|
|
@ -227,7 +227,7 @@ public class PseudoDisassembler {
|
|||
*
|
||||
* @param addr address to disassemble
|
||||
* @param bytes bytes to use instead of those currently defined in program
|
||||
* @param PseudoDisassemblerContext the disassembler context to use.
|
||||
* @param disassemblerContext the disassembler context to use.
|
||||
* @return PseudoInstruction.
|
||||
*
|
||||
* @throws InsufficientBytesException
|
||||
|
@ -277,9 +277,6 @@ public class PseudoDisassembler {
|
|||
* @param addr location to get a PseudoData item for
|
||||
* @param dt the data type to be applied
|
||||
* @return PsuedoData that acts like Data
|
||||
*
|
||||
* @throws InsufficientBytesException
|
||||
* @throws UnknownContextException
|
||||
*/
|
||||
public PseudoData applyDataType(Address addr, DataType dt) {
|
||||
|
||||
|
@ -326,10 +323,12 @@ public class PseudoDisassembler {
|
|||
|
||||
/**
|
||||
* Check that this entry point leads to a well behaved subroutine:
|
||||
* <ul>
|
||||
* <li>It should return.</li>
|
||||
* <li>Hit no bad instructions.</li>
|
||||
* <li>Have only one entry point.</li>
|
||||
* <li>Not overlap any existing data or instructions.</li>
|
||||
* </ul>
|
||||
* @param entryPoint entry point to check
|
||||
* @return true if entry point leads to a well behaved subroutine
|
||||
*/
|
||||
|
@ -340,10 +339,12 @@ public class PseudoDisassembler {
|
|||
/**
|
||||
* Check that this entry point leads to a well behaved subroutine, allow it
|
||||
* to fall into existing code.
|
||||
* <ul>
|
||||
* <li>It should return.</li>
|
||||
* <li>Hit no bad instructions.</li>
|
||||
* <li>Have only one entry point.</li>
|
||||
* <li>Not overlap any existing data or cause offcut references.</li>
|
||||
* </ul>
|
||||
* @param entryPoint entry point to check
|
||||
* @param allowExistingCode true allows this subroutine to flow into existing instructions.
|
||||
* @return true if entry point leads to a well behaved subroutine
|
||||
|
@ -355,11 +356,11 @@ public class PseudoDisassembler {
|
|||
/**
|
||||
* Check that this entry point leads to a well behaved subroutine, allow it
|
||||
* to fall into existing code.
|
||||
*
|
||||
* <ul>
|
||||
* <li>Hit no bad instructions.</li>
|
||||
* <li>Have only one entry point.</li>
|
||||
* <li>Not overlap any existing data or cause offcut references.</li>
|
||||
*
|
||||
* </ul>
|
||||
* @param entryPoint entry point to check
|
||||
* @param allowExistingCode true allows this subroutine to flow into existing instructions.
|
||||
* @param mustTerminate true if the subroutine must terminate
|
||||
|
@ -373,11 +374,12 @@ public class PseudoDisassembler {
|
|||
|
||||
/**
|
||||
* Check that this entry point leads to valid code:
|
||||
* <ul>
|
||||
* <li> May have multiple entries into the body of the code.
|
||||
* <li>The intent is that it be valid code, not nice code.
|
||||
* <li>Hit no bad instructions.
|
||||
* <li>It should return.
|
||||
* </li>
|
||||
* </ul>
|
||||
* @param entryPoint
|
||||
* @return true if the entry point leads to valid code
|
||||
*/
|
||||
|
@ -388,11 +390,12 @@ public class PseudoDisassembler {
|
|||
|
||||
/**
|
||||
* Check that this entry point leads to valid code:
|
||||
* <ul>
|
||||
* <li> May have multiple entries into the body of the code.
|
||||
* <li>The intent is that it be valid code, not nice code.
|
||||
* <li>Hit no bad instructions.
|
||||
* <li>It should return.
|
||||
* </li>
|
||||
* </ul>
|
||||
*
|
||||
* @param entryPoint location to test for valid code
|
||||
* @param context disassembly context for program
|
||||
|
|
|
@ -28,9 +28,11 @@ import ghidra.util.SystemUtilities;
|
|||
* For example, if a SymbolPath is constructed with "foo::bar::baz", then "baz" is the
|
||||
* name of a symbol in the "bar" namespace, which is in the "foo" namespace.
|
||||
* <P>
|
||||
* <UL>
|
||||
* <LI>{@link #getName()} will return "baz".
|
||||
* <LI>{@link #getParentPath()} will return "foo:bar".
|
||||
* <LI>{@link #getPath()} will return "foo::bar::baz".
|
||||
* </UL>
|
||||
*
|
||||
*/
|
||||
public class SymbolPath implements Comparable<SymbolPath> {
|
||||
|
|
|
@ -38,7 +38,7 @@ public class SymbolPathParser {
|
|||
* has each more deeply nested namespace contained in order in the list, followed
|
||||
* by the trailing name.
|
||||
* @param name The input String to be parsed.
|
||||
* @return List<String> containing the sequence of namespaces and trailing name.
|
||||
* @return {@literal List<String>} containing the sequence of namespaces and trailing name.
|
||||
*/
|
||||
public static List<String> parse(String name) {
|
||||
if (StringUtils.isBlank(name)) {
|
||||
|
|
|
@ -145,7 +145,7 @@ public class Emulate {
|
|||
}
|
||||
|
||||
/**
|
||||
* @returns the current emulator execution state
|
||||
* @return the current emulator execution state
|
||||
*/
|
||||
public EmulateExecutionState getExecutionState() {
|
||||
return executionState;
|
||||
|
|
|
@ -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.
|
||||
|
@ -23,18 +22,19 @@ import ghidra.program.model.address.Address;
|
|||
// using 1 of possibly many different methods behind the scenes
|
||||
public interface LoadImage {
|
||||
|
||||
/**
|
||||
*
|
||||
* @param ptr
|
||||
* @param size
|
||||
* @param addr
|
||||
* @param bufOffset
|
||||
* @param generateInitializedMask if true the function should return an initialized bit mask
|
||||
* or null if all loaded bytes were known. If true, uninitialized memory reads should only be
|
||||
* reflected in the mask and should not be reported via the memory fault handler.
|
||||
* @return initialized bit mask or null (see generateInitializedMask parameter)
|
||||
* @see MemoryPage
|
||||
*/
|
||||
// TODO this doesn't appear to be used.
|
||||
// /**
|
||||
// *
|
||||
// * @param ptr
|
||||
// * @param size
|
||||
// * @param addr
|
||||
// * @param bufOffset
|
||||
// * @param generateInitializedMask if true the function should return an initialized bit mask
|
||||
// * or null if all loaded bytes were known. If true, uninitialized memory reads should only be
|
||||
// * reflected in the mask and should not be reported via the memory fault handler.
|
||||
// * @return initialized bit mask or null (see generateInitializedMask parameter)
|
||||
// * @see MemoryPage
|
||||
// */
|
||||
public byte[] loadFill( byte[] buf, int size, Address addr, int bufOffset, boolean generateInitializedMask );
|
||||
|
||||
}
|
||||
|
|
|
@ -79,7 +79,7 @@ public class DBObjectCache<T extends DatabaseObject> {
|
|||
* record query during a possible object refresh. To benefit from the record the cached
|
||||
* object must implement the {@link DatabaseObject#refresh(Record)} method which by default
|
||||
* ignores the record and simply calls {@link DatabaseObject#refresh()}.
|
||||
* @param record the valid record corresponding to the object to be retrieved and possibly
|
||||
* @param objectRecord the valid record corresponding to the object to be retrieved and possibly
|
||||
* used to refresh the associated object if found in cache
|
||||
* @return the cached object or null if the object with that key is not currently cached.
|
||||
*/
|
||||
|
|
|
@ -52,7 +52,7 @@ public class DataTypeArchiveDB extends DomainObjectAdapterDB
|
|||
* UPGRADE_REQUIRED_BEFORE_VERSION should be changed to DB_VERSION any time the
|
||||
* latest version requires a forced upgrade (i.e., Read-only mode not supported
|
||||
* until upgrade is performed). It is assumed that read-only mode is supported
|
||||
* if the data's version is >= UPGRADE_REQUIRED_BEFORE_VERSION and <= DB_VERSION.
|
||||
* if the data's version is >= UPGRADE_REQUIRED_BEFORE_VERSION and <= DB_VERSION.
|
||||
*/
|
||||
private static final int UPGRADE_REQUIRED_BEFORE_VERSION = 1;
|
||||
|
||||
|
@ -195,9 +195,6 @@ public class DataTypeArchiveDB extends DomainObjectAdapterDB
|
|||
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.framework.data.DomainObjectAdapter#setDomainFile(ghidra.framework.model.DomainFile)
|
||||
*/
|
||||
@Override
|
||||
protected void setDomainFile(DomainFile df) {
|
||||
super.setDomainFile(df);
|
||||
|
@ -223,9 +220,6 @@ public class DataTypeArchiveDB extends DomainObjectAdapterDB
|
|||
changed = origChangeState;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.framework.data.DomainObjectAdapterDB#propertyChanged(java.lang.String, java.lang.Object, java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
protected boolean propertyChanged(String propertyName, Object oldValue, Object newValue) {
|
||||
if (propertyName.endsWith(DEFAULT_POINTER_SIZE) && (newValue instanceof Integer)) {
|
||||
|
@ -258,7 +252,7 @@ public class DataTypeArchiveDB extends DomainObjectAdapterDB
|
|||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.listing.Program#getDefaultStoredPointerSize()
|
||||
* @see ghidra.program.model.listing.Program#getDefaultPointerSize()
|
||||
*/
|
||||
@Override
|
||||
public int getDefaultPointerSize() {
|
||||
|
@ -369,16 +363,10 @@ public class DataTypeArchiveDB extends DomainObjectAdapterDB
|
|||
fireEvent(new DataTypeArchiveChangeRecord(type, affectedObj, oldValue, newValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.framework.model.DomainObject#setName(java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
public void setName(String newName) {
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.framework.model.DomainObject#getDescription()
|
||||
*/
|
||||
@Override
|
||||
public String getDescription() {
|
||||
return "Data Type Archive";
|
||||
|
@ -506,9 +494,6 @@ public class DataTypeArchiveDB extends DomainObjectAdapterDB
|
|||
dataTypeManager.archiveReady(openMode, monitor);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.framework.data.DomainObjectAdapterDB#clearCache()
|
||||
*/
|
||||
@Override
|
||||
protected void clearCache(boolean all) {
|
||||
lock.acquire();
|
||||
|
@ -530,9 +515,6 @@ public class DataTypeArchiveDB extends DomainObjectAdapterDB
|
|||
fireEvent(new DomainObjectChangeRecord(DomainObject.DO_OBJECT_RESTORED));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.framework.model.DomainObject#isChangeable()
|
||||
*/
|
||||
@Override
|
||||
public boolean isChangeable() {
|
||||
return changeable;
|
||||
|
|
|
@ -100,7 +100,7 @@ public class ProgramDB extends DomainObjectAdapterDB implements Program, ChangeM
|
|||
* UPGRADE_REQUIRED_BFORE_VERSION should be changed to DB_VERSION anytime the
|
||||
* latest version requires a forced upgrade (i.e., Read-only mode not supported
|
||||
* until upgrade is performed). It is assumed that read-only mode is supported
|
||||
* if the data's version is >= UPGRADE_REQUIRED_BEFORE_VERSION and <= DB_VERSION.
|
||||
* if the data's version is >= UPGRADE_REQUIRED_BEFORE_VERSION and <= DB_VERSION.
|
||||
*/
|
||||
private static final int UPGRADE_REQUIRED_BEFORE_VERSION = 19;
|
||||
|
||||
|
@ -206,7 +206,8 @@ public class ProgramDB extends DomainObjectAdapterDB implements Program, ChangeM
|
|||
/**
|
||||
* Constructs a new ProgramDB
|
||||
* @param name the name of the program
|
||||
* @param languageSuperFacade the Language used by this program
|
||||
* @param language the Language used by this program
|
||||
* @param compilerSpec compiler specification
|
||||
* @param consumer the object that is using this program.
|
||||
* @throws IOException if there is an error accessing the database.
|
||||
*/
|
||||
|
@ -262,9 +263,6 @@ public class ProgramDB extends DomainObjectAdapterDB implements Program, ChangeM
|
|||
/**
|
||||
* Constructs a new ProgramDB
|
||||
* @param dbh a handle to an open program database.
|
||||
* @param userDbh a handle to the associated user data
|
||||
* @param service the LanguageService that will provide that language object once
|
||||
* the name of the language is retrieved from the database.
|
||||
* @param openMode one of:
|
||||
* READ_ONLY: the original database will not be modified
|
||||
* UPDATE: the database can be written to.
|
||||
|
@ -402,7 +400,7 @@ public class ProgramDB extends DomainObjectAdapterDB implements Program, ChangeM
|
|||
* UPDATE: the database can be written to.
|
||||
* UPGRADE: the database is upgraded to the lastest schema as it is opened.
|
||||
* @throws LanguageNotFoundException
|
||||
* @returns VersionException if language upgrade required
|
||||
* @return VersionException if language upgrade required
|
||||
*/
|
||||
private VersionException checkLanguageVersion(int openMode) throws LanguageNotFoundException {
|
||||
|
||||
|
@ -458,7 +456,7 @@ public class ProgramDB extends DomainObjectAdapterDB implements Program, ChangeM
|
|||
* READ_ONLY: the original database will not be modified
|
||||
* UPDATE: the database can be written to.
|
||||
* UPGRADE: the database is upgraded to the lastest schema as it is opened.
|
||||
* @returns true if language upgrade required
|
||||
* @return true if language upgrade required
|
||||
* @throws LanguageNotFoundException if a suitable replacement language not found
|
||||
*/
|
||||
private VersionException checkForLanguageChange(LanguageNotFoundException e, int openMode)
|
||||
|
@ -488,9 +486,7 @@ public class ProgramDB extends DomainObjectAdapterDB implements Program, ChangeM
|
|||
return ve;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.framework.data.DomainObjectAdapter#setDomainFile(ghidra.framework.model.DomainFile)
|
||||
*/
|
||||
|
||||
@Override
|
||||
protected void setDomainFile(DomainFile df) {
|
||||
super.setDomainFile(df);
|
||||
|
@ -526,9 +522,6 @@ public class ProgramDB extends DomainObjectAdapterDB implements Program, ChangeM
|
|||
this.programUserData = programUserData;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.listing.Program#getProgramUserData()
|
||||
*/
|
||||
@Override
|
||||
public ProgramUserData getProgramUserData() {
|
||||
if (programUserData == null) {
|
||||
|
@ -553,41 +546,26 @@ public class ProgramDB extends DomainObjectAdapterDB implements Program, ChangeM
|
|||
return programUserData;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.listing.Program#getListing()
|
||||
*/
|
||||
@Override
|
||||
public Listing getListing() {
|
||||
return listing;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.listing.Program#getSymbolTable()
|
||||
*/
|
||||
@Override
|
||||
public SymbolTable getSymbolTable() {
|
||||
return (SymbolTable) managers[SYMBOL_MGR];
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.listing.Program#getExternalManager()
|
||||
*/
|
||||
@Override
|
||||
public ExternalManager getExternalManager() {
|
||||
return (ExternalManager) managers[EXTERNAL_MGR];
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.listing.Program#getEquateTable()
|
||||
*/
|
||||
@Override
|
||||
public EquateTable getEquateTable() {
|
||||
return (EquateTable) managers[EQUATE_MGR];
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.listing.Program#getMemory()
|
||||
*/
|
||||
@Override
|
||||
public Memory getMemory() {
|
||||
return memoryManager;
|
||||
|
@ -600,9 +578,6 @@ public class ProgramDB extends DomainObjectAdapterDB implements Program, ChangeM
|
|||
return (NamespaceManager) managers[NAMESPACE_MGR];
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.listing.Program#getReferenceManager()
|
||||
*/
|
||||
@Override
|
||||
public ReferenceManager getReferenceManager() {
|
||||
return (ReferenceManager) managers[REF_MGR];
|
||||
|
@ -622,41 +597,26 @@ public class ProgramDB extends DomainObjectAdapterDB implements Program, ChangeM
|
|||
return (TreeManager) managers[TREE_MGR];
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.listing.Program#getDataTypeManager()
|
||||
*/
|
||||
@Override
|
||||
public ProgramDataTypeManager getDataTypeManager() {
|
||||
return (ProgramDataTypeManager) managers[DATA_MGR];
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the FunctionManager
|
||||
*/
|
||||
@Override
|
||||
public FunctionManager getFunctionManager() {
|
||||
return (FunctionManagerDB) managers[FUNCTION_MGR];
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.listing.Program#getBookmarkManager()
|
||||
*/
|
||||
@Override
|
||||
public BookmarkManager getBookmarkManager() {
|
||||
return (BookmarkManager) managers[BOOKMARK_MGR];
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.listing.Program#getRelocationTable()
|
||||
*/
|
||||
@Override
|
||||
public RelocationTable getRelocationTable() {
|
||||
return (RelocationManager) managers[RELOC_MGR];
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.listing.Program#getCompiler()
|
||||
*/
|
||||
@Override
|
||||
public String getCompiler() {
|
||||
String compiler = null;
|
||||
|
@ -665,9 +625,6 @@ public class ProgramDB extends DomainObjectAdapterDB implements Program, ChangeM
|
|||
return compiler == null ? UNKNOWN : compiler;
|
||||
}
|
||||
|
||||
/*
|
||||
* @see ghidra.program.model.listing.Program#setCompiler(java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
public void setCompiler(String compiler) {
|
||||
Options pl = getOptions(PROGRAM_INFO);
|
||||
|
@ -675,9 +632,6 @@ public class ProgramDB extends DomainObjectAdapterDB implements Program, ChangeM
|
|||
changed = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.listing.Program#getExecutablePath()
|
||||
*/
|
||||
@Override
|
||||
public String getExecutablePath() {
|
||||
String path = null;
|
||||
|
@ -686,9 +640,6 @@ public class ProgramDB extends DomainObjectAdapterDB implements Program, ChangeM
|
|||
return path == null ? UNKNOWN : path;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.listing.Program#setExecutablePath(java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
public void setExecutablePath(String path) {
|
||||
Options pl = getOptions(PROGRAM_INFO);
|
||||
|
@ -696,9 +647,6 @@ public class ProgramDB extends DomainObjectAdapterDB implements Program, ChangeM
|
|||
changed = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.listing.Program#getExecutableFormat()
|
||||
*/
|
||||
@Override
|
||||
public String getExecutableFormat() {
|
||||
String format = null;
|
||||
|
@ -711,9 +659,6 @@ public class ProgramDB extends DomainObjectAdapterDB implements Program, ChangeM
|
|||
return format == null ? UNKNOWN : format;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.listing.Program#setExecutableFormat(java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
public void setExecutableFormat(String format) {
|
||||
Options pl = getOptions(PROGRAM_INFO);
|
||||
|
@ -721,9 +666,6 @@ public class ProgramDB extends DomainObjectAdapterDB implements Program, ChangeM
|
|||
changed = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.listing.Program#getExecutableMD5()
|
||||
*/
|
||||
@Override
|
||||
public String getExecutableMD5() {
|
||||
String format = null;
|
||||
|
@ -736,9 +678,6 @@ public class ProgramDB extends DomainObjectAdapterDB implements Program, ChangeM
|
|||
return format == null ? UNKNOWN : format;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.listing.Program#setExecutableMD5(java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
public void setExecutableMD5(String md5) {
|
||||
Options pl = getOptions(PROGRAM_INFO);
|
||||
|
@ -746,9 +685,6 @@ public class ProgramDB extends DomainObjectAdapterDB implements Program, ChangeM
|
|||
changed = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.listing.Program#getExecutableSHA256()
|
||||
*/
|
||||
@Override
|
||||
public String getExecutableSHA256() {
|
||||
String format = null;
|
||||
|
@ -761,9 +697,6 @@ public class ProgramDB extends DomainObjectAdapterDB implements Program, ChangeM
|
|||
return format == null ? UNKNOWN : format;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.listing.Program#setExecutableSHA256(java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
public void setExecutableSHA256(String sha256) {
|
||||
Options pl = getOptions(PROGRAM_INFO);
|
||||
|
@ -771,90 +704,57 @@ public class ProgramDB extends DomainObjectAdapterDB implements Program, ChangeM
|
|||
changed = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.listing.Program#getCreationDate()
|
||||
*/
|
||||
@Override
|
||||
public Date getCreationDate() {
|
||||
Options pl = getOptions(PROGRAM_INFO);
|
||||
return pl.getDate(Program.DATE_CREATED, new Date(0));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.listing.Program#getDefaultStoredPointerSize()
|
||||
*/
|
||||
@Override
|
||||
public int getDefaultPointerSize() {
|
||||
return compilerSpec.getDataOrganization().getPointerSize();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.listing.Program#getLanguageID()
|
||||
*/
|
||||
@Override
|
||||
public LanguageID getLanguageID() {
|
||||
return languageID;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.listing.Program#getLanguage()
|
||||
*/
|
||||
@Override
|
||||
public Language getLanguage() {
|
||||
return language;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.listing.Program#getCompilerSpec()
|
||||
*/
|
||||
@Override
|
||||
public CompilerSpec getCompilerSpec() {
|
||||
return compilerSpec;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.listing.Program#getUsrPropertyManager()
|
||||
*/
|
||||
@Override
|
||||
public PropertyMapManager getUsrPropertyManager() {
|
||||
return (PropertyMapManager) managers[PROPERTY_MGR];
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.listing.Program#getProgramContext()
|
||||
*/
|
||||
@Override
|
||||
public ProgramContext getProgramContext() {
|
||||
return (ProgramContext) managers[CONTEXT_MGR];
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.listing.Program#getMinAddress()
|
||||
*/
|
||||
@Override
|
||||
public Address getMinAddress() {
|
||||
return memoryManager.getMinAddress();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.listing.Program#getMaxAddress()
|
||||
*/
|
||||
@Override
|
||||
public Address getMaxAddress() {
|
||||
return memoryManager.getMaxAddress();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.listing.Program#getChanges()
|
||||
*/
|
||||
@Override
|
||||
public ProgramChangeSet getChanges() {
|
||||
return (ProgramChangeSet) changeSet;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.listing.Program#getAddressFactory()
|
||||
*/
|
||||
@Override
|
||||
public AddressFactory getAddressFactory() {
|
||||
return addressFactory;
|
||||
|
@ -872,9 +772,6 @@ public class ProgramDB extends DomainObjectAdapterDB implements Program, ChangeM
|
|||
return addrMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.listing.Program#parseAddress(java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
public Address[] parseAddress(String addrStr) {
|
||||
return parseAddress(addrStr, true);
|
||||
|
@ -1365,15 +1262,11 @@ public class ProgramDB extends DomainObjectAdapterDB implements Program, ChangeM
|
|||
* @param propertyName
|
||||
* @param oldValue
|
||||
* @param newValue
|
||||
* @return true if change is OK, false value should be reverted
|
||||
*/
|
||||
protected void userDataChanged(String propertyName, Object oldValue, Object newValue) {
|
||||
fireEvent(new UserDataChangeRecord(propertyName, name, name));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.framework.model.DomainObject#setName(java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
public void setName(String newName) {
|
||||
lock.acquire();
|
||||
|
@ -1486,17 +1379,11 @@ public class ProgramDB extends DomainObjectAdapterDB implements Program, ChangeM
|
|||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.listing.Program#getImageBase()
|
||||
*/
|
||||
@Override
|
||||
public Address getImageBase() {
|
||||
return addrMap.getImageBase();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.listing.Program#setImageBase(ghidra.program.model.address.Address, boolean)
|
||||
*/
|
||||
@Override
|
||||
public void setImageBase(Address base, boolean commit)
|
||||
throws AddressOverflowException, LockException, IllegalStateException {
|
||||
|
@ -1578,9 +1465,6 @@ public class ProgramDB extends DomainObjectAdapterDB implements Program, ChangeM
|
|||
flushEvents();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.listing.Program#restoreImageBase()
|
||||
*/
|
||||
@Override
|
||||
public void restoreImageBase() {
|
||||
if (!imageBaseOverride) {
|
||||
|
@ -1600,9 +1484,6 @@ public class ProgramDB extends DomainObjectAdapterDB implements Program, ChangeM
|
|||
flushEvents();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.framework.model.DomainObject#getDescription()
|
||||
*/
|
||||
@Override
|
||||
public String getDescription() {
|
||||
return "Program";
|
||||
|
@ -2056,9 +1937,6 @@ public class ProgramDB extends DomainObjectAdapterDB implements Program, ChangeM
|
|||
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.framework.data.DomainObjectAdapterDB#clearCache()
|
||||
*/
|
||||
@Override
|
||||
protected void clearCache(boolean all) {
|
||||
lock.acquire();
|
||||
|
@ -2082,42 +1960,27 @@ public class ProgramDB extends DomainObjectAdapterDB implements Program, ChangeM
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.listing.Program#invalidate()
|
||||
*/
|
||||
@Override
|
||||
public void invalidate() {
|
||||
clearCache(false);
|
||||
fireEvent(new DomainObjectChangeRecord(DomainObject.DO_OBJECT_RESTORED));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.framework.model.DomainObject#isChangeable()
|
||||
*/
|
||||
@Override
|
||||
public boolean isChangeable() {
|
||||
return changeable;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.listing.Program#getRegister(int, int)
|
||||
*/
|
||||
@Override
|
||||
public Register getRegister(Address addr) {
|
||||
return language.getRegister(getGlobalAddress(addr), 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.listing.Program#getRegisters(ghidra.program.model.address.Address)
|
||||
*/
|
||||
@Override
|
||||
public Register[] getRegisters(Address addr) {
|
||||
return language.getRegisters(getGlobalAddress(addr));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.listing.Program#getRegister(ghidra.program.model.address.Address, int)
|
||||
*/
|
||||
@Override
|
||||
public Register getRegister(Address addr, int size) {
|
||||
return language.getRegister(getGlobalAddress(addr), size);
|
||||
|
@ -2141,9 +2004,6 @@ public class ProgramDB extends DomainObjectAdapterDB implements Program, ChangeM
|
|||
return addr;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.listing.Program#getRegister(java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
public Register getRegister(String regName) {
|
||||
return language.getRegister(regName);
|
||||
|
@ -2238,9 +2098,6 @@ public class ProgramDB extends DomainObjectAdapterDB implements Program, ChangeM
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.listing.Program#getGlobalNamespace()
|
||||
*/
|
||||
@Override
|
||||
public Namespace getGlobalNamespace() {
|
||||
return globalNamespace;
|
||||
|
|
|
@ -57,7 +57,7 @@ class ProgramUserDataDB extends DomainObjectAdapterDB implements ProgramUserData
|
|||
* UPGRADE_REQUIRED_BFORE_VERSION should be changed to DB_VERSION any time the
|
||||
* latest version requires a forced upgrade (i.e., Read-only mode not supported
|
||||
* until upgrade is performed). It is assumed that read-only mode is supported
|
||||
* if the data's version is >= UPGRADE_REQUIRED_BEFORE_VERSION and <= DB_VERSION.
|
||||
* if the data's version is >= UPGRADE_REQUIRED_BEFORE_VERSION and <= DB_VERSION.
|
||||
*/
|
||||
private static final int UPGRADE_REQUIRED_BEFORE_VERSION = 1;
|
||||
|
||||
|
@ -231,7 +231,7 @@ class ProgramUserDataDB extends DomainObjectAdapterDB implements ProgramUserData
|
|||
* Language corresponding to languageId was found. Check language version
|
||||
* for language upgrade situation.
|
||||
* @throws LanguageNotFoundException
|
||||
* @returns VersionException if language upgrade required
|
||||
* @return VersionException if language upgrade required
|
||||
*/
|
||||
private VersionException checkLanguageVersion() throws LanguageNotFoundException {
|
||||
|
||||
|
@ -275,7 +275,7 @@ class ProgramUserDataDB extends DomainObjectAdapterDB implements ProgramUserData
|
|||
* READ_ONLY: the original database will not be modified
|
||||
* UPDATE: the database can be written to.
|
||||
* UPGRADE: the database is upgraded to the lastest schema as it is opened.
|
||||
* @returns true if language upgrade required
|
||||
* @return true if language upgrade required
|
||||
* @throws LanguageNotFoundException if a suitable replacement language not found
|
||||
*/
|
||||
private VersionException checkForLanguageChange(LanguageNotFoundException e)
|
||||
|
|
|
@ -257,7 +257,6 @@ public class BookmarkDBManager implements BookmarkManager, ErrorHandler, Manager
|
|||
* @param icon marker icon which may get scaled
|
||||
* @param color marker color
|
||||
* @return bookmark type object
|
||||
* @throws IOException if a database error occurs while adding the new type.
|
||||
*/
|
||||
@Override
|
||||
public BookmarkType defineType(String type, ImageIcon icon, Color color, int priority) {
|
||||
|
|
|
@ -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.
|
||||
|
@ -29,8 +28,7 @@ public class BookmarkTypeDBAdapterNoTable extends BookmarkTypeDBAdapter {
|
|||
private Record[] records = new Record[0];
|
||||
|
||||
/**
|
||||
* @param dbHandle
|
||||
* @param openMode
|
||||
* @param dbHandle the database handle
|
||||
*/
|
||||
public BookmarkTypeDBAdapterNoTable(DBHandle dbHandle) {
|
||||
}
|
||||
|
@ -45,9 +43,6 @@ public class BookmarkTypeDBAdapterNoTable extends BookmarkTypeDBAdapter {
|
|||
records = oldMgr.getTypeRecords();
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see ghidra.program.database.bookmark.BookmarkTypeDBAdapter#getRecords()
|
||||
*/
|
||||
@Override
|
||||
Record[] getRecords() throws IOException {
|
||||
return records;
|
||||
|
|
|
@ -397,8 +397,6 @@ public class CodeManager implements ErrorHandler, ManagerDB {
|
|||
* marked within the instructionSet causing dependent blocks to get pruned.
|
||||
* @param instructionSet the set of instructions to be added. All code unit conflicts
|
||||
* will be marked within the instructionSet and associated blocks.
|
||||
* @throws CodeUnitInsertionException if the instruction set is incompatible
|
||||
* with the program memory
|
||||
*/
|
||||
public AddressSetView addInstructions(InstructionSet instructionSet, boolean overwrite) {
|
||||
AddressSet set = new AddressSet();
|
||||
|
@ -695,7 +693,7 @@ public class CodeManager implements ErrorHandler, ManagerDB {
|
|||
* @param end the last address in the range.
|
||||
* @param monitor the TaskMonitor that tracks progress and is used to tell
|
||||
* if the user cancels the operation.
|
||||
* @throws CancelledExeption if the user cancels the operation.
|
||||
* @throws CancelledException if the user cancels the operation.
|
||||
*/
|
||||
@Override
|
||||
public void deleteAddressRange(Address start, Address end, TaskMonitor monitor)
|
||||
|
@ -720,7 +718,7 @@ public class CodeManager implements ErrorHandler, ManagerDB {
|
|||
* @param keepComments if true comment and comment history will be retained
|
||||
* @param monitor the TaskMonitor that tracks progress and is used to tell
|
||||
* if the user cancels the operation.
|
||||
* @throws CancelledExeption if the user cancels the operation.
|
||||
* @throws CancelledException if the user cancels the operation.
|
||||
*/
|
||||
private void deleteAddressRange(Address start, Address end, boolean keepComments,
|
||||
TaskMonitor monitor) throws CancelledException {
|
||||
|
@ -765,7 +763,7 @@ public class CodeManager implements ErrorHandler, ManagerDB {
|
|||
* @param length the number of addresses to move.
|
||||
* @param monitor the TaskMonitor that tracks progress and is used to tell
|
||||
* if the user cancels the operation.
|
||||
* @throws CancelledExeption if the user cancels the operation.
|
||||
* @throws CancelledException if the user cancels the operation.
|
||||
*/
|
||||
@Override
|
||||
public void moveAddressRange(Address fromAddr, Address toAddr, long length, TaskMonitor monitor)
|
||||
|
@ -996,9 +994,9 @@ public class CodeManager implements ErrorHandler, ManagerDB {
|
|||
* Returns the code unit whose min address is less than
|
||||
* or equal to the specified address and whose max address
|
||||
* is greater than or equal to the specified address.
|
||||
* <pre>
|
||||
* <pre>{@literal
|
||||
* codeunit.minAddress() <= addr <= codeunit.maxAddress()
|
||||
* </pre>
|
||||
* }</pre>
|
||||
*
|
||||
* @param address the address for which to find the code containing it.
|
||||
*
|
||||
|
@ -1249,8 +1247,9 @@ public class CodeManager implements ErrorHandler, ManagerDB {
|
|||
}
|
||||
|
||||
/**
|
||||
* Get a forward iterator over addresses that have comments of any type.
|
||||
* @param set address set
|
||||
* Get an iterator over addresses that have comments of any type.
|
||||
* @param addrSet address set containing the comment addresses to iterate over.
|
||||
* @param forward true to iterate in the direction of increasing addresses.
|
||||
*/
|
||||
public AddressIterator getCommentAddressIterator(AddressSetView addrSet, boolean forward) {
|
||||
try {
|
||||
|
@ -1392,9 +1391,9 @@ public class CodeManager implements ErrorHandler, ManagerDB {
|
|||
* Returns the instruction whose min address is less than
|
||||
* or equal to the specified address and whose max address
|
||||
* is greater than or equal to the specified address.
|
||||
* <pre>
|
||||
* <pre>{@literal
|
||||
* instruction.minAddress() <= addr <= instruction.maxAddress()
|
||||
* </pre>
|
||||
* }</pre>
|
||||
*
|
||||
* @param address the address to be contained
|
||||
*
|
||||
|
@ -1520,9 +1519,9 @@ public class CodeManager implements ErrorHandler, ManagerDB {
|
|||
* Returns the data whose min address is less than
|
||||
* or equal to the specified address and whose max address
|
||||
* is greater than or equal to the specified address.
|
||||
* <pre>
|
||||
* <pre>{@literal
|
||||
* data.minAddress() <= addr <= data.maxAddress()
|
||||
* </pre>
|
||||
* }</pre>
|
||||
*
|
||||
* @param addr the address to be contained
|
||||
*
|
||||
|
@ -1591,9 +1590,9 @@ public class CodeManager implements ErrorHandler, ManagerDB {
|
|||
* Returns the defined data whose min address is less than
|
||||
* or equal to the specified address and whose max address
|
||||
* is greater than or equal to the specified address.
|
||||
* <pre>
|
||||
* <pre>{@literal
|
||||
* data.minAddress() <= addr <= data.maxAddress()
|
||||
* </pre>
|
||||
* }</pre>
|
||||
*
|
||||
* @param addr the address to be contained
|
||||
*
|
||||
|
@ -1855,10 +1854,10 @@ public class CodeManager implements ErrorHandler, ManagerDB {
|
|||
|
||||
/**
|
||||
* Returns the next undefined data whose min address falls within the address set
|
||||
* searching in the forward direction (e.g., 0 -> 0xfff).
|
||||
*
|
||||
* @param addrSet the address Set to look within
|
||||
* searching in the forward direction {@code (e.g., 0 -> 0xfff).}
|
||||
*
|
||||
* @param set the address set to look within.
|
||||
* @param monitor the current monitor.
|
||||
* @return Data the first undefined data within the address set, or null if there is none.
|
||||
*/
|
||||
public Data getFirstUndefinedData(AddressSetView set, TaskMonitor monitor) {
|
||||
|
@ -2561,7 +2560,6 @@ public class CodeManager implements ErrorHandler, ManagerDB {
|
|||
* Check if any instruction intersects the specified address range
|
||||
* @param start start of range
|
||||
* @param end end of range
|
||||
* @return true if instruction intersected with range
|
||||
*/
|
||||
public void checkContextWrite(Address start, Address end) throws ContextChangeException {
|
||||
lock.acquire();
|
||||
|
@ -3529,12 +3527,10 @@ public class CodeManager implements ErrorHandler, ManagerDB {
|
|||
* Instructions which fail to redisassemble will be marked - since only one byte will be skipped, such bad
|
||||
* instruction disassembly may cause subsequent errors due to possible instruction shift.
|
||||
* This method is only intended for use by the ProgramDB setLanguage method.
|
||||
* @param lang new language
|
||||
* @param bookmarkLimit maximum number of errors to bookmark
|
||||
* @param monitor task monitor
|
||||
* @throws IOException
|
||||
* @throws CancelledException
|
||||
* @throws LockException
|
||||
* @throws CancelledException if the operation is canceled.
|
||||
*/
|
||||
public void reDisassembleAllInstructions(int bookmarkLimit, TaskMonitor monitor)
|
||||
throws IOException, CancelledException {
|
||||
|
|
|
@ -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,17 +42,11 @@ public class CommentTypeFilterAddressIterator implements AddressIterator {
|
|||
this.commentType = commentType;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see java.util.Iterator#remove()
|
||||
*/
|
||||
@Override
|
||||
public void remove() {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.listing.AddressIterator#hasNext()
|
||||
*/
|
||||
@Override
|
||||
public boolean hasNext() {
|
||||
if (nextAddr == null) {
|
||||
|
@ -62,9 +55,6 @@ public class CommentTypeFilterAddressIterator implements AddressIterator {
|
|||
return nextAddr != null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.listing.AddressIterator#next()
|
||||
*/
|
||||
@Override
|
||||
public Address next() {
|
||||
if (hasNext()) {
|
||||
|
|
|
@ -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,9 @@
|
|||
*/
|
||||
package ghidra.program.database.code;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import db.*;
|
||||
import ghidra.program.database.map.AddressKeyIterator;
|
||||
import ghidra.program.database.map.AddressMap;
|
||||
import ghidra.program.model.address.Address;
|
||||
|
@ -25,14 +27,10 @@ import ghidra.util.exception.CancelledException;
|
|||
import ghidra.util.exception.VersionException;
|
||||
import ghidra.util.task.TaskMonitor;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import db.*;
|
||||
|
||||
/**
|
||||
* Adapter to access the comments table for code units. The primary key
|
||||
* for the table is the address. The record contains all of the comment
|
||||
* types: Pre, Post, EOL, Plate, & Repeatable.
|
||||
* types: Pre, Post, EOL, Plate, and Repeatable.
|
||||
*/
|
||||
abstract class CommentsDBAdapter {
|
||||
|
||||
|
|
|
@ -59,7 +59,7 @@ public class InstructionDB extends CodeUnitDB implements Instruction, Instructio
|
|||
* @param address min address of this instruction
|
||||
* @param addr database key
|
||||
* @param proto instruction prototype
|
||||
* @param protoID ID for the prototype
|
||||
* @param flags flow override flags
|
||||
*/
|
||||
public InstructionDB(CodeManager codeMgr, DBObjectCache<? extends CodeUnitDB> cache,
|
||||
Address address, long addr, InstructionPrototype proto, byte flags) {
|
||||
|
|
|
@ -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.
|
||||
|
@ -25,7 +24,7 @@ import db.*;
|
|||
/**
|
||||
*
|
||||
* To change the template for this generated type comment go to
|
||||
* Window>Preferences>Java>Code Generation>Code and Comments
|
||||
* {@literal Window>Preferences>Java>Code Generation>Code and Comments}
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
|
|
@ -249,8 +249,10 @@ abstract public class DataTypeManagerDB implements DataTypeManager {
|
|||
* Constructor
|
||||
* @param handle database handle
|
||||
* @param addrMap map to convert addresses to longs and longs to addresses
|
||||
* @param createTables true if tables should be created
|
||||
* @param rootCategoryName name of the root category
|
||||
* @param openMode mode to open the DataTypeManager in
|
||||
* @param errHandler the error handler
|
||||
* @param lock database lock
|
||||
* @param monitor the current task monitor
|
||||
*/
|
||||
protected DataTypeManagerDB(DBHandle handle, AddressMap addrMap, int openMode,
|
||||
ErrorHandler errHandler, Lock lock, TaskMonitor monitor)
|
||||
|
@ -883,7 +885,6 @@ abstract public class DataTypeManagerDB implements DataTypeManager {
|
|||
/**
|
||||
* This method gets a ".conflict" name that is not currently used by any data types
|
||||
* in the indicated category of the data type manager.
|
||||
* @param dtm the data type manager.
|
||||
* @param path the category path of the category where the new data type live in the data type manager.
|
||||
* @param name The name of the data type. This name may or may not contain ".conflict" as part of it.
|
||||
* If the name contains ".conflict", only the part of the name that comes prior to the ".conflict"
|
||||
|
@ -1167,9 +1168,9 @@ abstract public class DataTypeManagerDB implements DataTypeManager {
|
|||
* Replace one source archive (oldDTM) with another (newDTM). Any data types whose source
|
||||
* was the oldDTM will be changed to have a source that is the newDTM. The oldDTM will no
|
||||
* longer be referenced as a source by this data type manager.
|
||||
* @param oldDTM data type manager for the old source archive
|
||||
* @param newDTM data type manager for the new source archive
|
||||
* @throws InvalidInputException if the oldDTM isn't currently a source archive for this
|
||||
* @param oldSourceArchive data type manager for the old source archive
|
||||
* @param newSourceArchive data type manager for the new source archive
|
||||
* @throws IllegalArgumentException if the oldDTM isn't currently a source archive for this
|
||||
* data type manager or if the old and new source archives already have the same unique ID.
|
||||
*/
|
||||
public void replaceSourceArchive(SourceArchive oldSourceArchive,
|
||||
|
|
|
@ -242,7 +242,7 @@ public class DataTypeUtilities {
|
|||
* away pointers and arrays only. A null will be returned for a
|
||||
* default pointer.
|
||||
*
|
||||
* @param baseDataType the data type whose base data type is to be determined.
|
||||
* @param dt the data type whose base data type is to be determined.
|
||||
* @return the base data type.
|
||||
*/
|
||||
public static DataType getBaseDataType(DataType dt) {
|
||||
|
@ -376,7 +376,6 @@ public class DataTypeUtilities {
|
|||
* NOTE: name parsing assumes :: delimiter and can be thrown off if name include template
|
||||
* information which could contain namespaces.
|
||||
* @param dataTypeManager data type manager
|
||||
* @param namespace namespace associated with dtName (null indicates no namespace constraint)
|
||||
* @param dtNameWithNamespace name of data type qualified with namespace (e.g., ns1::ns2::dtname)
|
||||
* @param classConstraint optional data type interface constraint (e.g., Structure), or null
|
||||
* @return best matching data type
|
||||
|
|
|
@ -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.
|
||||
|
@ -25,7 +24,7 @@ import db.*;
|
|||
/**
|
||||
*
|
||||
* To change the template for this generated type comment go to
|
||||
* Window>Preferences>Java>Code Generation>Code and Comments
|
||||
* {@literal Window>Preferences>Java>Code Generation>Code and Comments}
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
|
|
@ -275,7 +275,7 @@ public class FunctionManagerDB implements ManagerDB, FunctionManager {
|
|||
* @param name
|
||||
* @param nameSpace
|
||||
* @param extData3 internal symbol-data-3 string (see {@link ExternalLocationDB})
|
||||
* @param sourceType the source of this external.
|
||||
* @param source the source of this external.
|
||||
* @return external function
|
||||
* @throws InvalidInputException
|
||||
* @throws DuplicateNameException
|
||||
|
|
|
@ -182,12 +182,10 @@ public class FunctionTagManagerDB implements FunctionTagManager, ErrorHandler {
|
|||
invalidateFunctions();
|
||||
}
|
||||
|
||||
/**
|
||||
/* (non-Javadoc)
|
||||
* TODO: Be a bit smarter about this - if the cache contains all the tags in
|
||||
* the db we can just return the cache itself. If not, then go to the
|
||||
* db to get the remainder.
|
||||
* @return
|
||||
* @throws IOException
|
||||
*/
|
||||
@Override
|
||||
public List<? extends FunctionTag> getAllFunctionTags() {
|
||||
|
|
|
@ -59,9 +59,6 @@ public class ReturnParameterDB extends ParameterDB {
|
|||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.database.function.model.Parameter#getOrdinal()
|
||||
*/
|
||||
@Override
|
||||
public final int getOrdinal() {
|
||||
return RETURN_ORIDINAL;
|
||||
|
|
|
@ -215,7 +215,7 @@ public class AddressMapDB implements AddressMap {
|
|||
/**
|
||||
* Notification when the memory map changes. If we are segemented, we need to update our
|
||||
* list of address ranges used for address normalization.
|
||||
* @param memory
|
||||
* @param mem the changed memory map.
|
||||
*/
|
||||
public synchronized void memoryMapChanged(MemoryMapDB mem) {
|
||||
if (!(addrFactory.getDefaultAddressSpace() instanceof SegmentedAddressSpace)) {
|
||||
|
@ -269,17 +269,11 @@ public class AddressMapDB implements AddressMap {
|
|||
return useOldAddrMap ? this : oldAddrMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.database.map.AddressMap#isUpgraded()
|
||||
*/
|
||||
@Override
|
||||
public boolean isUpgraded() {
|
||||
return getOldAddressMap() != this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.database.map.AddressMap#getKey(ghidra.program.model.address.Address, boolean)
|
||||
*/
|
||||
@Override
|
||||
public synchronized long getKey(Address addr, boolean create) {
|
||||
if (useOldAddrMap) {
|
||||
|
@ -308,9 +302,6 @@ public class AddressMapDB implements AddressMap {
|
|||
return offset;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.database.map.AddressMap#getAbsoluteEncoding(ghidra.program.model.address.Address, boolean)
|
||||
*/
|
||||
@Override
|
||||
public synchronized long getAbsoluteEncoding(Address addr, boolean create) {
|
||||
if (useOldAddrMap) {
|
||||
|
@ -479,9 +470,6 @@ public class AddressMapDB implements AddressMap {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.address.AddressMap#decodeAddress(long)
|
||||
*/
|
||||
@Override
|
||||
public synchronized Address decodeAddress(long value) {
|
||||
return decodeAddress(value, true);
|
||||
|
@ -708,17 +696,11 @@ public class AddressMapDB implements AddressMap {
|
|||
throw new IllegalArgumentException("Address can not be encoded");
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.address.AddressMap#getAddressFactory()
|
||||
*/
|
||||
@Override
|
||||
public AddressFactory getAddressFactory() {
|
||||
return addrFactory;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.database.map.AddressMap#setImageBase(ghidra.program.model.address.Address)
|
||||
*/
|
||||
@Override
|
||||
public void setImageBase(Address base) {
|
||||
if (useOldAddrMap) {
|
||||
|
@ -733,18 +715,11 @@ public class AddressMapDB implements AddressMap {
|
|||
baseImageOffset = base.getOffset();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.database.map.AddressMap#getModCount()
|
||||
*/
|
||||
@Override
|
||||
public synchronized int getModCount() {
|
||||
return baseAddrs.length;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see ghidra.program.model.address.AddressMap#findKeyRange(java.util.List, ghidra.program.model.address.Address)
|
||||
*/
|
||||
@Override
|
||||
public int findKeyRange(List<KeyRange> keyRangeList, Address addr) {
|
||||
// TODO: Will not handle mixed list of relative and absolute key ranges
|
||||
|
@ -754,25 +729,16 @@ public class AddressMapDB implements AddressMap {
|
|||
return Collections.binarySearch(keyRangeList, addr, addressInsertionKeyRangeComparator);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.database.map.AddressMap#getKeyRanges(ghidra.program.model.address.Address, ghidra.program.model.address.Address, boolean)
|
||||
*/
|
||||
@Override
|
||||
public List<KeyRange> getKeyRanges(Address start, Address end, boolean create) {
|
||||
return getKeyRanges(start, end, false, create);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.database.map.AddressMap#getKeyRanges(ghidra.program.model.address.AddressSetView, boolean)
|
||||
*/
|
||||
@Override
|
||||
public List<KeyRange> getKeyRanges(AddressSetView set, boolean create) {
|
||||
return getKeyRanges(set, false, create);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.database.map.AddressMap#getKeyRanges(ghidra.program.model.address.Address, ghidra.program.model.address.Address, boolean, boolean)
|
||||
*/
|
||||
@Override
|
||||
public synchronized List<KeyRange> getKeyRanges(Address start, Address end, boolean absolute,
|
||||
boolean create) {
|
||||
|
@ -797,9 +763,6 @@ public class AddressMapDB implements AddressMap {
|
|||
return fullSet;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.database.map.AddressMap#getKeyRanges(ghidra.program.model.address.AddressSetView, boolean, boolean)
|
||||
*/
|
||||
@Override
|
||||
public synchronized List<KeyRange> getKeyRanges(AddressSetView set, boolean absolute,
|
||||
boolean create) {
|
||||
|
@ -953,9 +916,6 @@ public class AddressMapDB implements AddressMap {
|
|||
return addr;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.database.map.AddressMap#getImageBase()
|
||||
*/
|
||||
@Override
|
||||
public Address getImageBase() {
|
||||
if (defaultAddrSpace instanceof SegmentedAddressSpace) {
|
||||
|
|
|
@ -111,17 +111,11 @@ public class MemoryMapDB implements Memory, ManagerDB, LiveMemoryListener {
|
|||
this.fileBytesAdapter = bytesAdapter;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.mem.Memory#getProgram()
|
||||
*/
|
||||
@Override
|
||||
public Program getProgram() {
|
||||
return program;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.database.ManagerDB#invalidateCache(boolean)
|
||||
*/
|
||||
@Override
|
||||
public void invalidateCache(boolean all) throws IOException {
|
||||
lock.acquire();
|
||||
|
@ -210,9 +204,6 @@ public class MemoryMapDB implements Memory, ManagerDB, LiveMemoryListener {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.database.ManagerDB#programReady(int, int, ghidra.util.task.TaskMonitor)
|
||||
*/
|
||||
@Override
|
||||
public void programReady(int openMode, int currentRevision, TaskMonitor monitor)
|
||||
throws IOException, CancelledException {
|
||||
|
@ -254,9 +245,6 @@ public class MemoryMapDB implements Memory, ManagerDB, LiveMemoryListener {
|
|||
return new AddressSetViewAdapter(allInitializedAddrSet);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.mem.Memory#getLoadedAndInitializedAddressSet()
|
||||
*/
|
||||
@Override
|
||||
public AddressSetView getLoadedAndInitializedAddressSet() {
|
||||
if (liveMemory != null) {
|
||||
|
@ -297,17 +285,11 @@ public class MemoryMapDB implements Memory, ManagerDB, LiveMemoryListener {
|
|||
return potentialOverlappingBlocks;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.mem.Memory#getBlock(ghidra.program.model.address.Address)
|
||||
*/
|
||||
@Override
|
||||
public MemoryBlock getBlock(Address addr) {
|
||||
return getBlockDB(addr);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.mem.Memory#getBlock(java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
public synchronized MemoryBlock getBlock(String blockName) {
|
||||
// find block that might have been cached from previous call
|
||||
|
@ -445,9 +427,6 @@ public class MemoryMapDB implements Memory, ManagerDB, LiveMemoryListener {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.mem.Memory#getLiveMemoryHandler()
|
||||
*/
|
||||
@Override
|
||||
public LiveMemoryHandler getLiveMemoryHandler() {
|
||||
return liveMemory;
|
||||
|
@ -721,17 +700,11 @@ public class MemoryMapDB implements Memory, ManagerDB, LiveMemoryListener {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.mem.Memory#getSize()
|
||||
*/
|
||||
@Override
|
||||
public long getSize() {
|
||||
return addrSet.getNumAddresses();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.mem.Memory#getBlocks()
|
||||
*/
|
||||
@Override
|
||||
public MemoryBlock[] getBlocks() {
|
||||
lock.acquire();
|
||||
|
@ -1119,7 +1092,7 @@ public class MemoryMapDB implements Memory, ManagerDB, LiveMemoryListener {
|
|||
* The test will be something like
|
||||
*
|
||||
* for(int i=0;i<bytes.length;i++) {
|
||||
* if (bytes[i] != memory.getByte(addr+i) & masks[i]) {
|
||||
* if (bytes[i] != memory.getByte(addr+i) & masks[i]) {
|
||||
* return false;
|
||||
* }
|
||||
* }
|
||||
|
@ -1206,9 +1179,6 @@ public class MemoryMapDB implements Memory, ManagerDB, LiveMemoryListener {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.mem.Memory#getByte(ghidra.program.model.address.Address)
|
||||
*/
|
||||
@Override
|
||||
public byte getByte(Address addr) throws MemoryAccessException {
|
||||
lock.acquire();
|
||||
|
@ -1267,9 +1237,6 @@ public class MemoryMapDB implements Memory, ManagerDB, LiveMemoryListener {
|
|||
return numRead;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.mem.Memory#getShort(ghidra.program.model.address.Address)
|
||||
*/
|
||||
@Override
|
||||
public short getShort(Address addr) throws MemoryAccessException {
|
||||
byte[] byteBuf = new byte[2];
|
||||
|
@ -1337,9 +1304,6 @@ public class MemoryMapDB implements Memory, ManagerDB, LiveMemoryListener {
|
|||
return n;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.mem.Memory#getInt(ghidra.program.model.address.Address)
|
||||
*/
|
||||
@Override
|
||||
public int getInt(Address addr) throws MemoryAccessException {
|
||||
byte[] byteBuf = new byte[4];
|
||||
|
@ -1350,9 +1314,6 @@ public class MemoryMapDB implements Memory, ManagerDB, LiveMemoryListener {
|
|||
return defaultEndian.getInt(byteBuf);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.mem.Memory#getInt(ghidra.program.model.address.Address, boolean)
|
||||
*/
|
||||
@Override
|
||||
public int getInt(Address addr, boolean isBigEndian) throws MemoryAccessException {
|
||||
byte[] byteBuf = new byte[4];
|
||||
|
@ -1366,9 +1327,6 @@ public class MemoryMapDB implements Memory, ManagerDB, LiveMemoryListener {
|
|||
return LITTLE_ENDIAN.getInt(byteBuf);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.mem.Memory#getInts(ghidra.program.model.address.Address, int[])
|
||||
*/
|
||||
@Override
|
||||
public int getInts(Address addr, int[] dest) throws MemoryAccessException {
|
||||
return getInts(addr, dest, 0, dest.length);
|
||||
|
@ -1413,9 +1371,6 @@ public class MemoryMapDB implements Memory, ManagerDB, LiveMemoryListener {
|
|||
return n;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.mem.Memory#getLong(ghidra.program.model.address.Address)
|
||||
*/
|
||||
@Override
|
||||
public long getLong(Address addr) throws MemoryAccessException {
|
||||
byte[] byteBuf = new byte[8];
|
||||
|
@ -1426,9 +1381,6 @@ public class MemoryMapDB implements Memory, ManagerDB, LiveMemoryListener {
|
|||
return defaultEndian.getLong(byteBuf);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.mem.Memory#getLong(ghidra.program.model.address.Address, boolean)
|
||||
*/
|
||||
@Override
|
||||
public long getLong(Address addr, boolean isBigEndian) throws MemoryAccessException {
|
||||
byte[] byteBuf = new byte[8];
|
||||
|
@ -1442,9 +1394,6 @@ public class MemoryMapDB implements Memory, ManagerDB, LiveMemoryListener {
|
|||
return LITTLE_ENDIAN.getLong(byteBuf);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.mem.Memory#getLongs(ghidra.program.model.address.Address, long[])
|
||||
*/
|
||||
@Override
|
||||
public int getLongs(Address addr, long[] dest) throws MemoryAccessException {
|
||||
return getLongs(addr, dest, 0, dest.length);
|
||||
|
@ -1489,9 +1438,6 @@ public class MemoryMapDB implements Memory, ManagerDB, LiveMemoryListener {
|
|||
return n;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.mem.Memory#setByte(ghidra.program.model.address.Address, byte)
|
||||
*/
|
||||
@Override
|
||||
public void setByte(Address addr, byte value) throws MemoryAccessException {
|
||||
if (liveMemory != null) {
|
||||
|
@ -1515,9 +1461,6 @@ public class MemoryMapDB implements Memory, ManagerDB, LiveMemoryListener {
|
|||
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.mem.Memory#setBytes(ghidra.program.model.address.Address, byte[])
|
||||
*/
|
||||
@Override
|
||||
public void setBytes(Address addr, byte[] source) throws MemoryAccessException {
|
||||
setBytes(addr, source, 0, source.length);
|
||||
|
@ -1576,9 +1519,6 @@ public class MemoryMapDB implements Memory, ManagerDB, LiveMemoryListener {
|
|||
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.mem.Memory#setShort(ghidra.program.model.address.Address, short)
|
||||
*/
|
||||
@Override
|
||||
public void setShort(Address addr, short value) throws MemoryAccessException {
|
||||
byte[] byteBuf = new byte[2];
|
||||
|
@ -1599,9 +1539,6 @@ public class MemoryMapDB implements Memory, ManagerDB, LiveMemoryListener {
|
|||
setBytes(addr, byteBuf, 0, 2);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.mem.Memory#setInt(ghidra.program.model.address.Address, int)
|
||||
*/
|
||||
@Override
|
||||
public void setInt(Address addr, int value) throws MemoryAccessException {
|
||||
byte[] byteBuf = new byte[4];
|
||||
|
@ -1621,9 +1558,6 @@ public class MemoryMapDB implements Memory, ManagerDB, LiveMemoryListener {
|
|||
setBytes(addr, byteBuf, 0, 4);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.mem.Memory#setLong(ghidra.program.model.address.Address, long)
|
||||
*/
|
||||
@Override
|
||||
public void setLong(Address addr, long value) throws MemoryAccessException {
|
||||
byte[] byteBuf = new byte[8];
|
||||
|
@ -1631,9 +1565,6 @@ public class MemoryMapDB implements Memory, ManagerDB, LiveMemoryListener {
|
|||
setBytes(addr, byteBuf, 0, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.mem.Memory#setLong(ghidra.program.model.address.Address, long, boolean)
|
||||
*/
|
||||
@Override
|
||||
public void setLong(Address addr, long value, boolean isBigEndian)
|
||||
throws MemoryAccessException {
|
||||
|
@ -1647,9 +1578,6 @@ public class MemoryMapDB implements Memory, ManagerDB, LiveMemoryListener {
|
|||
setBytes(addr, byteBuf, 0, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.address.AddressSetView#contains(ghidra.program.model.address.Address)
|
||||
*/
|
||||
@Override
|
||||
public boolean contains(Address addr) {
|
||||
return addrSet.contains(addr);
|
||||
|
@ -1665,41 +1593,26 @@ public class MemoryMapDB implements Memory, ManagerDB, LiveMemoryListener {
|
|||
return addrSet.contains(set);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.address.AddressSetView#isEmpty()
|
||||
*/
|
||||
@Override
|
||||
public boolean isEmpty() {
|
||||
return addrSet.isEmpty();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.address.AddressSetView#getMinAddress()
|
||||
*/
|
||||
@Override
|
||||
public Address getMinAddress() {
|
||||
return addrSet.getMinAddress();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.address.AddressSetView#getMaxAddress()
|
||||
*/
|
||||
@Override
|
||||
public Address getMaxAddress() {
|
||||
return addrSet.getMaxAddress();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.address.AddressSetView#getNumAddressRanges()
|
||||
*/
|
||||
@Override
|
||||
public int getNumAddressRanges() {
|
||||
return addrSet.getNumAddressRanges();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.address.AddressSetView#getAddressRanges()
|
||||
*/
|
||||
@Override
|
||||
public AddressRangeIterator getAddressRanges() {
|
||||
return addrSet.getAddressRanges();
|
||||
|
@ -1710,25 +1623,16 @@ public class MemoryMapDB implements Memory, ManagerDB, LiveMemoryListener {
|
|||
return getAddressRanges();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.address.AddressSetView#getAddressRanges(boolean)
|
||||
*/
|
||||
@Override
|
||||
public AddressRangeIterator getAddressRanges(boolean startAtFront) {
|
||||
return addrSet.getAddressRanges(startAtFront);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.address.AddressSetView#getNumAddresses()
|
||||
*/
|
||||
@Override
|
||||
public long getNumAddresses() {
|
||||
return addrSet.getNumAddresses();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.address.AddressSetView#getAddresses(boolean)
|
||||
*/
|
||||
@Override
|
||||
public AddressIterator getAddresses(boolean forward) {
|
||||
return addrSet.getAddresses(forward);
|
||||
|
@ -1920,9 +1824,6 @@ public class MemoryMapDB implements Memory, ManagerDB, LiveMemoryListener {
|
|||
// never do anything here!!!
|
||||
}
|
||||
|
||||
/**
|
||||
* @see java.lang.Object#toString()
|
||||
*/
|
||||
@Override
|
||||
public final String toString() {
|
||||
lock.acquire();
|
||||
|
@ -1973,9 +1874,6 @@ public class MemoryMapDB implements Memory, ManagerDB, LiveMemoryListener {
|
|||
return super.hashCode();
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see ghidra.program.model.mem.Memory#getExecuteSet()
|
||||
*/
|
||||
@Override
|
||||
public AddressSetView getExecuteSet() {
|
||||
AddressSetView set = executeSet;
|
||||
|
|
|
@ -486,8 +486,12 @@ public class TreeManager implements ManagerDB {
|
|||
|
||||
/**
|
||||
* Move a memory block to new place.
|
||||
* @param fromRange old place
|
||||
* @param toRange new place
|
||||
* @param fromAddr old place
|
||||
* @param toAddr new place
|
||||
* @param length the length of the address range to move
|
||||
* @param monitor the current task monitor
|
||||
* @throws AddressOverflowException if an address overflow occurs.
|
||||
* @throws CancelledException if the task is cancelled.
|
||||
*/
|
||||
@Override
|
||||
public void moveAddressRange(Address fromAddr, Address toAddr, long length, TaskMonitor monitor)
|
||||
|
@ -685,7 +689,7 @@ public class TreeManager implements ManagerDB {
|
|||
|
||||
/**
|
||||
* Get the root module for the tree that has the given ID.
|
||||
* @param ID of the tree
|
||||
* @param treeID ID of the tree
|
||||
* @return root module
|
||||
*/
|
||||
public ProgramModule getRootModule(long treeID) {
|
||||
|
|
|
@ -58,7 +58,6 @@ public class OldFunctionManager implements ErrorHandler {
|
|||
* @param errHandler the error handler
|
||||
* @param addrMap the address map
|
||||
* @throws VersionException if function manager's version does not match its expected version
|
||||
* @throws IOException if an i/o error occurs
|
||||
*/
|
||||
public OldFunctionManager(DBHandle dbHandle, ErrorHandler errHandler, AddressMap addrMap)
|
||||
throws VersionException {
|
||||
|
|
|
@ -246,9 +246,6 @@ public class ObjectPropertyMapDB extends PropertyMapDB implements ObjectProperty
|
|||
return allRecordsUpgraded;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.util.ObjectPropertyMap#add(ghidra.program.model.address.Address, ghidra.util.Saveable)
|
||||
*/
|
||||
@Override
|
||||
public void add(Address addr, Saveable value) {
|
||||
lock.acquire();
|
||||
|
@ -318,17 +315,11 @@ public class ObjectPropertyMapDB extends PropertyMapDB implements ObjectProperty
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.util.ObjectPropertyMap#getObjectClass()
|
||||
*/
|
||||
@Override
|
||||
public Class<?> getObjectClass() {
|
||||
return saveableObjectClass;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.util.ObjectPropertyMap#getObject(ghidra.program.model.address.Address)
|
||||
*/
|
||||
@Override
|
||||
public Object getObject(Address addr) {
|
||||
if (propertyTable == null) {
|
||||
|
@ -381,9 +372,6 @@ public class ObjectPropertyMapDB extends PropertyMapDB implements ObjectProperty
|
|||
return obj;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.util.PropertyMap#applyValue(ghidra.util.prop.PropertyVisitor, ghidra.program.model.address.Address)
|
||||
*/
|
||||
@Override
|
||||
public void applyValue(PropertyVisitor visitor, Address addr) {
|
||||
Saveable obj = (Saveable) getObject(addr);
|
||||
|
@ -392,9 +380,9 @@ public class ObjectPropertyMapDB extends PropertyMapDB implements ObjectProperty
|
|||
}
|
||||
}
|
||||
|
||||
// @see PropertyMapDB#getPropertyFieldClass() <- doesn't exist
|
||||
/**
|
||||
* NOTE: Custom schema is utilized.
|
||||
* @see ghidra.program.database.properties.PropertyMapDB#getPropertyFieldClass()
|
||||
*/
|
||||
protected Class<?> getPropertyFieldClass() {
|
||||
throw new AssertException();
|
||||
|
|
|
@ -474,9 +474,6 @@ public class ReferenceDBManager implements ReferenceManager, ManagerDB, ErrorHan
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.symbol.ReferenceManager#addRegisterReference(ghidra.program.model.address.Address, int, ghidra.program.model.lang.Register, ghidra.program.model.symbol.RefType, int)
|
||||
*/
|
||||
@Override
|
||||
public Reference addRegisterReference(Address fromAddr, int opIndex, Register register,
|
||||
RefType type, SourceType sourceType) {
|
||||
|
@ -494,9 +491,6 @@ public class ReferenceDBManager implements ReferenceManager, ManagerDB, ErrorHan
|
|||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.symbol.ReferenceManager#addOffsetMemReference(ghidra.program.model.address.Address, ghidra.program.model.address.Address, long, ghidra.program.model.symbol.RefType, int, int)
|
||||
*/
|
||||
@Override
|
||||
public Reference addOffsetMemReference(Address fromAddr, Address toAddr, long offset,
|
||||
RefType type, SourceType sourceType, int opIndex) {
|
||||
|
@ -513,9 +507,6 @@ public class ReferenceDBManager implements ReferenceManager, ManagerDB, ErrorHan
|
|||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.symbol.ReferenceManager#addShiftedMemReference(ghidra.program.model.address.Address, ghidra.program.model.address.Address, int, ghidra.program.model.symbol.RefType, int, int)
|
||||
*/
|
||||
@Override
|
||||
public Reference addShiftedMemReference(Address fromAddr, Address toAddr, int shiftValue,
|
||||
RefType type, SourceType sourceType, int opIndex) {
|
||||
|
@ -764,9 +755,6 @@ public class ReferenceDBManager implements ReferenceManager, ManagerDB, ErrorHan
|
|||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.symbol.ReferenceManager#setPrimary(ghidra.program.model.symbol.Reference, boolean)
|
||||
*/
|
||||
@Override
|
||||
public void setPrimary(Reference ref, boolean isPrimary) {
|
||||
lock.acquire();
|
||||
|
@ -803,9 +791,6 @@ public class ReferenceDBManager implements ReferenceManager, ManagerDB, ErrorHan
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.symbol.ReferenceManager#getReferencesFrom(ghidra.program.model.address.Address)
|
||||
*/
|
||||
@Override
|
||||
public Reference[] getReferencesFrom(Address addr) {
|
||||
lock.acquire();
|
||||
|
@ -825,9 +810,6 @@ public class ReferenceDBManager implements ReferenceManager, ManagerDB, ErrorHan
|
|||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.symbol.ReferenceManager#getFlowReferencesFrom(ghidra.program.model.address.Address)
|
||||
*/
|
||||
@Override
|
||||
public Reference[] getFlowReferencesFrom(Address addr) {
|
||||
Reference[] refs = getReferencesFrom(addr);
|
||||
|
@ -841,9 +823,6 @@ public class ReferenceDBManager implements ReferenceManager, ManagerDB, ErrorHan
|
|||
return list.toArray(refs);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.symbol.ReferenceManager#getReference(ghidra.program.model.address.Address, ghidra.program.model.address.Address, int)
|
||||
*/
|
||||
@Override
|
||||
public Reference getReference(Address fromAddr, Address toAddr, int opIndex) {
|
||||
lock.acquire();
|
||||
|
@ -870,9 +849,6 @@ public class ReferenceDBManager implements ReferenceManager, ManagerDB, ErrorHan
|
|||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.symbol.ReferenceManager#getReferenceCountFrom(ghidra.program.model.address.Address)
|
||||
*/
|
||||
@Override
|
||||
public int getReferenceCountFrom(Address fromAddr) {
|
||||
RefList fromRefs = getFromRefs(fromAddr);
|
||||
|
@ -882,9 +858,6 @@ public class ReferenceDBManager implements ReferenceManager, ManagerDB, ErrorHan
|
|||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.symbol.ReferenceManager#getReferenceCountTo(ghidra.program.model.address.Address)
|
||||
*/
|
||||
@Override
|
||||
public int getReferenceCountTo(Address toAddr) {
|
||||
if (toAddr.isStackAddress() || toAddr.isRegisterAddress()) {
|
||||
|
@ -898,17 +871,11 @@ public class ReferenceDBManager implements ReferenceManager, ManagerDB, ErrorHan
|
|||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.symbol.ReferenceManager#getReferenceDestinationCount()
|
||||
*/
|
||||
@Override
|
||||
public int getReferenceDestinationCount() {
|
||||
return toAdapter.getRecordCount();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.symbol.ReferenceManager#getReferenceSourceCount()
|
||||
*/
|
||||
@Override
|
||||
public int getReferenceSourceCount() {
|
||||
return fromAdapter.getRecordCount();
|
||||
|
@ -944,9 +911,6 @@ public class ReferenceDBManager implements ReferenceManager, ManagerDB, ErrorHan
|
|||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.symbol.ReferenceManager#getPrimaryReferenceFrom(ghidra.program.model.address.Address, int)
|
||||
*/
|
||||
@Override
|
||||
public Reference getPrimaryReferenceFrom(Address addr, int opIndex) {
|
||||
lock.acquire();
|
||||
|
@ -965,9 +929,6 @@ public class ReferenceDBManager implements ReferenceManager, ManagerDB, ErrorHan
|
|||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.symbol.ReferenceManager#getReferenceDestinationIterator(ghidra.program.model.address.Address, boolean)
|
||||
*/
|
||||
@Override
|
||||
public AddressIterator getReferenceDestinationIterator(Address startAddr, boolean forward) {
|
||||
try {
|
||||
|
@ -979,9 +940,6 @@ public class ReferenceDBManager implements ReferenceManager, ManagerDB, ErrorHan
|
|||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.symbol.ReferenceManager#getReferenceDestinationIterator(ghidra.program.model.address.AddressSetView, boolean)
|
||||
*/
|
||||
@Override
|
||||
public AddressIterator getReferenceDestinationIterator(AddressSetView addrSet,
|
||||
boolean forward) {
|
||||
|
@ -994,9 +952,6 @@ public class ReferenceDBManager implements ReferenceManager, ManagerDB, ErrorHan
|
|||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.symbol.ReferenceManager#getReferenceSourceIterator(ghidra.program.model.address.Address, boolean)
|
||||
*/
|
||||
@Override
|
||||
public AddressIterator getReferenceSourceIterator(Address startAddr, boolean forward) {
|
||||
try {
|
||||
|
@ -1008,17 +963,11 @@ public class ReferenceDBManager implements ReferenceManager, ManagerDB, ErrorHan
|
|||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.symbol.ReferenceManager#getReferenceIterator(ghidra.program.model.address.Address)
|
||||
*/
|
||||
@Override
|
||||
public ReferenceIterator getReferenceIterator(Address startAddr) {
|
||||
return new FromRefIterator(startAddr);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.symbol.ReferenceManager#getReferenceSourceIterator(ghidra.program.model.address.AddressSetView, boolean)
|
||||
*/
|
||||
@Override
|
||||
public AddressIterator getReferenceSourceIterator(AddressSetView addrSet, boolean forward) {
|
||||
try {
|
||||
|
@ -1030,9 +979,6 @@ public class ReferenceDBManager implements ReferenceManager, ManagerDB, ErrorHan
|
|||
return new EmptyAddressIterator();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.symbol.ReferenceManager#hasFlowReferencesFrom(ghidra.program.model.address.Address)
|
||||
*/
|
||||
@Override
|
||||
public boolean hasFlowReferencesFrom(Address addr) {
|
||||
lock.acquire();
|
||||
|
@ -1058,9 +1004,6 @@ public class ReferenceDBManager implements ReferenceManager, ManagerDB, ErrorHan
|
|||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.symbol.ReferenceManager#hasReferencesFrom(ghidra.program.model.address.Address)
|
||||
*/
|
||||
@Override
|
||||
public boolean hasReferencesFrom(Address fromAddr) {
|
||||
lock.acquire();
|
||||
|
@ -1084,9 +1027,6 @@ public class ReferenceDBManager implements ReferenceManager, ManagerDB, ErrorHan
|
|||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.symbol.ReferenceManager#hasReferencesFrom(ghidra.program.model.address.Address, int)
|
||||
*/
|
||||
@Override
|
||||
public boolean hasReferencesFrom(Address fromAddr, int opIndex) {
|
||||
lock.acquire();
|
||||
|
@ -1112,9 +1052,6 @@ public class ReferenceDBManager implements ReferenceManager, ManagerDB, ErrorHan
|
|||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.symbol.ReferenceManager#hasReferencesTo(ghidra.program.model.address.Address)
|
||||
*/
|
||||
@Override
|
||||
public boolean hasReferencesTo(Address toAddr) {
|
||||
if (toAddr.isStackAddress() || toAddr.isRegisterAddress()) {
|
||||
|
@ -1142,9 +1079,6 @@ public class ReferenceDBManager implements ReferenceManager, ManagerDB, ErrorHan
|
|||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.symbol.ReferenceManager#removeAllReferencesFrom(ghidra.program.model.address.Address, ghidra.program.model.address.Address)
|
||||
*/
|
||||
@Override
|
||||
public void removeAllReferencesFrom(Address beginAddr, Address endAddr) {
|
||||
try {
|
||||
|
@ -1161,9 +1095,6 @@ public class ReferenceDBManager implements ReferenceManager, ManagerDB, ErrorHan
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.symbol.ReferenceManager#removeAllReferencesFrom(ghidra.program.model.address.Address)
|
||||
*/
|
||||
@Override
|
||||
public void removeAllReferencesFrom(Address fromAddr) {
|
||||
try {
|
||||
|
@ -1263,9 +1194,6 @@ public class ReferenceDBManager implements ReferenceManager, ManagerDB, ErrorHan
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.symbol.ReferenceManager#setAssociation(ghidra.program.model.symbol.Symbol, ghidra.program.model.symbol.Reference)
|
||||
*/
|
||||
@Override
|
||||
public void setAssociation(Symbol s, Reference ref) {
|
||||
if (s.getSymbolType() != SymbolType.LABEL || s.isDynamic()) {
|
||||
|
@ -1304,9 +1232,6 @@ public class ReferenceDBManager implements ReferenceManager, ManagerDB, ErrorHan
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.symbol.ReferenceManager#removeAssociation(ghidra.program.model.symbol.Reference)
|
||||
*/
|
||||
@Override
|
||||
public void removeAssociation(Reference ref) {
|
||||
lock.acquire();
|
||||
|
@ -1323,9 +1248,6 @@ public class ReferenceDBManager implements ReferenceManager, ManagerDB, ErrorHan
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.symbol.ReferenceManager#updateRefType(ghidra.program.model.symbol.Reference, ghidra.program.model.symbol.RefType)
|
||||
*/
|
||||
@Override
|
||||
public Reference updateRefType(Reference ref, RefType refType) {
|
||||
lock.acquire();
|
||||
|
@ -1360,9 +1282,6 @@ public class ReferenceDBManager implements ReferenceManager, ManagerDB, ErrorHan
|
|||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.symbol.ReferenceManager#getReferencesTo(ghidra.program.model.address.Address)
|
||||
*/
|
||||
@Override
|
||||
public ReferenceIterator getReferencesTo(Address addr) {
|
||||
lock.acquire();
|
||||
|
@ -1385,9 +1304,6 @@ public class ReferenceDBManager implements ReferenceManager, ManagerDB, ErrorHan
|
|||
return new EmptyMemReferenceIterator();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.database.ManagerDB#invalidateCache(boolean)
|
||||
*/
|
||||
@Override
|
||||
public void invalidateCache(boolean all) {
|
||||
lock.acquire();
|
||||
|
@ -1457,17 +1373,11 @@ public class ReferenceDBManager implements ReferenceManager, ManagerDB, ErrorHan
|
|||
return refs.length;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.database.ManagerDB#deleteAddressRange(ghidra.program.model.address.Address, ghidra.program.model.address.Address, ghidra.util.task.TaskMonitor)
|
||||
*/
|
||||
@Override
|
||||
public void deleteAddressRange(Address startAddr, Address endAddr, TaskMonitor monitor) {
|
||||
removeAllReferencesFrom(startAddr, endAddr);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.database.ManagerDB#moveAddressRange(ghidra.program.model.address.Address, ghidra.program.model.address.Address, long, ghidra.util.task.TaskMonitor)
|
||||
*/
|
||||
@Override
|
||||
public void moveAddressRange(Address fromAddr, Address toAddr, long length, TaskMonitor monitor)
|
||||
throws CancelledException {
|
||||
|
@ -1826,17 +1736,11 @@ public class ReferenceDBManager implements ReferenceManager, ManagerDB, ErrorHan
|
|||
fromIter = getReferenceSourceIterator(set, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see java.util.Iterator#remove()
|
||||
*/
|
||||
@Override
|
||||
public void remove() {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.symbol.ReferenceIterator#hasNext()
|
||||
*/
|
||||
@Override
|
||||
public boolean hasNext() {
|
||||
try {
|
||||
|
@ -1862,9 +1766,6 @@ public class ReferenceDBManager implements ReferenceManager, ManagerDB, ErrorHan
|
|||
return (refIter != null);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.symbol.ReferenceIterator#next()
|
||||
*/
|
||||
@Override
|
||||
public Reference next() {
|
||||
if (hasNext()) {
|
||||
|
@ -1888,30 +1789,17 @@ public class ReferenceDBManager implements ReferenceManager, ManagerDB, ErrorHan
|
|||
this.iter = iter;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see java.util.Iterator#remove()
|
||||
*/
|
||||
@Override
|
||||
public void remove() {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see ghidra.program.model.address.AddressIterator#hasNext()
|
||||
*/
|
||||
@Override
|
||||
public boolean hasNext() {
|
||||
findNext();
|
||||
return currentAddress != null;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see ghidra.program.model.address.AddressIterator#next()
|
||||
*/
|
||||
@Override
|
||||
public Address next() {
|
||||
findNext();
|
||||
|
@ -1943,17 +1831,11 @@ public class ReferenceDBManager implements ReferenceManager, ManagerDB, ErrorHan
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @see db.util.ErrorHandler#dbError(java.io.IOException)
|
||||
*/
|
||||
@Override
|
||||
public void dbError(IOException e) {
|
||||
program.dbError(e);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.symbol.ReferenceManager#delete(ghidra.program.model.symbol.Reference)
|
||||
*/
|
||||
@Override
|
||||
public void delete(Reference ref) {
|
||||
removeReference(ref.getFromAddress(), ref.getToAddress(), ref.getOperandIndex());
|
||||
|
@ -1969,9 +1851,6 @@ public class ReferenceDBManager implements ReferenceManager, ManagerDB, ErrorHan
|
|||
// }
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.symbol.ReferenceManager#getExternalReferences()
|
||||
*/
|
||||
@Override
|
||||
public ReferenceIterator getExternalReferences() {
|
||||
AddressSet set = new AddressSet(AddressSpace.EXTERNAL_SPACE.getMinAddress(),
|
||||
|
@ -1980,9 +1859,6 @@ public class ReferenceDBManager implements ReferenceManager, ManagerDB, ErrorHan
|
|||
return new ExternalReferenceIterator(it);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.symbol.ReferenceManager#addReference(ghidra.program.model.symbol.Reference)
|
||||
*/
|
||||
@Override
|
||||
public Reference addReference(Reference ref) {
|
||||
Address from = ref.getFromAddress();
|
||||
|
@ -2029,9 +1905,6 @@ public class ReferenceDBManager implements ReferenceManager, ManagerDB, ErrorHan
|
|||
return memRef;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.symbol.ReferenceManager#getReferencesFrom(ghidra.program.model.address.Address, int)
|
||||
*/
|
||||
@Override
|
||||
public Reference[] getReferencesFrom(Address fromAddr, int opIndex) {
|
||||
Reference[] retRefs = null;
|
||||
|
@ -2072,17 +1945,11 @@ public class ReferenceDBManager implements ReferenceManager, ManagerDB, ErrorHan
|
|||
this.it = it;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.symbol.ReferenceIterator#hasNext()
|
||||
*/
|
||||
@Override
|
||||
public boolean hasNext() {
|
||||
return (refIt != null && refIt.hasNext()) || it.hasNext();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.symbol.ReferenceIterator#next()
|
||||
*/
|
||||
@Override
|
||||
public Reference next() {
|
||||
if (refIt == null || !refIt.hasNext()) {
|
||||
|
@ -2098,9 +1965,6 @@ public class ReferenceDBManager implements ReferenceManager, ManagerDB, ErrorHan
|
|||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see java.util.Iterator#remove()
|
||||
*/
|
||||
@Override
|
||||
public void remove() {
|
||||
throw new UnsupportedOperationException();
|
||||
|
|
|
@ -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.
|
||||
|
@ -65,7 +64,6 @@ public class AddressRangeObjectMap<T> {
|
|||
* @param length the number of addresses to move.
|
||||
* @param monitor the task monitor.
|
||||
* @throws CancelledException if the user canceled the operation via the task monitor.
|
||||
* @throws AddressOverflowException if the length is such that a address wrap occurs
|
||||
*/
|
||||
public void moveAddressRange(Address fromAddr, Address toAddr, long length, TaskMonitor monitor)
|
||||
throws CancelledException {
|
||||
|
|
|
@ -72,15 +72,10 @@ public class OldProgramContextDB implements ProgramContext, DefaultProgramContex
|
|||
/**
|
||||
* Constructs a new ProgramContextDB object
|
||||
* @param dbHandle the handle to the database.
|
||||
* @param openMode the mode that the program is opened.
|
||||
* @param errHandler the error handler
|
||||
* @param language the processor language
|
||||
* @param addrMap the address map.
|
||||
* @param lock the program synchronization lock
|
||||
* @param monitor the taskmonitor used if upgrading.
|
||||
* @throws VersionException thrown if the database is the save version as this class.
|
||||
* @throws CancelledException thrown if the user cancels the upgrade.
|
||||
* @throws IOException thrown if a database io error occurs.
|
||||
*/
|
||||
public OldProgramContextDB(DBHandle dbHandle, ErrorHandler errHandler, Language language,
|
||||
AddressMap addrMap, Lock lock) {
|
||||
|
|
|
@ -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.
|
||||
|
@ -56,7 +55,6 @@ public class RelocationManager implements RelocationTable, ManagerDB {
|
|||
* @param monitor the task monitor
|
||||
* @throws VersionException
|
||||
* @throws IOException
|
||||
* @throws CancelledException
|
||||
*/
|
||||
public RelocationManager(DBHandle handle, AddressMap addrMap, int openMode, Lock lock,
|
||||
TaskMonitor monitor) throws VersionException, IOException {
|
||||
|
|
|
@ -82,9 +82,6 @@ public class LibrarySymbol extends SymbolDB {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.symbol.Symbol#setSymbolData3(java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
public void setSymbolData3(String newPath) {
|
||||
String oldPath = getSymbolData3();
|
||||
|
@ -95,9 +92,6 @@ public class LibrarySymbol extends SymbolDB {
|
|||
oldPath, newPath);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.symbol.Symbol#getSymbolType()
|
||||
*/
|
||||
public SymbolType getSymbolType() {
|
||||
return SymbolType.LIBRARY;
|
||||
}
|
||||
|
@ -107,9 +101,7 @@ public class LibrarySymbol extends SymbolDB {
|
|||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.symbol.Symbol#getObject()
|
||||
*/
|
||||
@Override
|
||||
public Object getObject() {
|
||||
if (library == null) {
|
||||
library = new LibraryDB(this, symbolMgr.getProgram().getNamespaceManager());
|
||||
|
@ -117,9 +109,6 @@ public class LibrarySymbol extends SymbolDB {
|
|||
return library;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.symbol.Symbol#isPrimary()
|
||||
*/
|
||||
@Override
|
||||
public boolean isPrimary() {
|
||||
return true;
|
||||
|
@ -133,9 +122,6 @@ public class LibrarySymbol extends SymbolDB {
|
|||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.symbol.Symbol#isValidParent(ghidra.program.model.symbol.Namespace)
|
||||
*/
|
||||
@Override
|
||||
public boolean isValidParent(Namespace parent) {
|
||||
return SymbolType.LIBRARY.isValidParent(symbolMgr.getProgram(), parent, address,
|
||||
|
|
|
@ -54,9 +54,7 @@ public class NamespaceManager implements ManagerDB {
|
|||
* @param openMode the open mode
|
||||
* @param lock the program synchronization lock
|
||||
* @param monitor the task monitor.
|
||||
* @throws IOException if a database error occurs.
|
||||
* @throws VersionException if the table version is different from this adapter.
|
||||
* @throws CancelledException if the user cancels the upgrade.
|
||||
*/
|
||||
public NamespaceManager(DBHandle handle, ErrorHandler errHandler, AddressMap addrMap,
|
||||
int openMode, Lock lock, TaskMonitor monitor) throws VersionException {
|
||||
|
@ -74,9 +72,6 @@ public class NamespaceManager implements ManagerDB {
|
|||
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.database.ManagerDB#deleteAddressRange(ghidra.program.model.address.Address, ghidra.program.model.address.Address, ghidra.util.task.TaskMonitor)
|
||||
*/
|
||||
@Override
|
||||
public void deleteAddressRange(Address startAddr, Address endAddr, TaskMonitor monitor)
|
||||
throws CancelledException {
|
||||
|
@ -95,26 +90,17 @@ public class NamespaceManager implements ManagerDB {
|
|||
lastBody = null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.database.ManagerDB#invalidateCache(boolean)
|
||||
*/
|
||||
@Override
|
||||
public void invalidateCache(boolean all) throws IOException {
|
||||
clearCache();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.database.ManagerDB#setProgram(ghidra.program.database.ProgramDB)
|
||||
*/
|
||||
@Override
|
||||
public void setProgram(ProgramDB program) {
|
||||
this.symbolMgr = (SymbolManager) program.getSymbolTable();
|
||||
globalNamespace = program.getGlobalNamespace();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.database.ManagerDB#programReady(int, int, ghidra.util.task.TaskMonitor)
|
||||
*/
|
||||
@Override
|
||||
public void programReady(int openMode, int currentRevision, TaskMonitor monitor)
|
||||
throws IOException, CancelledException {
|
||||
|
@ -215,7 +201,7 @@ public class NamespaceManager implements ManagerDB {
|
|||
/**
|
||||
* Checks if an existing namespace's address set intersects with
|
||||
* the given set. If so, then it throws an OverlappingNamespaceException.
|
||||
* @throws if the address set to test overlaps a namespace body.
|
||||
* @throws OverlappingNamespaceException if the address set to test overlaps a namespace body.
|
||||
*/
|
||||
public void overlapsNamespace(AddressSetView set) throws OverlappingNamespaceException {
|
||||
AddressRangeIterator iter =
|
||||
|
@ -312,9 +298,6 @@ public class NamespaceManager implements ManagerDB {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.database.ManagerDB#moveAddressRange(ghidra.program.model.address.Address, ghidra.program.model.address.Address, long, ghidra.util.task.TaskMonitor)
|
||||
*/
|
||||
@Override
|
||||
public void moveAddressRange(Address fromAddr, Address toAddr, long length, TaskMonitor monitor)
|
||||
throws AddressOverflowException, CancelledException {
|
||||
|
|
|
@ -1325,8 +1325,8 @@ public class SymbolManager implements SymbolTable, ManagerDB {
|
|||
/**
|
||||
* Move symbol. Only symbol address is changed.
|
||||
* References must be moved separately.
|
||||
* @param fromAddr
|
||||
* @param toAddr
|
||||
* @param oldAddr the old symbol address
|
||||
* @param newAddr the new symbol address
|
||||
*/
|
||||
public void moveSymbolsAt(Address oldAddr, Address newAddr) {
|
||||
lock.acquire();
|
||||
|
|
|
@ -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.
|
||||
|
@ -160,8 +159,8 @@ public class AddressRangeMapDB implements DBListener {
|
|||
}
|
||||
|
||||
/**
|
||||
* Returns the value associated with the given index.
|
||||
* @param index
|
||||
* Returns the value associated with the given address.
|
||||
* @param addr the address of the value
|
||||
* @return value or null no value exists
|
||||
*/
|
||||
public Field getValue(Address addr) {
|
||||
|
@ -202,10 +201,9 @@ public class AddressRangeMapDB implements DBListener {
|
|||
/**
|
||||
* Associates the given value with every index from start to end (inclusive)
|
||||
* Any previous associates are overwritten.
|
||||
* @param start
|
||||
* @param end
|
||||
* @param startAddr the start address.
|
||||
* @param endAddr the end address.
|
||||
* @param value value to be painted, or null for value removal.
|
||||
* @throws IOException
|
||||
*/
|
||||
public void paintRange(Address startAddr, Address endAddr, Field value) {
|
||||
lock.acquire();
|
||||
|
@ -235,7 +233,6 @@ public class AddressRangeMapDB implements DBListener {
|
|||
* @param length the number of addresses to move.
|
||||
* @param monitor the task monitor.
|
||||
* @throws CancelledException if the user canceled the operation via the task monitor.
|
||||
* @throws AddressOverflowException if the length is such that a address wrap occurs
|
||||
*/
|
||||
public void moveAddressRange(Address fromAddr, Address toAddr, long length, TaskMonitor monitor)
|
||||
throws CancelledException {
|
||||
|
@ -383,8 +380,8 @@ public class AddressRangeMapDB implements DBListener {
|
|||
|
||||
/**
|
||||
* Remove values from the given range.
|
||||
* @param start
|
||||
* @param end
|
||||
* @param startAddr the start address.
|
||||
* @param endAddr the end address.
|
||||
*/
|
||||
public void clearRange(Address startAddr, Address endAddr) {
|
||||
lock.acquire();
|
||||
|
@ -510,8 +507,7 @@ public class AddressRangeMapDB implements DBListener {
|
|||
|
||||
/**
|
||||
* Returns the bounding address-range containing addr and the the same value throughout.
|
||||
* @param register
|
||||
* @param addr
|
||||
* @param addr the contained address
|
||||
* @return single value address-range containing addr
|
||||
*/
|
||||
public AddressRange getAddressRangeContaining(Address addr) {
|
||||
|
@ -911,9 +907,6 @@ public class AddressRangeMapDB implements DBListener {
|
|||
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.framework.store.db.DBListener#dbRestored(db.DBHandle)
|
||||
*/
|
||||
@Override
|
||||
public void dbRestored(DBHandle dbh) {
|
||||
lastStart = null;
|
||||
|
@ -923,16 +916,10 @@ public class AddressRangeMapDB implements DBListener {
|
|||
findTable();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see db.DBListener#dbClosed(db.DBHandle)
|
||||
*/
|
||||
@Override
|
||||
public void dbClosed(DBHandle dbh) {
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.framework.store.db.DBListener#tableDeleted(db.DBHandle, ghidra.framework.store.db.Table)
|
||||
*/
|
||||
@Override
|
||||
public void tableDeleted(DBHandle dbh, Table table) {
|
||||
if (table == rangeMapTable) {
|
||||
|
@ -944,9 +931,6 @@ public class AddressRangeMapDB implements DBListener {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.framework.store.db.DBListener#tableAdded(db.DBHandle, ghidra.framework.store.db.Table)
|
||||
*/
|
||||
@Override
|
||||
public void tableAdded(DBHandle dbh, Table table) {
|
||||
if (tableName.equals(table.getName())) {
|
||||
|
|
|
@ -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.
|
||||
|
@ -31,6 +30,7 @@ import db.util.ErrorHandler;
|
|||
* This map allows values to share a given range with other values.
|
||||
* @deprecated This map class should not be used except by the OldFunctionMapDB class
|
||||
*/
|
||||
@Deprecated
|
||||
public class SharedRangeMapDB {
|
||||
|
||||
private DBHandle dbHandle;
|
||||
|
|
|
@ -181,7 +181,6 @@ public class Disassembler implements DisassemblerConflictHandler {
|
|||
/**
|
||||
* Get a suitable disassembler instance.
|
||||
* @param program the program to be disassembled.
|
||||
* @param language the language module that "understands" the bytes.
|
||||
* @param markBadInstructions if true bad instructions will be marked
|
||||
* @param markUnimplementedPcode if true instructions with unimplemented pcode will be marked
|
||||
* @param restrictToExecuteMemory if true disassembly will only be permitted with executable memory blocks
|
||||
|
@ -243,7 +242,6 @@ public class Disassembler implements DisassemblerConflictHandler {
|
|||
/**
|
||||
* Disassembler constructor
|
||||
* @param program the program to be disassembled.
|
||||
* @param language the language module that "understands" the bytes.
|
||||
* @param markBadInstructions if true bad instructions will be marked
|
||||
* @param markUnimplementedPcode if true instructions with unimplemented pcode will be marked
|
||||
* @param restrictToExecuteMemory if true disassembly will only be permitted with executable memory blocks
|
||||
|
|
|
@ -259,7 +259,7 @@ public class DisassemblerContextImpl implements DisassemblerContext {
|
|||
*
|
||||
* @param destAddr
|
||||
* @param isFallThrough
|
||||
* @return
|
||||
* @return the flowed context value
|
||||
*/
|
||||
public RegisterValue getFlowContextValue(Address destAddr, boolean isFallThrough) {
|
||||
return getFlowContextValue(Address.NO_ADDRESS, destAddr, isFallThrough);
|
||||
|
@ -269,7 +269,7 @@ public class DisassemblerContextImpl implements DisassemblerContext {
|
|||
* Get flowed context value at a destination address, that has been flowed from the fromAddr, without affecting state.
|
||||
*
|
||||
* @param fromAddr address that this flow is flowing from.
|
||||
* @param toAddr the starting address of a new instruction flow.
|
||||
* @param destAddr the starting address of a new instruction flow.
|
||||
* @throws IllegalStateException if a previous flow was not ended.
|
||||
*/
|
||||
public RegisterValue getFlowContextValue(Address fromAddr, Address destAddr, boolean isFallThrough) {
|
||||
|
@ -337,7 +337,7 @@ public class DisassemblerContextImpl implements DisassemblerContext {
|
|||
* The future flow state values are then loaded into the current context.
|
||||
*
|
||||
* @param fromAddr address that this flow is flowing from.
|
||||
* @param toAddr the starting address of a new instruction flow.
|
||||
* @param destAddr the starting address of a new instruction flow.
|
||||
* @throws IllegalStateException if a previous flow was not ended.
|
||||
*/
|
||||
public void flowToAddress(Address fromAddr, Address destAddr) {
|
||||
|
@ -565,25 +565,16 @@ public class DisassemblerContextImpl implements DisassemblerContext {
|
|||
currentAddress = null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.lang.ProcessorContext#getRegisters()
|
||||
*/
|
||||
@Override
|
||||
public Register[] getRegisters() {
|
||||
return programContext.getRegisters();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.lang.ProcessorContext#getRegister(java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
public Register getRegister(String name) {
|
||||
return programContext.getRegister(name);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.lang.ProcessorContext#getRegisterValue(ghidra.program.model.lang.Register)
|
||||
*/
|
||||
@Override
|
||||
public RegisterValue getRegisterValue(Register register) {
|
||||
if (register == null) {
|
||||
|
@ -618,9 +609,6 @@ public class DisassemblerContextImpl implements DisassemblerContext {
|
|||
return programValue.combineValues(value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.lang.ProcessorContext#getValue(ghidra.program.model.lang.Register, boolean)
|
||||
*/
|
||||
@Override
|
||||
public BigInteger getValue(Register register, boolean signed) {
|
||||
RegisterValue value = getRegisterValue(register);
|
||||
|
@ -659,17 +647,11 @@ public class DisassemblerContextImpl implements DisassemblerContext {
|
|||
setRegisterValue(fromAddr, toAddr, new RegisterValue(register, newValue), true);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see ghidra.program.disassemble.DisassemblerConextIfc#setFutureRegisterValue(ghidra.program.model.address.Address, ghidra.program.model.lang.RegisterValue)
|
||||
*/
|
||||
@Override
|
||||
public void setFutureRegisterValue(Address address, RegisterValue value) {
|
||||
setFutureRegisterValue(Address.NO_ADDRESS, address, value);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see ghidra.program.disassemble.DisassemblerConextIfc#setFutureRegisterValue(ghidra.program.model.address.Address, ghidra.program.model.address.Address, ghidra.program.model.lang.RegisterValue)
|
||||
*/
|
||||
@Override
|
||||
public void setFutureRegisterValue(Address fromAddr, Address toAddr, RegisterValue value) {
|
||||
setRegisterValue(fromAddr, toAddr, value, true);
|
||||
|
@ -771,26 +753,17 @@ public class DisassemblerContextImpl implements DisassemblerContext {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.lang.ProcessorContext#hasValue(ghidra.program.model.lang.Register)
|
||||
*/
|
||||
@Override
|
||||
public boolean hasValue(Register register) {
|
||||
BigInteger value = getValue(register, true);
|
||||
return value != null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.lang.ProcessorContext#setValue(ghidra.program.model.lang.Register, java.math.BigInteger)
|
||||
*/
|
||||
@Override
|
||||
public void setValue(Register register, BigInteger value) {
|
||||
setRegisterValue(new RegisterValue(register, value));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.lang.ProcessorContext#clearRegister(ghidra.program.model.lang.Register)
|
||||
*/
|
||||
@Override
|
||||
public void clearRegister(Register register) {
|
||||
if (!isFlowActive()) {
|
||||
|
@ -841,7 +814,6 @@ public class DisassemblerContextImpl implements DisassemblerContext {
|
|||
* affect the current context state at the current address in a non-delayed fashion.
|
||||
*
|
||||
* @param value register value
|
||||
* @param address disassembly address
|
||||
* @param fromAddr the address from which this flow originated
|
||||
* @param toAddr the future flow address to save the value.
|
||||
*/
|
||||
|
@ -860,9 +832,6 @@ public class DisassemblerContextImpl implements DisassemblerContext {
|
|||
setRegisterValue(fromAddr, toAddr, value, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.lang.ProcessorContext#setRegisterValue(ghidra.program.model.lang.RegisterValue)
|
||||
*/
|
||||
@Override
|
||||
public void setRegisterValue(RegisterValue value) {
|
||||
if (value == null) {
|
||||
|
@ -913,8 +882,8 @@ public class DisassemblerContextImpl implements DisassemblerContext {
|
|||
* Returns the future register value at the specified address that occured because of a flow
|
||||
* from the fromAddr. If no future value is stored, it will return the value stored in the program.
|
||||
*
|
||||
* @param value register value
|
||||
* @param fromAddr the address from which this flow originated
|
||||
* @param register the register to get a value for.
|
||||
* @param fromAddr the address from which this flow originated.
|
||||
* @param toAddr the future flow address to save the value.
|
||||
* @param signed if true, interpret the value as signed.
|
||||
* @return the value of the register at the location, or null if a full value is not established.
|
||||
|
@ -936,7 +905,6 @@ public class DisassemblerContextImpl implements DisassemblerContext {
|
|||
*
|
||||
* @param register the register to get a value for.
|
||||
* @param address the address at which to get a value.
|
||||
* @param signed if true, interpret the value as signed.
|
||||
* @return a RegisterValue object if one has been stored in the future flow or the program.
|
||||
* The RegisterValue object may have a "no value" state for the bits specified by the given register.
|
||||
* Also, null may be returned if no value have been stored.
|
||||
|
@ -953,7 +921,6 @@ public class DisassemblerContextImpl implements DisassemblerContext {
|
|||
* @param register the register to get a value for.
|
||||
* @param fromAddr the address from which the flow originated
|
||||
* @param destAddr the address at which to get a value.
|
||||
* @param signed if true, interpret the value as signed.
|
||||
*
|
||||
* @return a RegisterValue object if one has been stored in the future flow or the program.
|
||||
* The RegisterValue object may have a "no value" state for the bits specified by the given register.
|
||||
|
|
|
@ -129,35 +129,21 @@ abstract class AbstractAddressSpace implements AddressSpace {
|
|||
return cnt;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.address.AddressSpace#hasSignedOffset()
|
||||
*/
|
||||
@Override
|
||||
public boolean hasSignedOffset() {
|
||||
return signed;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see ghidra.program.model.address.AddressSpace#getName()
|
||||
*/
|
||||
@Override
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see ghidra.program.model.address.AddressSpace#getSize()
|
||||
*/
|
||||
@Override
|
||||
public int getSize() {
|
||||
return size;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.address.AddressSpace#getAddressableUnitSize()
|
||||
*/
|
||||
@Override
|
||||
public int getAddressableUnitSize() {
|
||||
return unitSize;
|
||||
|
@ -200,9 +186,6 @@ abstract class AbstractAddressSpace implements AddressSpace {
|
|||
return MathUtilities.unsignedDivide(byteOffset, wordSize);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.address.AddressSpace#getPointerSize()
|
||||
*/
|
||||
@Override
|
||||
public int getPointerSize() {
|
||||
int ptrSize = size / 8;
|
||||
|
@ -212,10 +195,6 @@ abstract class AbstractAddressSpace implements AddressSpace {
|
|||
return ptrSize;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see ghidra.program.model.address.AddressSpace#getType()
|
||||
*/
|
||||
@Override
|
||||
public int getType() {
|
||||
return type;
|
||||
|
@ -229,10 +208,6 @@ abstract class AbstractAddressSpace implements AddressSpace {
|
|||
return spaceID >> ID_UNIQUE_SHIFT;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see ghidra.program.model.address.AddressSpace#getAddress(java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
public Address getAddress(String addrString) throws AddressFormatException {
|
||||
return getAddress(addrString, true);
|
||||
|
@ -303,10 +278,6 @@ abstract class AbstractAddressSpace implements AddressSpace {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see ghidra.program.model.address.AddressSpace#subtract(ghidra.program.model.address.Address, ghidra.program.model.address.Address)
|
||||
*/
|
||||
@Override
|
||||
public long subtract(Address addr1, Address addr2) {
|
||||
AddressSpace space1 = addr1.getAddressSpace();
|
||||
|
@ -321,28 +292,17 @@ abstract class AbstractAddressSpace implements AddressSpace {
|
|||
return addr1.getOffset() - addr2.getOffset();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see ghidra.program.model.address.AddressSpace#subtractWrap(ghidra.program.model.address.Address, long)
|
||||
*/
|
||||
@Override
|
||||
public Address subtractWrap(Address addr, long displacement) {
|
||||
testAddressSpace(addr);
|
||||
return getUncheckedAddress(truncateOffset(addr.getOffset() - displacement));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.address.AddressSpace#subtractWrapSpace(ghidra.program.model.address.Address, long)
|
||||
*/
|
||||
@Override
|
||||
public Address subtractWrapSpace(Address addr, long displacement) {
|
||||
return subtractWrap(addr, displacement);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see ghidra.program.model.address.AddressSpace#subtractNoWrap(ghidra.program.model.address.Address, long)
|
||||
*/
|
||||
@Override
|
||||
public Address subtractNoWrap(Address addr, long displacement) throws AddressOverflowException {
|
||||
if (displacement < 0) {
|
||||
|
@ -383,10 +343,6 @@ abstract class AbstractAddressSpace implements AddressSpace {
|
|||
return getUncheckedAddress(result);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see ghidra.program.model.address.AddressSpace#subtract(ghidra.program.model.address.Address, long)
|
||||
*/
|
||||
@Override
|
||||
public Address subtract(Address addr, long displacement) {
|
||||
try {
|
||||
|
@ -397,28 +353,17 @@ abstract class AbstractAddressSpace implements AddressSpace {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see ghidra.program.model.address.AddressSpace#addWrap(ghidra.program.model.address.Address, long)
|
||||
*/
|
||||
@Override
|
||||
public Address addWrap(Address addr, long displacement) {
|
||||
testAddressSpace(addr);
|
||||
return getUncheckedAddress(truncateOffset(addr.getOffset() + displacement));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.address.AddressSpace#addWrapSpace(ghidra.program.model.address.Address, long)
|
||||
*/
|
||||
@Override
|
||||
public Address addWrapSpace(Address addr, long displacement) {
|
||||
return addWrap(addr, displacement);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see ghidra.program.model.address.AddressSpace#addNoWrap(ghidra.program.model.address.Address, long)
|
||||
*/
|
||||
@Override
|
||||
public Address addNoWrap(Address addr, long displacement) throws AddressOverflowException {
|
||||
|
||||
|
@ -480,10 +425,6 @@ abstract class AbstractAddressSpace implements AddressSpace {
|
|||
return getUncheckedAddress(resultOffset);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see ghidra.program.model.address.AddressSpace#add(ghidra.program.model.address.Address, long)
|
||||
*/
|
||||
@Override
|
||||
public Address add(Address addr, long displacement) throws AddressOutOfBoundsException {
|
||||
try {
|
||||
|
@ -515,10 +456,6 @@ abstract class AbstractAddressSpace implements AddressSpace {
|
|||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see ghidra.program.model.address.AddressSpace#isSuccessor(ghidra.program.model.address.Address, ghidra.program.model.address.Address)
|
||||
*/
|
||||
@Override
|
||||
public boolean isSuccessor(Address addr1, Address addr2) {
|
||||
if (!addr1.getAddressSpace().equals(addr2.getAddressSpace())) {
|
||||
|
@ -531,17 +468,11 @@ abstract class AbstractAddressSpace implements AddressSpace {
|
|||
return addr1.getOffset() == addr2.getOffset() - 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.address.AddressSpace#getMaxAddress()
|
||||
*/
|
||||
@Override
|
||||
public Address getMaxAddress() {
|
||||
return maxAddress;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.address.AddressSpace#getMinAddress()
|
||||
*/
|
||||
@Override
|
||||
public Address getMinAddress() {
|
||||
return minAddress;
|
||||
|
@ -559,10 +490,6 @@ abstract class AbstractAddressSpace implements AddressSpace {
|
|||
return baseCompare;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see java.lang.Comparable#compareTo(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public int compareTo(AddressSpace space) {
|
||||
if (space == this) {
|
||||
|
@ -599,10 +526,6 @@ abstract class AbstractAddressSpace implements AddressSpace {
|
|||
return c;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see java.lang.Object#equals(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (obj == this) {
|
||||
|
@ -628,19 +551,11 @@ abstract class AbstractAddressSpace implements AddressSpace {
|
|||
return type == s.getType() && name.equals(s.getName()) && size == s.getSize();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see java.lang.Object#hashCode()
|
||||
*/
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return hashcode;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see ghidra.program.model.address.AddressSpace#getBaseSpaceID()
|
||||
*/
|
||||
@Override
|
||||
public int getBaseSpaceID() {
|
||||
return spaceID;
|
||||
|
@ -658,17 +573,11 @@ abstract class AbstractAddressSpace implements AddressSpace {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @see java.lang.Object#toString()
|
||||
*/
|
||||
@Override
|
||||
public String toString() {
|
||||
return name + ":";
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.address.AddressSpace#showSpaceName()
|
||||
*/
|
||||
@Override
|
||||
public boolean showSpaceName() {
|
||||
return showSpaceName;
|
||||
|
@ -692,9 +601,6 @@ abstract class AbstractAddressSpace implements AddressSpace {
|
|||
return addr;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.address.AddressSpace#makeValidOffset(long)
|
||||
*/
|
||||
@Override
|
||||
public long makeValidOffset(long offset) throws AddressOutOfBoundsException {
|
||||
// TODO: Verify that this handle all cases - seems like it would not
|
||||
|
@ -725,9 +631,6 @@ abstract class AbstractAddressSpace implements AddressSpace {
|
|||
UnsignedDataUtils.unsignedLessThanOrEqual(offset, maxOffset);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.address.AddressSpace#truncateOffset(long)
|
||||
*/
|
||||
@Override
|
||||
public long truncateOffset(long offset) {
|
||||
if ((offset >= minOffset && offset <= maxOffset) || spaceSize == 0) {
|
||||
|
@ -748,17 +651,11 @@ abstract class AbstractAddressSpace implements AddressSpace {
|
|||
return offset;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.address.AddressSpace#truncateOffset(long)
|
||||
*/
|
||||
@Override
|
||||
public long truncateAddressableWordOffset(long wordOffset) {
|
||||
return wordOffset & wordAddressMask;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.address.AddressSpace#isMemorySpace()
|
||||
*/
|
||||
@Override
|
||||
public boolean isMemorySpace() {
|
||||
return type == TYPE_RAM || type == TYPE_CODE || type == TYPE_OTHER;
|
||||
|
@ -774,65 +671,41 @@ abstract class AbstractAddressSpace implements AddressSpace {
|
|||
return type == TYPE_OTHER;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.address.AddressSpace#isHashSpace()
|
||||
*/
|
||||
@Override
|
||||
public boolean isHashSpace() {
|
||||
return this == HASH_SPACE;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.address.AddressSpace#isRegisterSpace()
|
||||
*/
|
||||
@Override
|
||||
public boolean isRegisterSpace() {
|
||||
return type == TYPE_REGISTER;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.address.AddressSpace#isStackSpace()
|
||||
*/
|
||||
@Override
|
||||
public boolean isStackSpace() {
|
||||
return type == TYPE_STACK;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.address.AddressSpace#isUniqueSpace()
|
||||
*/
|
||||
@Override
|
||||
public boolean isUniqueSpace() {
|
||||
return type == TYPE_UNIQUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.address.AddressSpace#isConstantSpace()
|
||||
*/
|
||||
@Override
|
||||
public boolean isConstantSpace() {
|
||||
return type == TYPE_CONSTANT;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.address.AddressSpace#isVariableSpace()
|
||||
*/
|
||||
@Override
|
||||
public boolean isVariableSpace() {
|
||||
return type == TYPE_VARIABLE;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.address.AddressSpace#isExternalSpace()
|
||||
*/
|
||||
@Override
|
||||
public boolean isExternalSpace() {
|
||||
return type == TYPE_EXTERNAL;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.address.AddressSpace#isOverlaySpace()
|
||||
*/
|
||||
@Override
|
||||
public boolean isOverlaySpace() {
|
||||
return false;
|
||||
|
@ -842,9 +715,6 @@ abstract class AbstractAddressSpace implements AddressSpace {
|
|||
showSpaceName = b;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.address.AddressSpace#hasMappedRegisters()
|
||||
*/
|
||||
@Override
|
||||
public boolean hasMappedRegisters() {
|
||||
return hasMemoryMappedRegisters;
|
||||
|
@ -859,9 +729,6 @@ abstract class AbstractAddressSpace implements AddressSpace {
|
|||
hasMemoryMappedRegisters = hasRegisters;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.address.AddressSpace#getPhysicalSpace()
|
||||
*/
|
||||
@Override
|
||||
public AddressSpace getPhysicalSpace() {
|
||||
return this;
|
||||
|
|
|
@ -73,8 +73,9 @@ public interface Address extends Comparable<Address> {
|
|||
* is specified.
|
||||
* @param offset the offset for the new address.
|
||||
* @param isAddressableWordOffset if true the specified offset is an addressable unit/word offset,
|
||||
* otherwise offset is a byte offset. See {@link #getAddressableUnitSize()}
|
||||
* to understand the distinction (i.e., wordOffset = byteOffset * addressableUnitSize).
|
||||
* otherwise offset is a byte offset. See {@link ghidra.program.model.address.AddressSpace#getAddressableUnitSize()
|
||||
* AddressSpace#getAddressableUnitSize()} to understand the distinction
|
||||
* (i.e., wordOffset = byteOffset * addressableUnitSize).
|
||||
* @return address with given offset
|
||||
* @throws AddressOutOfBoundsException if the offset is less than 0 or greater
|
||||
* than the max offset allowed for this space.
|
||||
|
@ -90,8 +91,9 @@ public interface Address extends Comparable<Address> {
|
|||
* is specified.
|
||||
* @param offset the offset for the new address.
|
||||
* @param isAddressableWordOffset if true the specified offset is an addressable unit/word offset,
|
||||
* otherwise offset is a byte offset. See {@link #getAddressableUnitSize()}
|
||||
* to understand the distinction (i.e., wordOffset = byteOffset * addressableUnitSize).
|
||||
* otherwise offset is a byte offset. See {@link ghidra.program.model.address.AddressSpace#getAddressableUnitSize()
|
||||
* AddressSpace#getAddressableUnitSize()} to understand the distinction
|
||||
* (i.e., wordOffset = byteOffset * addressableUnitSize).
|
||||
* @return address with given byte offset truncated to the physical space size
|
||||
*/
|
||||
Address getNewTruncatedAddress(long offset, boolean isAddressableWordOffset);
|
||||
|
@ -387,10 +389,11 @@ public interface Address extends Comparable<Address> {
|
|||
|
||||
/**
|
||||
* Returns true if this address represents a location in register space.
|
||||
* @depricate use of this method is highly discouraged since since registers
|
||||
* @deprecated use of this method is highly discouraged since since registers
|
||||
* may also exist in a memory space. The address for such registers
|
||||
* would return false from this method.
|
||||
*/
|
||||
@Deprecated
|
||||
public boolean isRegisterAddress();
|
||||
|
||||
/**
|
||||
|
|
|
@ -21,7 +21,7 @@ import java.util.*;
|
|||
|
||||
/**
|
||||
* <code>AddressMapImpl</code> provides a stand-alone AddressMap.
|
||||
* An AddressMapimpl instance should only be used to decode keys which it has generated.
|
||||
* An AddressMapImpl instance should only be used to decode keys which it has generated.
|
||||
* If this map is used for a specific program instance, the map should be discard if any changes
|
||||
* are made to that programs address map (e.g., removing or renaming overlay spaces).
|
||||
*/
|
||||
|
@ -169,7 +169,7 @@ public class AddressMapImpl {
|
|||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.address.AddressMap#decodeAddress(long)
|
||||
* @see ghidra.program.database.map.AddressMap#decodeAddress(long)
|
||||
*/
|
||||
public synchronized Address decodeAddress(long value) {
|
||||
if ((value & MAP_ID_MASK) != mapIdBits) {
|
||||
|
@ -192,7 +192,7 @@ public class AddressMapImpl {
|
|||
* single program should be passed to this method. Only limited checking is not performed in order to
|
||||
* improve performance.
|
||||
* @param addr address
|
||||
* @see ghidra.program.model.address.AddressMap#getKey(ghidra.program.model.address.Address)
|
||||
* @see ghidra.program.database.map.AddressMap#getKey(Address, boolean)
|
||||
*/
|
||||
public synchronized long getKey(Address addr) {
|
||||
return mapIdBits | ((long) getBaseAddressIndex(addr) << ADDR_OFFSET_SIZE) |
|
||||
|
@ -200,7 +200,7 @@ public class AddressMapImpl {
|
|||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.address.AddressMap#findKeyRange(java.util.List, ghidra.program.model.address.Address)
|
||||
* @see ghidra.program.database.map.AddressMap#findKeyRange(List, Address)
|
||||
*/
|
||||
public int findKeyRange(List<KeyRange> keyRangeList, Address addr) {
|
||||
if (addr == null) {
|
||||
|
@ -210,7 +210,7 @@ public class AddressMapImpl {
|
|||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.address.AddressMap#getKeyRanges(ghidra.program.model.address.Address, ghidra.program.model.address.Address)
|
||||
* @see ghidra.program.database.map.AddressMap#getKeyRanges(Address, Address, boolean)
|
||||
*/
|
||||
public List<KeyRange> getKeyRanges(Address start, Address end) {
|
||||
if (start.getAddressSpace() != end.getAddressSpace() || start.getOffset() > end.getOffset()) {
|
||||
|
@ -222,7 +222,7 @@ public class AddressMapImpl {
|
|||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.address.AddressMap#getKeyRanges(ghidra.program.model.address.AddressSetView)
|
||||
* @see ghidra.program.database.map.AddressMap#getKeyRanges(AddressSetView, boolean)
|
||||
*/
|
||||
public synchronized List<KeyRange> getKeyRanges(AddressSetView set) {
|
||||
|
||||
|
|
|
@ -83,7 +83,7 @@ public class AddressSet implements AddressSetView {
|
|||
* Creates a new Address set containing a single range
|
||||
* @param start the start address of the range
|
||||
* @param end the end address of the range
|
||||
* @param addressFactory NOT USED.
|
||||
* @param factory NOT USED.
|
||||
* @deprecated use {@link #AddressSet(Address, Address)} (will be kept until at least Ghidra 6.2)
|
||||
*/
|
||||
@Deprecated
|
||||
|
@ -106,8 +106,8 @@ public class AddressSet implements AddressSetView {
|
|||
|
||||
/**
|
||||
* Create a new Address Set from an existing Address Set.
|
||||
* @param addrSet Existing Address Set to clone.
|
||||
* @param addressFactory NOT USED.
|
||||
* @param set Existing Address Set to clone.
|
||||
* @param factory NOT USED.
|
||||
* @deprecated use {@link #AddressSet(AddressSetView)} (will be kept until at least Ghidra 6.2)
|
||||
*/
|
||||
@Deprecated
|
||||
|
@ -117,7 +117,7 @@ public class AddressSet implements AddressSetView {
|
|||
|
||||
/**
|
||||
* Create a new Address Set from an existing Address Set.
|
||||
* @param addrSet Existing Address Set to clone.
|
||||
* @param set Existing Address Set to clone.
|
||||
*/
|
||||
public AddressSet(AddressSetView set) {
|
||||
add(set);
|
||||
|
@ -126,7 +126,7 @@ public class AddressSet implements AddressSetView {
|
|||
/**
|
||||
* Create a new Address containing a single address.
|
||||
* @param addr the address to be included in this address set.
|
||||
* @param addressFactory NOT USED.
|
||||
* @param factory NOT USED.
|
||||
* @deprecated use {@link #AddressSet(Address)} (will be kept until at least Ghidra 6.2)
|
||||
*/
|
||||
@Deprecated
|
||||
|
|
|
@ -113,9 +113,6 @@ public class OverlayAddressSpace extends AbstractAddressSpace {
|
|||
// return translateAddress(super.subtractWrap(addr, displacement));
|
||||
// }
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.address.GenericAddressSpace#isOverlaySpace()
|
||||
*/
|
||||
@Override
|
||||
public boolean isOverlaySpace() {
|
||||
return originalSpace != null;
|
||||
|
@ -125,17 +122,11 @@ public class OverlayAddressSpace extends AbstractAddressSpace {
|
|||
return originalSpace;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.address.AddressSpace#getPhysicalSpace()
|
||||
*/
|
||||
@Override
|
||||
public AddressSpace getPhysicalSpace() {
|
||||
return originalSpace.getPhysicalSpace();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.address.AddressSpace#hasMappedRegisters()
|
||||
*/
|
||||
@Override
|
||||
public boolean hasMappedRegisters() {
|
||||
return originalSpace.hasMappedRegisters();
|
||||
|
@ -157,9 +148,6 @@ public class OverlayAddressSpace extends AbstractAddressSpace {
|
|||
return new GenericAddress(offset, this);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.address.AddressSpace#getAddress(long)
|
||||
*/
|
||||
@Override
|
||||
public Address getAddress(long offset) {
|
||||
if (contains(offset)) {
|
||||
|
@ -168,9 +156,6 @@ public class OverlayAddressSpace extends AbstractAddressSpace {
|
|||
return originalSpace.getAddress(offset);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ghidra.program.model.address.AbstractAddressSpace#getUncheckedAddress(long, long)
|
||||
*/
|
||||
@Override
|
||||
protected Address getUncheckedAddress(long offset) {
|
||||
return new GenericAddress(offset, this);
|
||||
|
@ -239,10 +224,6 @@ public class OverlayAddressSpace extends AbstractAddressSpace {
|
|||
return databaseKey;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see java.lang.Object#equals(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (obj == this) {
|
||||
|
|
|
@ -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.
|
||||
|
@ -78,6 +77,7 @@ public class SimpleDestReferenceIterator implements CodeBlockReferenceIterator {
|
|||
* @throws CancelledException if the monitor cancels the operation.
|
||||
* @deprecated this method should be avoided since it repeats the work of the iterator
|
||||
*/
|
||||
@Deprecated
|
||||
public static int getNumDestinations(CodeBlock block, boolean followIndirectFlows, TaskMonitor monitor) throws CancelledException {
|
||||
return getDestinations(block, null, followIndirectFlows, 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.
|
||||
|
@ -78,6 +77,7 @@ public class SimpleSourceReferenceIterator implements CodeBlockReferenceIterator
|
|||
* @throws CancelledException if the monitor cancels the operation.
|
||||
* @deprecated this method should be avoided since it repeats the work of the iterator
|
||||
*/
|
||||
@Deprecated
|
||||
public static int getNumSources(CodeBlock block, boolean followIndirectFlows, TaskMonitor monitor) throws CancelledException {
|
||||
return getSources(block, null, followIndirectFlows, 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.
|
||||
|
@ -40,7 +39,7 @@ import java.util.LinkedList;
|
|||
* by B (due to a cycle), then this iterator will include it twice rather than
|
||||
* skipping over the identical address set. This is because the iterator works by
|
||||
* iterating through M-model subroutines, and wherever M-model subroutines have
|
||||
* n > 1 multiple entry points, the iterator produces an O-model subroutine
|
||||
* n > 1 multiple entry points, the iterator produces an O-model subroutine
|
||||
* for every one of the entry points.
|
||||
*/
|
||||
public class SingleEntSubIterator implements CodeBlockIterator {
|
||||
|
|
|
@ -24,7 +24,8 @@ public interface DisambiguateStrategy {
|
|||
/**
|
||||
* Generate (possibly multiple) hashes that can be used to disambiguate an n-gram and its block from other
|
||||
* blocks with similar instructions. Hashes are attached to the block's disambigHash list.
|
||||
* @param block is the Block to generate specific disambiguating hashes for
|
||||
* @param instHash the instruction hash
|
||||
* @param matchSize the number of instructions to match
|
||||
* @param store is the HashStore used to store the disambiguating hashes
|
||||
* @return the list of disambiguating hashes
|
||||
* @throws CancelledException
|
||||
|
|
|
@ -253,7 +253,7 @@ public class HashStore {
|
|||
* @param minLength is the minimum length of an n-gram for these passes
|
||||
* @param maxLength is the maximum length of an n-gram for these passes
|
||||
* @param wholeBlock if true, allows blocks that are smaller than the minimum length to be considered as 1 n-gram.
|
||||
* @param matchBlock if true, only generates n-grams for sequences in previously matched blocks
|
||||
* @param matchOnly if true, only generates n-grams for sequences in previously matched blocks
|
||||
* @param hashCalc is the hash function
|
||||
* @throws MemoryAccessException
|
||||
*/
|
||||
|
|
|
@ -400,7 +400,7 @@ public class HashedFunctionAddressCorrelation implements FunctionAddressCorrelat
|
|||
}
|
||||
|
||||
/**
|
||||
* Given the src -> dest map, build the dest -> src map
|
||||
* {@literal Given the src -> dest map, build the dest -> src map}
|
||||
*/
|
||||
private void buildFinalMaps() {
|
||||
for(Entry<Address,Address> entry : srcToDest.entrySet()) {
|
||||
|
|
|
@ -28,7 +28,7 @@ import ghidra.program.model.mem.MemBuffer;
|
|||
* See {@link StringDataType} for information about string variations and configuration details.
|
||||
* <p>
|
||||
* Sub-classes generally only need to implement a constructor that calls the mega-constructor
|
||||
* {@link #StringDataTypeBase(String, String, String, String, String, String, String, DataType, StringLayoutEnum, DataTypeManager) StringDataTypeBase.StringDataTypeBase(lots,of,params)}
|
||||
* {@link #AbstractStringDataType(String, String, String, String, String, String, String, DataType, StringLayoutEnum, DataTypeManager) AbstractStringDataType.SAbstractStringDataType(lots,of,params)}
|
||||
* and the {@link DataType#clone(DataTypeManager) } method.
|
||||
* <p>
|
||||
*
|
||||
|
|
|
@ -51,7 +51,7 @@ public interface Array extends DataType {
|
|||
*
|
||||
* @param buf memory buffer containing the bytes.
|
||||
* @param settings the Settings object
|
||||
* @param length the length of the data.
|
||||
* @param len the length of the data.
|
||||
* @param options options for how to format the default label prefix.
|
||||
* @return the label prefix or null if not applicable
|
||||
*/
|
||||
|
@ -72,7 +72,7 @@ public interface Array extends DataType {
|
|||
*
|
||||
* @param buf memory buffer containing the bytes.
|
||||
* @param settings the Settings object
|
||||
* @param length the length of the data.
|
||||
* @param len the length of the data.
|
||||
* @param options options for how to format the default label prefix.
|
||||
* @param offcutLength offcut offset from start of buf
|
||||
* @return the offcut label prefix or null if not applicable
|
||||
|
@ -148,7 +148,7 @@ public interface Array extends DataType {
|
|||
|
||||
/**
|
||||
* Get the value Class of a specific arrayDt with settings
|
||||
* ( see {@link #getArrayValueClass(Array, Settings)} ).
|
||||
* ( see {@link #getArrayValueClass(Settings)} ).
|
||||
*
|
||||
* @param settings the relevant settings to use or null for default.
|
||||
* @return Class of the value to be returned by the array or null if it can vary
|
||||
|
|
|
@ -57,7 +57,7 @@ public interface ArrayStringable extends DataType {
|
|||
* default label prefix for the array.
|
||||
* @param buf memory buffer containing the bytes.
|
||||
* @param settings the Settings object
|
||||
* @param length the length of the data.
|
||||
* @param len the length of the data.
|
||||
* @param options options for how to format the default label prefix.
|
||||
* @return the default label prefix or null if none specified.
|
||||
*/
|
||||
|
@ -70,10 +70,10 @@ public interface ArrayStringable extends DataType {
|
|||
* data that references <tt>offcutLength</tt> bytes into this type
|
||||
*
|
||||
* @param buf memory buffer containing the bytes.
|
||||
* @param settings the Settings object
|
||||
* @param length the length of the data.
|
||||
* @param settings the Settings object.
|
||||
* @param len the length of the data.
|
||||
* @param options options for how to format the default label prefix.
|
||||
* @param offcutOffset
|
||||
* @param offcutLength the length of the offcut label prefix.
|
||||
* @return the default label prefix or null if none specified.
|
||||
*/
|
||||
public String getArrayDefaultOffcutLabelPrefix(MemBuffer buf, Settings settings, int len,
|
||||
|
|
|
@ -151,7 +151,7 @@ public class BitFieldDataType extends AbstractDataType {
|
|||
/**
|
||||
* Check if a specified baseDataType is valid for use with a bitfield
|
||||
* @param baseDataType bitfield base data type (Enum, AbstractIntegerDataType and derived TypeDefs permitted)
|
||||
* @returns true if baseDataType is valid else false
|
||||
* @return true if baseDataType is valid else false
|
||||
*/
|
||||
public static boolean isValidBaseDataType(DataType baseDataType) {
|
||||
if (baseDataType instanceof TypeDef) {
|
||||
|
|
|
@ -37,8 +37,7 @@ public interface BitFieldPacking {
|
|||
* A non-zero value indicates the fixed alignment size for bit-fields which follow
|
||||
* a zero-length bitfield if greater than a bitfields base type normal alignment.
|
||||
* Corresponds to EMPTY_FIELD_BOUNDARY in GCC.
|
||||
* This value is only used when {@link #isTypeAlignmentEnabled()} returns false
|
||||
* and {@link #isZeroLengthAlignmentEnabled()} returns true.
|
||||
* This value is only used when {@link #isTypeAlignmentEnabled()} returns false.
|
||||
* @return fixed alignment size as number of bytes for a bit-field which follows
|
||||
* a zero-length bit-field
|
||||
*/
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue