pub struct Db {
pub notes: NoteDb,
/* private fields */
}Fields§
§notes: NoteDbImplementations§
Source§impl Db
impl Db
Sourcepub fn new() -> Self
pub fn new() -> Self
A database with no CPU selected. A set_cpu command must run before any
disassembly.
Sourcepub fn with_platform(platform: PlatformRef) -> Self
pub fn with_platform(platform: PlatformRef) -> Self
A database with platform already selected.
Sourcepub fn platform(&self) -> Option<&dyn Platform>
pub fn platform(&self) -> Option<&dyn Platform>
The selected processor driver, or None if no CPU is set.
Sourcepub fn set_platform(
&mut self,
platform: Option<PlatformRef>,
) -> Option<PlatformRef>
pub fn set_platform( &mut self, platform: Option<PlatformRef>, ) -> Option<PlatformRef>
Select the CPU (or clear it with None), propagating it to every region
so their code re-derives. Returns the previous selection.
Sourcepub fn spaces(&self) -> Vec<AddressSpace>
pub fn spaces(&self) -> Vec<AddressSpace>
The address spaces to render, in order: the driver’s regions when a CPU is set, otherwise whatever spaces already hold mapped bytes.
Sourcepub fn resolve_space(&self, name: &str) -> Result<AddressSpace, Error>
pub fn resolve_space(&self, name: &str) -> Result<AddressSpace, Error>
Space names are driver-defined.
pub fn region(&self, space: AddressSpace) -> Option<&Region>
pub fn region_mut(&mut self, space: AddressSpace) -> &mut Region
pub fn xrefs_to(&self, target: &PhysicalAddr) -> Vec<Xref>
Sourcepub fn undecided_operands(
&self,
) -> Vec<(SpaceAddressValue, AddressValue, Vec<AddressSpace>)>
pub fn undecided_operands( &self, ) -> Vec<(SpaceAddressValue, AddressValue, Vec<AddressSpace>)>
Instructions with ambiguous operands, as (instruction, value, candidate spaces).
pub fn xrefs_from(&self, source: &PhysicalAddr) -> Vec<Xref>
Sourcepub fn basic_blocks(
&self,
space: AddressSpace,
entry: AddressValue,
) -> Vec<Block>
pub fn basic_blocks( &self, space: AddressSpace, entry: AddressValue, ) -> Vec<Block>
The control-flow graph of the routine rooted at entry in space.
Sourcepub fn peek(
&self,
space: AddressSpace,
start: AddressValue,
max_lines: usize,
) -> ScratchDecode
pub fn peek( &self, space: AddressSpace, start: AddressValue, max_lines: usize, ) -> ScratchDecode
Decode bytes as code from start without committing, for a caller to
judge whether a run is really code (see Region::scratch_decode).
Sourcepub fn peek_linear(
&self,
space: AddressSpace,
start: AddressValue,
end: AddressValue,
) -> ScratchDecode
pub fn peek_linear( &self, space: AddressSpace, start: AddressValue, end: AddressValue, ) -> ScratchDecode
Test-decode start..end as one straight run without committing, for a
caller about to commit the whole range as code (see
Region::scratch_decode_linear).
pub fn undecoded_entry_points(&self) -> Vec<EntryPoint>
Sourcepub fn resolve_thunk(
&self,
space: AddressSpace,
addr: AddressValue,
) -> AddressValue
pub fn resolve_thunk( &self, space: AddressSpace, addr: AddressValue, ) -> AddressValue
Follow pure jump thunks from addr to the ultimate target. Rendering
stays faithful to the bytes, so this is how a consumer asks where a call
or jump really ends up. Returns addr when it is not a thunk.
pub fn render(&self, space: AddressSpace) -> Vec<Line>
pub fn render_range( &self, space: AddressSpace, start: AddressValue, end: AddressValue, ) -> Vec<Line>
pub fn to_sdas(&self) -> String
pub fn to_commands(&self) -> Vec<Box<dyn Command>>
pub fn apply( &mut self, command: Box<dyn Command>, env: Option<&dyn Environment>, ) -> Result<Vec<Box<dyn Command>>, Error>
Sourcepub fn space_usage(&self, space: AddressSpace) -> SpaceUsage
pub fn space_usage(&self, space: AddressSpace) -> SpaceUsage
Byte counts for mapped content classified by equivalent kind.
pub fn clear_note( &mut self, id: &NoteId, ) -> Option<(AddressSpace, AddressRange, Note)>
pub fn note_tip(&self) -> Option<NoteId>
pub fn create_note(&mut self, content: impl Into<String>) -> Note
pub fn get_notes_overlapping( &self, space: AddressSpace, range: impl RangeBounds<AddressValue>, ) -> Vec<&Note>
pub fn get_notes_inside( &self, space: AddressSpace, range: impl RangeBounds<AddressValue>, ) -> Vec<&Note>
Sourcepub fn notes_near(
&self,
space: AddressSpace,
addr: AddressValue,
window: AddressValue,
) -> Vec<ProximateNote<'_>>
pub fn notes_near( &self, space: AddressSpace, addr: AddressValue, window: AddressValue, ) -> Vec<ProximateNote<'_>>
Notes within window bytes of addr, nearest first.
Sourcepub fn search_notes(&self, query: &str) -> Vec<&Note>
pub fn search_notes(&self, query: &str) -> Vec<&Note>
Notes matching query (case-insensitive over content, tags, fields).
Sourcepub fn note_location(&self, id: &NoteId) -> Option<(AddressSpace, AddressRange)>
pub fn note_location(&self, id: &NoteId) -> Option<(AddressSpace, AddressRange)>
Where a note is attached, if anywhere.
Source§impl Db
impl Db
Sourcepub fn diff_from(&self, base: &Db) -> Vec<Box<dyn Command>>
pub fn diff_from(&self, base: &Db) -> Vec<Box<dyn Command>>
The commands that transform base’s state into this DB’s state: a clear
for every base fact this DB changed or dropped, then a set for every fact
this DB has that base does not. Both sides are taken from the canonical
to_commands form, so identical facts cancel out.
Applying the result on top of base reproduces this DB exactly. Clears
come first so a shrunk range is wiped before the survivor is re-set.