From a006043c26dfcac6b1c24182032ee748ac95b9a9 Mon Sep 17 00:00:00 2001 From: mrexodia Date: Sun, 20 Dec 2015 07:12:42 +0100 Subject: [PATCH] totally not hacky way of detecting duplicate step callbacks --- GleeBug/Debugger.Thread.cpp | 10 ++++++++++ GleeBug/GleeBug.h | 1 + 2 files changed, 11 insertions(+) diff --git a/GleeBug/Debugger.Thread.cpp b/GleeBug/Debugger.Thread.cpp index f05d445..e68db0b 100644 --- a/GleeBug/Debugger.Thread.cpp +++ b/GleeBug/Debugger.Thread.cpp @@ -76,6 +76,16 @@ namespace GleeBug void ThreadInfo::StepInto(const StepCallback & cbStep) { StepInto(); + + auto target = cbStep.target(); + for (const auto & cb : stepCallbacks) + { + if (target == cb.target()) + { + puts("duplicate StepInto callback detected!"); + return; + } + } stepCallbacks.push_back(cbStep); } diff --git a/GleeBug/GleeBug.h b/GleeBug/GleeBug.h index 6cbd9c6..c4faa4e 100644 --- a/GleeBug/GleeBug.h +++ b/GleeBug/GleeBug.h @@ -5,6 +5,7 @@ #include #include #include +#include #include #include #include