Skip to main content

Region

Struct Region 

Source
pub struct Region { /* private fields */ }

Implementations§

Source§

impl Region

Source

pub fn new(space: AddressSpace, platform: Option<PlatformRef>) -> Self

Source

pub fn set_operand_type( &mut self, offset: AddressValue, kind: OperandType, ) -> Option<OperandType>

Record what the ambiguous operand of the instruction at offset names.

Source

pub fn clear_operand_type( &mut self, offset: AddressValue, ) -> Option<OperandType>

Forget the decision for the instruction at offset.

Source

pub fn operand_type(&self, offset: AddressValue) -> Option<OperandType>

Source

pub fn operand_types( &self, ) -> impl Iterator<Item = (AddressValue, OperandType)> + '_

Every disambiguated operand, in address order.

Source

pub fn disable_platform_address( &mut self, offset: AddressValue, reason: String, ) -> Option<String>

Record that a platform address is disabled. Returns the previous reason, if it was already disabled.

Source

pub fn enable_platform_address( &mut self, offset: AddressValue, ) -> Option<String>

Restore the platform’s claim about offset, returning the reason it had.

Source

pub fn platform_address_disabled(&self, offset: AddressValue) -> bool

Source

pub fn disabled_platform_addresses( &self, ) -> impl Iterator<Item = (AddressValue, &str)> + '_

Every disabled address with its reason, in address order.

Source

pub fn set_address_bits(&mut self, bits: Option<u8>) -> Option<u8>

Narrow this space to the address lines the board decodes. None restores the full width. Returns the previous setting.

Source

pub fn address_bits(&self) -> Option<u8>

Source

pub fn effective(&self, offset: AddressValue) -> AddressValue

The byte an address actually reaches after set_address_bits is applied.

Source

pub fn set_operand_override( &mut self, addr: AddressValue, index: u8, value: Option<OperandOverride>, ) -> Option<OperandOverride>

Set or clear the override at (addr, index), returning the prior value.

Source

pub fn auto_disassemble(&mut self, start: AddressValue) -> AutoDisassembleResult

Auto-disassemble from start, recording it as a root (so the export is one auto_disassemble command). Returns the traversal diagnostics.

Source

pub fn add_auto_root(&mut self, start: AddressValue)

Source

pub fn remove_auto_root(&mut self, start: AddressValue) -> bool

Removing a root re-derives weak, so code reachable only through it drops.

Source

pub fn is_auto_root(&self, start: AddressValue) -> bool

Source

pub fn set_bytes( &mut self, file: &str, file_offset: usize, offset: AddressValue, bytes: &[u8], )

Source

pub fn map_bytes( &mut self, file: &str, file_offset: usize, offset: AddressValue, bytes: &[u8], )

Source

pub fn set_constant( &mut self, offset: AddressValue, size: AddressValue, value: u8, )

Source

pub fn find_bytes( &self, pattern: &BytePattern, ) -> impl Iterator<Item = Range<AddressValue>>

Source

pub fn find_bytes_in( &self, pattern: &BytePattern, range: impl RangeBounds<AddressValue>, ) -> impl Iterator<Item = Range<AddressValue>>

Find bytes in a specific range (.. searches the whole region).

Cross-byte-range matches and constant-byte-range matches do not currently work.

Source

pub fn unmap_bytes(&mut self, offset: AddressValue, size: AddressValue)

Source

pub fn set_equivalent( &mut self, offset: AddressValue, equivalent: Equivalent, ) -> Result<&EquivalentRange, Error>

Source

pub fn clear_equivalents(&mut self, offset: AddressValue, size: AddressValue)

Source

pub fn snapshot_equivalents( &self, offset: AddressValue, size: AddressValue, ) -> Vec<(AddressValue, EquivalentRange)>

Source

pub fn has_equivalent(&self, offset: AddressValue) -> bool

Whether a strong equivalent covers offset. Strong-only: a barrier may overwrite weak code, which then re-derives.

Source

pub fn get_equivalent_kind( &self, offset: AddressValue, ) -> Option<EquivalentKind>

Source

pub fn get_equivalent(&self, offset: AddressValue) -> EquivalentAt<'_>

Source

pub fn set_label( &mut self, offset: AddressValue, label: &str, attrs: LabelAttrs, )

Name offset.

Source

pub fn is_local_label(&self, offset: AddressValue) -> bool

Whether the label at offset is scoped to its enclosing routine.

Source

pub fn scope_of(&self, offset: AddressValue) -> Option<AddressValue>

The nearest non-local label at or before offset.

Source

pub fn instruction_range( &self, offset: AddressValue, ) -> Option<(AddressValue, AddressValue)>

The extent of the instruction decoded at offset, if one starts there.

Source

pub fn covering_instruction( &self, offset: AddressValue, ) -> Option<(AddressValue, AddressValue)>

The instruction offset falls inside, if it is not at its start.

Source

pub fn covering_address_bits(&self) -> u8

Narrowest address width covering every mapped byte.

Source

pub fn mapping_gaps(&self) -> Vec<(AddressValue, AddressValue)>

Unmapped stretches sitting between mapped bytes that should arguably be mapper or filled.

Source

pub fn has_byte(&self, offset: AddressValue) -> bool

Whether offset has a mapped byte.

Source

pub fn is_draft_label(&self, offset: AddressValue) -> bool

Whether the label at offset is a working guess rather than finalized.

Source

pub fn clear_label(&mut self, offset: AddressValue)

Source

pub fn get_label(&self, offset: AddressValue) -> Option<&str>

Source

pub fn set_comment(&mut self, offset: AddressValue, comment: &str)

Source

pub fn clear_comment(&mut self, offset: AddressValue)

Source

pub fn get_comment(&self, offset: AddressValue) -> Option<&str>

Source

pub fn set_function(&mut self, function: Function)

Source

pub fn get_function(&self, offset: AddressValue) -> Option<&Function>

Source

pub fn labels(&self) -> impl Iterator<Item = (AddressValue, &str)>

Every label in this region, in ascending address order.

Source

pub fn functions(&self) -> impl Iterator<Item = (AddressValue, &Function)>

Every function in this region, in ascending address order.

Source

pub fn clear_function(&mut self, offset: AddressValue)

Source

pub fn clear_labels_in( &mut self, range: impl RangeBounds<AddressValue>, ) -> Vec<(AddressValue, String)>

Remove every label in range, returning the removed (address, label) pairs (for undo).

Source

pub fn clear_comments_in( &mut self, range: impl RangeBounds<AddressValue>, ) -> Vec<(AddressValue, String)>

Remove every comment in range, returning the removed pairs.

Source

pub fn clear_functions_in( &mut self, range: impl RangeBounds<AddressValue>, ) -> Vec<(AddressValue, Function)>

Remove every function in range, returning the removed (address, function) pairs.

Source

pub fn byte_at(&self, offset: AddressValue) -> Option<u8>

Source

pub fn read_u16_le(&self, offset: AddressValue) -> Option<u16>

Source

pub fn read_u16_be(&self, offset: AddressValue) -> Option<u16>

Source

pub fn bytes_at(&self, offset: AddressValue, size: AddressValue) -> Vec<u8> ⓘ

Source

pub fn space_usage(&self) -> SpaceUsage

Count mapped bytes classified as code, data, or undefined (no equivalent).

Auto Trait Implementations§

§

impl !Freeze for Region

§

impl !RefUnwindSafe for Region

§

impl !UnwindSafe for Region

§

impl Forget for Region

§

impl Move for Region

§

impl Send for Region

§

impl Sync for Region

§

impl Unpin for Region

§

impl UnsafeUnpin for Region

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more