Skip to content

Commit

Permalink
Include field information when using --probe for register writes
Browse files Browse the repository at this point in the history
  • Loading branch information
bacam committed Apr 29, 2024
1 parent bdd2369 commit fd750c0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
6 changes: 1 addition & 5 deletions isla-lib/src/executor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -582,11 +582,7 @@ fn assign<'ir, B: BV>(
) -> Result<(), ExecError> {
let id = loc.id();
if shared_state.probes.contains(&id) {
let mut symbol = String::from(shared_state.symtab.to_str(id));
if symbol.starts_with('z') {
symbol = zencode::decode(&symbol);
}
log_from!(tid, log::PROBE, &format!("Assigning {}[{:?}] <- {:?}", symbol, id, v))
log_from!(tid, log::PROBE, &format!("Assigning {}[{:?}] <- {:?}", loc_string(loc, &shared_state.symtab), id, v))
}

assign_with_accessor(loc, v, local_state, shared_state, solver, &mut Vec::new(), info)
Expand Down
8 changes: 8 additions & 0 deletions isla-lib/src/ir.rs
Original file line number Diff line number Diff line change
Expand Up @@ -905,6 +905,14 @@ impl<'ir> Symtab<'ir> {
}
}

pub fn loc_string(loc: &Loc<Name>, symtab: &Symtab) -> String {
match loc {
Loc::Id(a) => zencode::decode(symtab.to_str(*a)),
Loc::Field(loc, a) => format!("{}.{}", loc_string(loc, symtab), zencode::decode(symtab.to_str(*a))),
Loc::Addr(a) => format!("{}*", loc_string(a, symtab)),
}
}

/// A function declaration is a tripe of name * type pairs of
/// parameters, the return type, and a list of instructions for the
/// function body.
Expand Down

0 comments on commit fd750c0

Please sign in to comment.