Skip to content

Commit

Permalink
Allow rewinding on exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
1whatleytay committed Feb 13, 2024
1 parent c7f1907 commit e97b754
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src-tauri/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 1 addition & 3 deletions src-tauri/src/state/commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,7 @@ pub async fn resume(

#[tauri::command]
pub fn rewind(state: tauri::State<'_, DebuggerBody>, count: u32) -> Option<ResumeResult> {
let Some(pointer) = &*state.lock().unwrap() else { return None };

Some(pointer.rewind(count))
Some(state.lock().unwrap().as_ref()?.rewind(count))
}

#[tauri::command]
Expand Down
2 changes: 2 additions & 0 deletions src-tauri/src/state/execution.rs
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,8 @@ impl<Mem: Memory> ExecutionRewindable for ExecutionState<WatchedMemory<Mem>, His
})
};

self.debugger.pause();

self.debugger.with_state(|state| {
entry.apply(&mut state.registers, &mut state.memory.backing);
});
Expand Down

0 comments on commit e97b754

Please sign in to comment.