Package ghidra.pcode.exec
Interface PcodeUseropLibrary<T>
- Type Parameters:
T
- the type of values accepted by the p-code userops.
- All Known Subinterfaces:
EmuSyscallLibrary<T>
- All Known Implementing Classes:
AbstractEmuLinuxSyscallUseropLibrary
,AbstractEmuUnixSyscallUseropLibrary
,AdaptedEmulator.AdaptedPcodeUseropLibrary
,AnnotatedEmuSyscallUseropLibrary
,AnnotatedPcodeUseropLibrary
,ComposedPcodeUseropLibrary
,DefaultPcodeThread.PcodeEmulationLibrary
,EmuLinuxAmd64SyscallUseropLibrary
,EmuLinuxX86SyscallUseropLibrary
,PcodeExpression.ValueCapturingPcodeUseropLibrary
,PcodeUseropLibrary.EmptyPcodeUseropLibrary
public interface PcodeUseropLibrary<T>
A "library" of p-code userops available to a p-code executor
The library can provide definitions of p-code userops already declared by the executor's language
as well as completely new userops accessible to Sleigh/p-code later compiled for the executor.
The recommended way to implement a library is to extend AnnotatedPcodeUseropLibrary
.
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic final class
The class of the empty userop library.static interface
The definition of a p-code userop. -
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptiondefault PcodeUseropLibrary
<T> compose
(PcodeUseropLibrary<T> lib) Compose this and the given library into a new library.static Type
getOperandType
(Class<?> cls) Get the typeT
for the given classgetSymbols
(SleighLanguage language) Get named symbols defined by this library that are not already declared in the languageGet all the userops defined in this library, keyed by (symbol) name.static <T> PcodeUseropLibrary
<T> nil()
The empty userop library, cast to match parameter types.
-
Field Details
-
NIL
The empty userop library.Executors cannot accept
null
libraries. Instead, give it this empty library. To satisfy Java's type checker, you may usenil()
instead.
-
-
Method Details
-
getOperandType
Get the typeT
for the given classIf the class does not implement
PcodeUseropLibrary
, this returns null. If it does, but no arguments are given (i.e., it implements the raw type), this returnObject
.- Parameters:
cls
- the class- Returns:
- the type, or null
-
nil
The empty userop library, cast to match parameter types.- Type Parameters:
T
- the type required by the executor- Returns:
- the empty userop library
-
getUserops
Map<String,PcodeUseropLibrary.PcodeUseropDefinition<T>> getUserops()Get all the userops defined in this library, keyed by (symbol) name.- Returns:
- the map of names to defined userops
-
compose
Compose this and the given library into a new library.- Parameters:
lib
- the other library- Returns:
- a new library having all userops defined between the two
-
getSymbols
Get named symbols defined by this library that are not already declared in the language- Parameters:
language
- the language whose existing symbols to consider- Returns:
- a map of new userop indices to extra userop symbols
-