From e5cc1565fdec89aae179b798dd0e336762d3de74 Mon Sep 17 00:00:00 2001 From: Lauchmelder Date: Tue, 1 Mar 2022 12:06:40 +0100 Subject: [PATCH] breakpoints can now be deleted --- src/debugger/Disassembler.cpp | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/debugger/Disassembler.cpp b/src/debugger/Disassembler.cpp index a15659d..51f9e8a 100644 --- a/src/debugger/Disassembler.cpp +++ b/src/debugger/Disassembler.cpp @@ -227,10 +227,20 @@ void Disassembler::BreakpointWindow() ImGui::Separator(); char label[6]; - for (const Breakpoint& breakpoint : breakpoints) + for (std::set::const_iterator it = breakpoints.begin(); it != breakpoints.end(); ) { - std::sprintf(label, "$%04X", breakpoint.GetAddress()); - ImGui::Checkbox(label, &breakpoint.active); + if (ImGui::Button("X")) + { + it = breakpoints.erase(it); + continue; + } + + ImGui::SameLine(); + + std::sprintf(label, "$%04X", it->GetAddress()); + ImGui::Checkbox(label, &it->active); + + it++; } ImGui::End();