mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-05 02:39:44 +02:00
Merge remote-tracking branch 'origin/GP-3993_Dan_asmContextHint--SQUASHED'
This commit is contained in:
commit
baaadc2143
7 changed files with 254 additions and 21 deletions
|
@ -25,4 +25,5 @@ import ghidra.app.plugin.assembler.sleigh.sem.AssemblyResolvedPatterns;
|
|||
* language.
|
||||
*/
|
||||
public interface Assembler extends GenericAssembler<AssemblyResolvedPatterns> {
|
||||
|
||||
}
|
||||
|
|
|
@ -21,11 +21,25 @@ import ghidra.app.plugin.assembler.sleigh.parse.AssemblyParseResult;
|
|||
import ghidra.app.plugin.assembler.sleigh.sem.*;
|
||||
import ghidra.program.model.address.Address;
|
||||
import ghidra.program.model.address.AddressOverflowException;
|
||||
import ghidra.program.model.listing.Instruction;
|
||||
import ghidra.program.model.listing.InstructionIterator;
|
||||
import ghidra.program.model.lang.Language;
|
||||
import ghidra.program.model.listing.*;
|
||||
import ghidra.program.model.mem.MemoryAccessException;
|
||||
|
||||
public interface GenericAssembler<RP extends AssemblyResolvedPatterns> {
|
||||
/**
|
||||
* Get the language of this assembler
|
||||
*
|
||||
* @return the processor language
|
||||
*/
|
||||
public Language getLanguage();
|
||||
|
||||
/**
|
||||
* If the assembler is bound to a program, get that program
|
||||
*
|
||||
* @return the program, or null
|
||||
*/
|
||||
public Program getProgram();
|
||||
|
||||
/**
|
||||
* Assemble a sequence of instructions and place them at the given address.
|
||||
*
|
||||
|
|
|
@ -104,6 +104,16 @@ public abstract class AbstractSleighAssembler<RP extends AssemblyResolvedPattern
|
|||
protected abstract AbstractAssemblyTreeResolver<RP> newResolver(Address at,
|
||||
AssemblyParseBranch tree, AssemblyPatternBlock ctx);
|
||||
|
||||
@Override
|
||||
public SleighLanguage getLanguage() {
|
||||
return lang;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Program getProgram() {
|
||||
return program;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Instruction patchProgram(AssemblyResolvedPatterns res, Address at)
|
||||
throws MemoryAccessException {
|
||||
|
@ -193,6 +203,7 @@ public abstract class AbstractSleighAssembler<RP extends AssemblyResolvedPattern
|
|||
@Override
|
||||
public AssemblyResolutionResults resolveTree(AssemblyParseResult parse, Address at) {
|
||||
AssemblyPatternBlock ctx = getContextAt(at);
|
||||
// ctx.fillMask()?
|
||||
return resolveTree(parse, at, ctx);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue