Skip to content

Commit

Permalink
UI: Accept breakpoint with 0x360 or just 360
Browse files Browse the repository at this point in the history
  • Loading branch information
guerinoni committed Mar 3, 2024
1 parent 73d7a01 commit 1690784
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
2 changes: 1 addition & 1 deletion extra/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -e

which just > /dev/null || cargo install just
which just 2>&1 > /dev/null || cargo install just

just check-fmt
just lint
Expand Down
14 changes: 13 additions & 1 deletion ui/src/cpu_handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,10 +126,22 @@ impl UiTool for CpuHandler {
ui.text_edit_singleline(&mut self.b_address);

if ui.button("Add").clicked() {
if self.b_address.is_empty() {
return;
}

let a = if self.b_address.starts_with("0x") {
self.b_address[2..].to_string()
} else {
self.b_address.clone()
};

self.breakpoints
.lock()
.unwrap()
.insert(u32::from_str_radix(&self.b_address, 16).unwrap());
.insert(u32::from_str_radix(&a, 16).unwrap());

self.b_address.clear();
}
});

Expand Down

0 comments on commit 1690784

Please sign in to comment.