File tree 1 file changed +6
-7
lines changed
1 file changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -5,24 +5,23 @@ extern "C" {
5
5
}
6
6
7
7
std::unordered_map<u64, Breakpoint> breakpoints;
8
+ // The debugger was just stepped - we should break on the next instruction
9
+ bool break_for_step = false ;
8
10
9
11
bool check_breakpoint (u64 address) {
10
- bool hit = breakpoints.find (address) != breakpoints.end ();
12
+ bool hit = breakpoints.find (address) != breakpoints.end () || break_for_step ;
11
13
if (hit) {
12
14
n64sys.debugger_state .broken = true ;
13
- if (breakpoints[address].temporary ) {
15
+ if (breakpoints. find (address) != breakpoints. end () && breakpoints [address].temporary ) {
14
16
breakpoints.erase (address);
15
17
}
18
+ break_for_step = false ;
16
19
}
17
20
return hit;
18
21
}
19
22
20
23
void debugger_step () {
21
- // To step once, set a temporary breakpoint at the next PC and unpause
22
- // If a breakpoint already exists at the address, just unpause and we'll hit it.
23
- if (breakpoints.find (N64CPU.next_pc ) == breakpoints.end ()) {
24
- breakpoints[N64CPU.next_pc ] = {N64CPU.next_pc , true };
25
- }
24
+ break_for_step = true ;
26
25
n64sys.debugger_state .broken = false ;
27
26
}
28
27
You can’t perform that action at this time.
0 commit comments