From 85c11c6fefd69fe9db60cf3bdcd706ef71d2173d Mon Sep 17 00:00:00 2001 From: Peter Veenstra Date: Wed, 14 Jan 2015 12:31:01 +0000 Subject: [PATCH] Add C_DEBUG checks around C_HEAVY_DEBUG, so you can leave C_HEAVY_DEBUG defined. Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@3893 --- src/cpu/core_dyn_x86.cpp | 12 ++++++++++-- src/cpu/core_dynrec.cpp | 6 ++++++ 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/cpu/core_dyn_x86.cpp b/src/cpu/core_dyn_x86.cpp index ac05a569..0045394a 100644 --- a/src/cpu/core_dyn_x86.cpp +++ b/src/cpu/core_dyn_x86.cpp @@ -261,9 +261,11 @@ Bits CPU_Core_Dyn_X86_Run(void) { /* Determine the linear address of CS:EIP */ restart_core: PhysPt ip_point=SegPhys(cs)+reg_eip; - #if C_HEAVY_DEBUG +#if C_DEBUG +#if C_HEAVY_DEBUG if (DEBUG_HeavyIsBreakpoint()) return debugCallback; - #endif +#endif +#endif CodePageHandler * chandler=0; if (GCC_UNLIKELY(MakeCodePage(ip_point,chandler))) { CPU_Exception(cpu.exception.which,cpu.exception.error); @@ -296,11 +298,13 @@ run_block: BlockReturn ret=gen_runcode(block->cache.start); switch (ret) { case BR_Iret: +#if C_DEBUG #if C_HEAVY_DEBUG if (DEBUG_HeavyIsBreakpoint()) { if (dyn_dh_fpu.state_used) DH_FPU_SAVE_REINIT return debugCallback; } +#endif #endif if (!GETFLAG(TF)) { if (GETFLAG(IF) && PIC_IRQCheck) { @@ -315,13 +319,17 @@ run_block: return CBRET_NONE; case BR_Normal: /* Maybe check if we staying in the same page? */ +#if C_DEBUG #if C_HEAVY_DEBUG if (DEBUG_HeavyIsBreakpoint()) return debugCallback; +#endif #endif goto restart_core; case BR_Cycles: +#if C_DEBUG #if C_HEAVY_DEBUG if (DEBUG_HeavyIsBreakpoint()) return debugCallback; +#endif #endif if (!dyn_dh_fpu.state_used) return CBRET_NONE; DH_FPU_SAVE_REINIT diff --git a/src/cpu/core_dynrec.cpp b/src/cpu/core_dynrec.cpp index f1d68d67..1571fb43 100644 --- a/src/cpu/core_dynrec.cpp +++ b/src/cpu/core_dynrec.cpp @@ -232,8 +232,10 @@ run_block: switch (ret) { case BR_Iret: +#if C_DEBUG #if C_HEAVY_DEBUG if (DEBUG_HeavyIsBreakpoint()) return debugCallback; +#endif #endif if (!GETFLAG(TF)) { if (GETFLAG(IF) && PIC_IRQCheck) return CBRET_NONE; @@ -248,16 +250,20 @@ run_block: // modifying instruction (like ret) or some nontrivial cpu state // changing instruction (for example switch to/from pmode), // or the maximum number of instructions to translate was reached +#if C_DEBUG #if C_HEAVY_DEBUG if (DEBUG_HeavyIsBreakpoint()) return debugCallback; +#endif #endif break; case BR_Cycles: // cycles went negative, return from the core to handle // external events, schedule the pic... +#if C_DEBUG #if C_HEAVY_DEBUG if (DEBUG_HeavyIsBreakpoint()) return debugCallback; +#endif #endif return CBRET_NONE;