pub struct Region { /* private fields */ }Implementations§
Source§impl Region
impl Region
pub fn new(space: AddressSpace, platform: Option<PlatformRef>) -> Self
Sourcepub fn set_operand_type(
&mut self,
offset: AddressValue,
kind: OperandType,
) -> Option<OperandType>
pub fn set_operand_type( &mut self, offset: AddressValue, kind: OperandType, ) -> Option<OperandType>
Record what the ambiguous operand of the instruction at offset names.
Sourcepub fn clear_operand_type(
&mut self,
offset: AddressValue,
) -> Option<OperandType>
pub fn clear_operand_type( &mut self, offset: AddressValue, ) -> Option<OperandType>
Forget the decision for the instruction at offset.
pub fn operand_type(&self, offset: AddressValue) -> Option<OperandType>
Sourcepub fn operand_types(
&self,
) -> impl Iterator<Item = (AddressValue, OperandType)> + '_
pub fn operand_types( &self, ) -> impl Iterator<Item = (AddressValue, OperandType)> + '_
Every disambiguated operand, in address order.
Sourcepub fn disable_platform_address(
&mut self,
offset: AddressValue,
reason: String,
) -> Option<String>
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.
Sourcepub fn enable_platform_address(
&mut self,
offset: AddressValue,
) -> Option<String>
pub fn enable_platform_address( &mut self, offset: AddressValue, ) -> Option<String>
Restore the platform’s claim about offset, returning the reason it had.
pub fn platform_address_disabled(&self, offset: AddressValue) -> bool
Sourcepub fn disabled_platform_addresses(
&self,
) -> impl Iterator<Item = (AddressValue, &str)> + '_
pub fn disabled_platform_addresses( &self, ) -> impl Iterator<Item = (AddressValue, &str)> + '_
Every disabled address with its reason, in address order.
Sourcepub fn set_address_bits(&mut self, bits: Option<u8>) -> Option<u8>
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.
pub fn address_bits(&self) -> Option<u8>
Sourcepub fn effective(&self, offset: AddressValue) -> AddressValue
pub fn effective(&self, offset: AddressValue) -> AddressValue
The byte an address actually reaches after set_address_bits is applied.
Sourcepub fn set_operand_override(
&mut self,
addr: AddressValue,
index: u8,
value: Option<OperandOverride>,
) -> Option<OperandOverride>
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.
Sourcepub fn auto_disassemble(&mut self, start: AddressValue) -> AutoDisassembleResult
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.
pub fn add_auto_root(&mut self, start: AddressValue)
Sourcepub fn remove_auto_root(&mut self, start: AddressValue) -> bool
pub fn remove_auto_root(&mut self, start: AddressValue) -> bool
Removing a root re-derives weak, so code reachable only through it drops.
pub fn is_auto_root(&self, start: AddressValue) -> bool
pub fn set_bytes( &mut self, file: &str, file_offset: usize, offset: AddressValue, bytes: &[u8], )
pub fn map_bytes( &mut self, file: &str, file_offset: usize, offset: AddressValue, bytes: &[u8], )
pub fn set_constant( &mut self, offset: AddressValue, size: AddressValue, value: u8, )
pub fn find_bytes( &self, pattern: &BytePattern, ) -> impl Iterator<Item = Range<AddressValue>>
Sourcepub fn find_bytes_in(
&self,
pattern: &BytePattern,
range: impl RangeBounds<AddressValue>,
) -> impl Iterator<Item = Range<AddressValue>>
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.
pub fn unmap_bytes(&mut self, offset: AddressValue, size: AddressValue)
pub fn set_equivalent( &mut self, offset: AddressValue, equivalent: Equivalent, ) -> Result<&EquivalentRange, Error>
pub fn clear_equivalents(&mut self, offset: AddressValue, size: AddressValue)
pub fn snapshot_equivalents( &self, offset: AddressValue, size: AddressValue, ) -> Vec<(AddressValue, EquivalentRange)>
Sourcepub fn has_equivalent(&self, offset: AddressValue) -> bool
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.
pub fn get_equivalent_kind( &self, offset: AddressValue, ) -> Option<EquivalentKind>
pub fn get_equivalent(&self, offset: AddressValue) -> EquivalentAt<'_>
Sourcepub fn set_label(
&mut self,
offset: AddressValue,
label: &str,
attrs: LabelAttrs,
)
pub fn set_label( &mut self, offset: AddressValue, label: &str, attrs: LabelAttrs, )
Name offset.
Sourcepub fn is_local_label(&self, offset: AddressValue) -> bool
pub fn is_local_label(&self, offset: AddressValue) -> bool
Whether the label at offset is scoped to its enclosing routine.
Sourcepub fn scope_of(&self, offset: AddressValue) -> Option<AddressValue>
pub fn scope_of(&self, offset: AddressValue) -> Option<AddressValue>
The nearest non-local label at or before offset.
Sourcepub fn instruction_range(
&self,
offset: AddressValue,
) -> Option<(AddressValue, AddressValue)>
pub fn instruction_range( &self, offset: AddressValue, ) -> Option<(AddressValue, AddressValue)>
The extent of the instruction decoded at offset, if one starts there.
Sourcepub fn covering_instruction(
&self,
offset: AddressValue,
) -> Option<(AddressValue, AddressValue)>
pub fn covering_instruction( &self, offset: AddressValue, ) -> Option<(AddressValue, AddressValue)>
The instruction offset falls inside, if it is not at its start.
Sourcepub fn covering_address_bits(&self) -> u8
pub fn covering_address_bits(&self) -> u8
Narrowest address width covering every mapped byte.
Sourcepub fn mapping_gaps(&self) -> Vec<(AddressValue, AddressValue)>
pub fn mapping_gaps(&self) -> Vec<(AddressValue, AddressValue)>
Unmapped stretches sitting between mapped bytes that should arguably be mapper or filled.
Sourcepub fn has_byte(&self, offset: AddressValue) -> bool
pub fn has_byte(&self, offset: AddressValue) -> bool
Whether offset has a mapped byte.
Sourcepub fn is_draft_label(&self, offset: AddressValue) -> bool
pub fn is_draft_label(&self, offset: AddressValue) -> bool
Whether the label at offset is a working guess rather than finalized.
pub fn clear_label(&mut self, offset: AddressValue)
pub fn get_label(&self, offset: AddressValue) -> Option<&str>
pub fn set_comment(&mut self, offset: AddressValue, comment: &str)
pub fn clear_comment(&mut self, offset: AddressValue)
pub fn get_comment(&self, offset: AddressValue) -> Option<&str>
pub fn set_function(&mut self, function: Function)
pub fn get_function(&self, offset: AddressValue) -> Option<&Function>
Sourcepub fn labels(&self) -> impl Iterator<Item = (AddressValue, &str)>
pub fn labels(&self) -> impl Iterator<Item = (AddressValue, &str)>
Every label in this region, in ascending address order.
Sourcepub fn functions(&self) -> impl Iterator<Item = (AddressValue, &Function)>
pub fn functions(&self) -> impl Iterator<Item = (AddressValue, &Function)>
Every function in this region, in ascending address order.
pub fn clear_function(&mut self, offset: AddressValue)
Sourcepub fn clear_labels_in(
&mut self,
range: impl RangeBounds<AddressValue>,
) -> Vec<(AddressValue, String)>
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).
Sourcepub fn clear_comments_in(
&mut self,
range: impl RangeBounds<AddressValue>,
) -> Vec<(AddressValue, String)>
pub fn clear_comments_in( &mut self, range: impl RangeBounds<AddressValue>, ) -> Vec<(AddressValue, String)>
Remove every comment in range, returning the removed pairs.
Sourcepub fn clear_functions_in(
&mut self,
range: impl RangeBounds<AddressValue>,
) -> Vec<(AddressValue, Function)>
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.
pub fn byte_at(&self, offset: AddressValue) -> Option<u8>
pub fn read_u16_le(&self, offset: AddressValue) -> Option<u16>
pub fn read_u16_be(&self, offset: AddressValue) -> Option<u16>
pub fn bytes_at(&self, offset: AddressValue, size: AddressValue) -> Vec<u8> ⓘ
Sourcepub fn space_usage(&self) -> SpaceUsage
pub fn space_usage(&self) -> SpaceUsage
Count mapped bytes classified as code, data, or undefined (no equivalent).