From e477928adcf5df56340e29d7e1cebdd98f0aa1f8 Mon Sep 17 00:00:00 2001 From: ketmar Date: Fri, 3 Nov 2023 20:39:47 +0000 Subject: [PATCH] turned off interactive debugger (but still generate debug info for backtraces; i have to write backtrace word yet) this makes the system slightly faster. FossilOrigin-Name: c1cbd298fca0543ddfec43df3441b6ff71cd93ad0791d125fd58aa0cabcaee86 --- level1/05_base_vars.f | 1 + level1/17_dp.f | 6 +++--- level1/19_dbg_info.f | 2 +- level1/70_compiler_90_helpers.f | 2 +- level1/urforth.f | 1 + meta/asm-metc.f | 11 +++++++++-- meta/meta-14-asm-defconsts.f | 1 + meta/meta-40-tc-compiler-00-dbginfo.f | 7 +++++-- 8 files changed, 22 insertions(+), 9 deletions(-) diff --git a/level1/05_base_vars.f b/level1/05_base_vars.f index b7aa048..6b2de9b 100644 --- a/level1/05_base_vars.f +++ b/level1/05_base_vars.f @@ -172,6 +172,7 @@ $value "ENVP" 0 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; $constant "HAS-DEBUGGER?" URFORTH_DEBUG +$constant "HAS-DEBUG-INFO?" URFORTH_DEBUG_INFO $constant "ALIGN-HEADERS?" URFORTH_ALIGN_HEADERS $constant "ALIGN-CFA?" URFORTH_ALIGN_CFA $constant "ALIGN-PFA?" URFORTH_ALIGN_PFA diff --git a/level1/17_dp.f b/level1/17_dp.f index 7bb6135..a7a4920 100644 --- a/level1/17_dp.f +++ b/level1/17_dp.f @@ -137,21 +137,21 @@ endcode : C, ( c -- ) - $if URFORTH_DEBUG + $if URFORTH_DEBUG_INFO (dbginfo-add-here) $endif 1 n-allot c! ; : W, ( w -- ) - $if URFORTH_DEBUG + $if URFORTH_DEBUG_INFO (dbginfo-add-here) $endif 2 n-allot w! ; : , ( n -- ) - $if URFORTH_DEBUG + $if URFORTH_DEBUG_INFO (dbginfo-add-here) $endif cell n-allot ! diff --git a/level1/19_dbg_info.f b/level1/19_dbg_info.f index 3ccfdec..dff25db 100644 --- a/level1/19_dbg_info.f +++ b/level1/19_dbg_info.f @@ -25,7 +25,7 @@ ;; that is, the range for the line lasts until the next item ;; items should be sorted by PC (but the code should not fail on ;; unsorted data) -$if URFORTH_DEBUG +$if URFORTH_DEBUG_INFO ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; $constant "(DBGBUF-MAXSIZE)" 1024*64 diff --git a/level1/70_compiler_90_helpers.f b/level1/70_compiler_90_helpers.f index d155fdf..69f569b 100644 --- a/level1/70_compiler_90_helpers.f +++ b/level1/70_compiler_90_helpers.f @@ -116,7 +116,7 @@ alias @ (BRANCH-ADDR@) ( addr -- dest ) : forth-word-epilogue ( -- ) create; - $if URFORTH_DEBUG + $if URFORTH_DEBUG_INFO ;; save debug info (this also resets and deactivates it) (dbginfo-finalize-and-copy) $endif diff --git a/level1/urforth.f b/level1/urforth.f index adde93a..f58c192 100644 --- a/level1/urforth.f +++ b/level1/urforth.f @@ -12,6 +12,7 @@ $entry urforth_entry_point ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; URFORTH_DEBUG equ URFORTH_DEBUGGER_ENABLED +URFORTH_DEBUG_INFO equ URFORTH_DEBUG_INFO_ENABLED URFORTH_EXTRA_STACK_CHECKS equ 0 ;; various compile-time options diff --git a/meta/asm-metc.f b/meta/asm-metc.f index 2edf181..467d5b2 100644 --- a/meta/asm-metc.f +++ b/meta/asm-metc.f @@ -46,7 +46,10 @@ false to tc-align-pfa true value tc-dynamic-binary ;; set to `false` to omit debugger (faster, but no debugger at all) -true value tc-debugger-enabled +;; disable interactive debugger, i don't need it. the system is faster this way. +false value tc-debugger-enabled +;; but enable debug info for backtraces +true value tc-debug-info-enabled false value tc-verbose @@ -55,7 +58,8 @@ enum{ value tc-nhash-joaat ;; use Bob Jenkins' One-At-A-Time for hashing word names? value tc-nhash-rot ;; use rotating hash } -tc-nhash-rot value tc-wordhash-type +\ tc-nhash-rot value tc-wordhash-type +tc-nhash-joaat value tc-wordhash-type enum{ value tc-tls-none @@ -636,6 +640,9 @@ also cliargs definitions : --debug ( -- ) true to tc-debugger-enabled ; : --no-debug ( -- ) false to tc-debugger-enabled ; +: --debug-info ( -- ) true to tc-debug-info-enabled ; +: --no-debug-info ( -- ) false to tc-debug-info-enabled ; + : --opt-alias ( -- ) true to tc-opt-aliases? ; : --no-opt-alias ( -- ) false to tc-opt-aliases? ; diff --git a/meta/meta-14-asm-defconsts.f b/meta/meta-14-asm-defconsts.f index e7d0c0a..2e847b4 100644 --- a/meta/meta-14-asm-defconsts.f +++ b/meta/meta-14-asm-defconsts.f @@ -26,6 +26,7 @@ " URFORTH_NAME_HASH_ROT" tc-nhash-rot asmx86:asm-Make-Constant " URFORTH_DEBUGGER_ENABLED" tc-debugger-enabled notnot asmx86:asm-Make-Constant + " URFORTH_DEBUG_INFO_ENABLED" tc-debug-info-enabled notnot asmx86:asm-Make-Constant " URFORTH_MAX_WORD_NAME_LENGTH" tc-max-word-name-length asmx86:asm-Make-Constant diff --git a/meta/meta-40-tc-compiler-00-dbginfo.f b/meta/meta-40-tc-compiler-00-dbginfo.f index 122dd96..927c359 100644 --- a/meta/meta-40-tc-compiler-00-dbginfo.f +++ b/meta/meta-40-tc-compiler-00-dbginfo.f @@ -15,7 +15,8 @@ false value tc-(dbginfo-active?) (hidden) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; : tc-debug-info-on ( -- ) - tc-debugger-enabled to tc-(dbginfo-enabled?) + \ tc-debugger-enabled to tc-(dbginfo-enabled?) + tc-debug-info-enabled to tc-(dbginfo-enabled?) ; : tc-debug-info-off ( -- ) @@ -29,7 +30,9 @@ false value tc-(dbginfo-active?) (hidden) false to tc-(dbginfo-active?) ;; set first line to 0 (to ease checks in "add-pc") tc-(dbgbuf-base-addr) ?dup if 0! endif - tc-debugger-enabled to tc-(dbginfo-enabled?) + \ tc-debugger-enabled to tc-(dbginfo-enabled?) + ;; we still need debug info for backtraces + tc-debug-info-enabled to tc-(dbginfo-enabled?) ; (hidden) -- 2.11.4.GIT