Skip to content

Commit

Permalink
refactoring(oracle): rename watch_point -> spy_point (watch_point nam…
Browse files Browse the repository at this point in the history
…e clashes with watchpoints)
  • Loading branch information
godzie44 committed Jun 15, 2024
1 parent e76ed24 commit 954ea60
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 10 deletions.
4 changes: 2 additions & 2 deletions src/debugger/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -517,8 +517,8 @@ impl Debugger {
let oracles = self.oracles.clone();
let ready_oracles = oracles.into_values().filter(|(_, a)| *a);
for (oracle, _) in ready_oracles {
let watch_points = oracle.watch_points();
for request in watch_points {
let spy_points = oracle.spy_points();
for request in spy_points {
weak_error!(self.set_transparent_breakpoint(request));
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/oracle/builtin/nop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ impl Oracle for NopOracle {
true
}

fn watch_points(self: Arc<Self>) -> Vec<CreateTransparentBreakpointRequest> {
fn spy_points(self: Arc<Self>) -> Vec<CreateTransparentBreakpointRequest> {
vec![]
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/oracle/builtin/tokio.rs
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ impl Oracle for TokioOracle {
true
}

fn watch_points(self: Arc<Self>) -> Vec<CreateTransparentBreakpointRequest> {
fn spy_points(self: Arc<Self>) -> Vec<CreateTransparentBreakpointRequest> {
let oracle = self.clone();
let poll_handler = move |dbg: &mut Debugger| {
if let Err(e) = oracle.on_poll(dbg) {
Expand Down
9 changes: 3 additions & 6 deletions src/oracle/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,7 @@ pub trait Oracle: ConsolePlugin + TuiPlugin {
/// * `dbg`: debugger instance
fn ready_for_install(&self, dbg: &Debugger) -> bool;

/// A list of watch_point using by oracle.
/// In debugger watch point implemented by transparent breakpoints.
///
/// FIXME now oracle `watchpoint` name clashes with debugger watchpoint (data breakpoint).
/// Let's rename it.
fn watch_points(self: Arc<Self>) -> Vec<CreateTransparentBreakpointRequest>;
/// A list of spy-points using by oracle.
/// In debugger spy-point implemented by transparent breakpoints.
fn spy_points(self: Arc<Self>) -> Vec<CreateTransparentBreakpointRequest>;
}

0 comments on commit 954ea60

Please sign in to comment.