Package ghidra.pcodeCPort.slgh_compile
Class SleighCompile
- java.lang.Object
-
- ghidra.pcodeCPort.translate.Translate
-
- ghidra.pcodeCPort.sleighbase.SleighBase
-
- ghidra.pcodeCPort.slgh_compile.SleighCompile
-
- All Implemented Interfaces:
NamedSymbolProvider
,BasicSpaceProvider
public class SleighCompile extends SleighBase
SleighCompile
provides the ability to compile Sleigh language module (e.g., *.slaspec) files.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
SleighCompile.WithBlock
-
Field Summary
Fields Modifier and Type Field Description VectorSTL<java.lang.String>
noplist
PcodeCompile
pcode
boolean
warnallnops
java.util.Deque<SleighCompile.WithBlock>
withstack
-
Fields inherited from class ghidra.pcodeCPort.sleighbase.SleighBase
maxdelayslotbytes, numSections, root, symtab, unique_allocatemask
-
Fields inherited from class ghidra.pcodeCPort.translate.Translate
alignment, nohighptr, target_endian
-
-
Constructor Summary
Constructors Constructor Description SleighCompile()
-
Method Summary
-
Methods inherited from class ghidra.pcodeCPort.sleighbase.SleighBase
addRegister, buildXrefs, findSymbol, findSymbol, getRegister, getRegisterName, getUserOpNames, isInitialized, reregisterContext, saveXml
-
Methods inherited from class ghidra.pcodeCPort.translate.Translate
addSpacebase, allowContextSet, assignShortcut, createConstFromSpace, dispose, getAddrSize, getConstant, getConstantSpace, getDefaultSize, getDefaultSpace, getFspecSpace, getIopSpace, getNextSpaceInOrder, getSpace, getSpacebase, getSpaceByName, getSpaceByShortcut, getSpaceBySpacebase, getStackSpace, getUniqueBase, getUniqueSpace, highPtrPossible, insertSpace, isBigEndian, numSpacebase, numSpaces, parseNoHighPtr, parseSpacebase, parseStackPointer, registerContext, restoreXmlSpaces, setContextDefault, setDefaultSpace, setLanguage, setUniqueBase
-
-
-
-
Field Detail
-
pcode
public final PcodeCompile pcode
-
warnallnops
public boolean warnallnops
-
noplist
public VectorSTL<java.lang.String> noplist
-
withstack
public java.util.Deque<SleighCompile.WithBlock> withstack
-
-
Method Detail
-
entry
public static void entry(java.lang.String name, java.lang.Object... args)
-
newSectionSymbol
protected SectionSymbol newSectionSymbol(Location location, java.lang.String nm)
-
createCrossBuild
protected VectorSTL<OpTpl> createCrossBuild(Location location, VarnodeTpl addr, SectionSymbol sym)
-
reportError
public void reportError(Location location, java.lang.String msg)
-
reportWarning
public void reportWarning(Location location, java.lang.String msg)
-
recordNop
public void recordNop(Location location)
-
numErrors
public int numErrors()
-
numWarnings
public int numWarnings()
-
process
public void process()
-
calcContextLayout
public void calcContextLayout()
-
setPosition
public void setPosition(java.lang.String pos, int presumedLineno)
-
setLineno
public void setLineno(int presumedLineno)
-
defineToken
public TokenSymbol defineToken(Location location, java.lang.String name, long sz)
-
addTokenField
public void addTokenField(Location location, TokenSymbol sym, FieldQuality qual)
-
addContextField
public boolean addContextField(VarnodeSymbol sym, FieldQuality qual)
-
newSpace
public void newSpace(Location location, SpaceQuality qual)
-
setEndian
public void setEndian(int end)
-
setAlignment
public void setAlignment(int val)
-
defineVarnodes
public void defineVarnodes(SpaceSymbol spacesym, long off, long size, VectorSTL<java.lang.String> names, VectorSTL<Location> locations)
-
defineBitrange
public void defineBitrange(Location location, java.lang.String name, VarnodeSymbol sym, int bitoffset, int numb)
-
dedupSymbolList
public SleighSymbol dedupSymbolList(VectorSTL<SleighSymbol> symlist)
-
attachValues
public void attachValues(VectorSTL<SleighSymbol> symlist, VectorSTL<Location> locations, VectorSTL<java.lang.Long> numlist)
-
attachNames
public void attachNames(VectorSTL<SleighSymbol> symlist, VectorSTL<Location> locations, VectorSTL<java.lang.String> names)
-
attachVarnodes
public void attachVarnodes(VectorSTL<SleighSymbol> symlist, VectorSTL<Location> locations, VectorSTL<SleighSymbol> varlist)
-
newTable
public SubtableSymbol newTable(Location location, java.lang.String nm)
-
newOperand
public void newOperand(Location location, Constructor ct, java.lang.String nm)
-
constrainOperand
public PatternEquation constrainOperand(Location location, OperandSymbol sym, PatternExpression patexp)
-
defineOperand
public void defineOperand(Location location, OperandSymbol sym, PatternExpression patexp)
-
defineInvisibleOperand
public PatternEquation defineInvisibleOperand(Location location, TripleSymbol sym)
-
selfDefine
public void selfDefine(OperandSymbol sym)
-
contextMod
public boolean contextMod(VectorSTL<ContextChange> vec, ContextSymbol sym, PatternExpression pe)
-
contextSet
public void contextSet(VectorSTL<ContextChange> vec, TripleSymbol sym, ContextSymbol cvar)
-
createMacro
public MacroSymbol createMacro(Location location, java.lang.String name, VectorSTL<java.lang.String> params, VectorSTL<Location> locations)
-
createMacroUse
public VectorSTL<OpTpl> createMacroUse(Location location, MacroSymbol sym, VectorSTL<ExprTree> param)
-
createConstructor
public Constructor createConstructor(Location location, SubtableSymbol sym)
-
pushWith
public void pushWith(SubtableSymbol ss, PatternEquation pateq, VectorSTL<ContextChange> contvec)
-
popWith
public void popWith()
-
buildConstructor
public void buildConstructor(Constructor big, PatternEquation pateq, VectorSTL<ContextChange> contvec, SectionVector vec)
-
buildMacro
public void buildMacro(MacroSymbol sym, ConstructTpl rtl)
-
initialize
public void initialize(DocumentStorage store)
- Specified by:
initialize
in classTranslate
-
instructionLength
public int instructionLength(Address baseaddr)
- Specified by:
instructionLength
in classTranslate
-
printAssembly
public int printAssembly(java.io.PrintStream s, int size, Address baseaddr)
- Specified by:
printAssembly
in classTranslate
-
main
public static void main(java.lang.String[] args) throws org.jdom.JDOMException, java.io.IOException, org.antlr.runtime.RecognitionException
Run the sleigh compiler.- Parameters:
args
- compiler command line arguments- Throws:
org.jdom.JDOMException
java.io.IOException
org.antlr.runtime.RecognitionException
-
-