Skip to content

Commit 7bb0a89

Browse files
committed
Remove panic from invalid pc value
1 parent 34ddfd7 commit 7bb0a89

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/gdb/exec_result/recv/value.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ pub fn recv_exec_result_value(state: &mut State, value: &String) {
1818
} else {
1919
// program is stopped, get the current pc
2020
let pc: Vec<&str> = value.split_whitespace().collect();
21-
let pc = pc[0].strip_prefix("0x").unwrap();
22-
state.current_pc = u64::from_str_radix(pc, 16).unwrap();
21+
if let Some(pc) = pc[0].strip_prefix("0x") {
22+
state.current_pc = u64::from_str_radix(pc, 16).unwrap();
23+
}
2324
}
2425
}

0 commit comments

Comments
 (0)