diff options
author | Henrik Rydgard <hrydgard@gmail.com> | 2016-04-24 14:19:49 +0200 |
---|---|---|
committer | Henrik Rydgard <hrydgard@gmail.com> | 2016-04-24 14:19:49 +0200 |
commit | 01a1555b5d6d6b560c3168b76e5235175e7d081b (patch) | |
tree | 967156d129f91b2887560028f17856f121bd25e3 /src/video_core/debug_utils/debug_utils.h | |
parent | Merge pull request #1576 from smspillaz/fix-build-errors-03272016 (diff) | |
download | yuzu-01a1555b5d6d6b560c3168b76e5235175e7d081b.tar yuzu-01a1555b5d6d6b560c3168b76e5235175e7d081b.tar.gz yuzu-01a1555b5d6d6b560c3168b76e5235175e7d081b.tar.bz2 yuzu-01a1555b5d6d6b560c3168b76e5235175e7d081b.tar.lz yuzu-01a1555b5d6d6b560c3168b76e5235175e7d081b.tar.xz yuzu-01a1555b5d6d6b560c3168b76e5235175e7d081b.tar.zst yuzu-01a1555b5d6d6b560c3168b76e5235175e7d081b.zip |
Diffstat (limited to '')
-rw-r--r-- | src/video_core/debug_utils/debug_utils.h | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/video_core/debug_utils/debug_utils.h b/src/video_core/debug_utils/debug_utils.h index 7df941619..56f9bd958 100644 --- a/src/video_core/debug_utils/debug_utils.h +++ b/src/video_core/debug_utils/debug_utils.h @@ -114,7 +114,15 @@ public: * @param event Event which has happened * @param data Optional data pointer (pass nullptr if unused). Needs to remain valid until Resume() is called. */ - void OnEvent(Event event, void* data); + void OnEvent(Event event, void* data) { + // This check is left in the header to allow the compiler to inline it. + if (!breakpoints[(int)event].enabled) + return; + // For the rest of event handling, call a separate function. + DoOnEvent(event, data); + } + + void DoOnEvent(Event event, void *data); /** * Resume from the current breakpoint. @@ -126,12 +134,14 @@ public: * Delete all set breakpoints and resume emulation. */ void ClearBreakpoints() { - breakpoints.clear(); + for (auto &bp : breakpoints) { + bp.enabled = false; + } Resume(); } // TODO: Evaluate if access to these members should be hidden behind a public interface. - std::map<Event, BreakPoint> breakpoints; + std::array<BreakPoint, (int)Event::NumEvents> breakpoints; Event active_breakpoint; bool at_breakpoint = false; |