Skip to main content

Crate pcode_types

Crate pcode_types 

Source
Expand description

The vocabulary types shared between a p-code producer and a p-code consumer.

A SLEIGH specification describes memory spaces, processor registers and user-defined p-code operations; an IR built from that specification refers to the same things. Both sides need to agree on how those are identified, so the definitions live here rather than in either crate — which lets the decoder and the IR depend on each other only through this vocabulary.

These types appear directly in precompiled specification blobs, so their serialized form is part of the producer/consumer compatibility contract. A producer must version its blob format; serde alone does not provide a cross-version or cross-platform wire-format guarantee.

Re-exports§

pub use error::PcodeError;
pub use error::PcodeErrorTy;
pub use error::PcodeResult;
pub use expression::BinaryOperator;
pub use expression::Binop;
pub use expression::Builtin;
pub use expression::Expression;
pub use expression::ExpressionTy;
pub use expression::Ident;
pub use expression::Load;
pub use expression::LocalVarId;
pub use expression::LocalVarInterner;
pub use expression::Range;
pub use expression::RangeParam;
pub use expression::SpaceRef as PcodeSpaceRef;
pub use expression::UnaryOperator;
pub use expression::Unop;
pub use expression::pretty_print_ident;
pub use instruction::BitRangeInfo;
pub use instruction::BodyWidths;
pub use instruction::InstructionPcode;
pub use instruction::LabelId;
pub use instruction::LocalSizes;
pub use instruction::Opcode;
pub use instruction::PcodeLowerError;
pub use instruction::PcodeLoweringContext;
pub use instruction::PcodeOp;
pub use instruction::PcodePlan;
pub use instruction::PcodeSink;
pub use instruction::SymbolicWidth;
pub use instruction::Varnode;
pub use instruction::Width;
pub use instruction::emit_instruction;
pub use instruction::infer_local_sizes;
pub use instruction::lower_instruction;
pub use instruction::lower_instruction_into;
pub use instruction::plan_instruction;
pub use instruction::plan_instruction_with;
pub use instruction::resolve_body_widths;
pub use register::Register;
pub use register::RegisterId;
pub use register::RegisterMutRef;
pub use register::RegisterRef;
pub use space::SPACE_CONST;
pub use space::Space;
pub use space::SpaceId;
pub use space::SpaceRef;
pub use space::SpaceStore;
pub use space::SpaceType;
pub use statement::Ast;
pub use statement::AstNode;
pub use statement::DelaySlotArg;
pub use statement::LabelOrNode;

Modules§

error
Errors raised while lowering and expanding SLEIGH p-code semantics.
expression
instruction
Ghidra-style, flat p-code operations and their operands.
register
Processor registers as named, fixed-size slices of a memory space.
space
Memory spaces: uniformly-addressed regions that values live in.
statement

Structs§

BitRangeFieldId
Identifier of a named register bit range.
FieldId
Identifier used by source-shaped p-code for a decoder field.
PCodeOpId
A stable identifier for a user-defined p-code operation.
PMacroId
Identifier of a p-code macro definition.
PcodeAst
Backend-neutral, source-shaped p-code AST for one decoded instruction.
TableId
Identifier used by build statements for a decoder table.

Traits§

PcodeResolver
Supplies names for formatting a p-code AST without coupling it to a particular producer such as SLEIGH.