From 04f34ac7afda04a20b86ba1f0eedfbeebc62ca41 Mon Sep 17 00:00:00 2001 From: YoshiRulz Date: Mon, 7 Nov 2022 04:37:34 +1000 Subject: [PATCH] Add `Util.BreakDebuggerIfAttached` helper --- src/BizHawk.Common/Util.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/BizHawk.Common/Util.cs b/src/BizHawk.Common/Util.cs index 86ffca0134..eb28b3a6e1 100644 --- a/src/BizHawk.Common/Util.cs +++ b/src/BizHawk.Common/Util.cs @@ -11,6 +11,12 @@ namespace BizHawk.Common { public static unsafe class Util { + [Conditional("DEBUG")] + public static void BreakDebuggerIfAttached() + { + if (Debugger.IsAttached) Debugger.Break(); + } + public static void CopyStream(Stream src, Stream dest, long len) { const int size = 0x2000;