Skip to content

Commit

Permalink
Merge pull request #19654 from hrydgard/additional-imdebugger-features
Browse files Browse the repository at this point in the history
ImDebugger: Add Breakpoints window
  • Loading branch information
hrydgard authored Nov 24, 2024
2 parents f692092 + 9138b79 commit fe38e88
Show file tree
Hide file tree
Showing 33 changed files with 495 additions and 295 deletions.
12 changes: 6 additions & 6 deletions Core/Core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ static void Core_PerformStep(MIPSDebugInterface *cpu, CPUStepType stepType, int
u32 currentPc = cpu->GetPC();
u32 newAddress = currentPc + stepSize;
// If the current PC is on a breakpoint, the user still wants the step to happen.
CBreakPoints::SetSkipFirst(currentPc);
g_breakpoints.SetSkipFirst(currentPc);
for (int i = 0; i < (int)(newAddress - currentPc) / 4; i++) {
currentMIPS->SingleStep();
}
Expand All @@ -271,7 +271,7 @@ static void Core_PerformStep(MIPSDebugInterface *cpu, CPUStepType stepType, int
u32 currentPc = cpu->GetPC();
u32 breakpointAddress = currentPc + stepSize;

CBreakPoints::SetSkipFirst(currentPc);
g_breakpoints.SetSkipFirst(currentPc);

MIPSAnalyst::MipsOpcodeInfo info = MIPSAnalyst::GetOpcodeInfo(cpu, cpu->GetPC());
if (info.isBranch) {
Expand All @@ -292,7 +292,7 @@ static void Core_PerformStep(MIPSDebugInterface *cpu, CPUStepType stepType, int
}
}

CBreakPoints::AddBreakPoint(breakpointAddress, true);
g_breakpoints.AddBreakPoint(breakpointAddress, true);
Core_Resume();
break;
}
Expand All @@ -319,8 +319,8 @@ static void Core_PerformStep(MIPSDebugInterface *cpu, CPUStepType stepType, int
u32 breakpointAddress = frames[1].pc;

// If the current PC is on a breakpoint, the user doesn't want to do nothing.
CBreakPoints::SetSkipFirst(currentMIPS->pc);
CBreakPoints::AddBreakPoint(breakpointAddress, true);
g_breakpoints.SetSkipFirst(currentMIPS->pc);
g_breakpoints.AddBreakPoint(breakpointAddress, true);
Core_Resume();
break;
}
Expand All @@ -345,7 +345,7 @@ void Core_ProcessStepping(MIPSDebugInterface *cpu) {
// We're not inside jit now, so it's safe to clear the breakpoints.
static int lastSteppingCounter = -1;
if (lastSteppingCounter != steppingCounter) {
CBreakPoints::ClearTemporaryBreakPoints();
g_breakpoints.ClearTemporaryBreakPoints();
System_Notify(SystemNotification::DISASSEMBLY_AFTERSTEP);
System_Notify(SystemNotification::MEM_VIEW);
lastSteppingCounter = steppingCounter;
Expand Down
Loading

0 comments on commit fe38e88

Please sign in to comment.