diff options
author | quantimnot <54247259+quantimnot@users.noreply.github.com> | 2022-06-10 14:40:08 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-10 20:40:08 +0200 |
commit | 6f4bacff67e2e219ef914e24d9f9aaf34a6d1eb1 (patch) | |
tree | a77b7708c6405f672dc7d105bc60cd0bf0f185a5 /compiler | |
parent | 1e5dd9022b0d86d63d616431a0f9959ca4c10f40 (diff) | |
download | Nim-6f4bacff67e2e219ef914e24d9f9aaf34a6d1eb1.tar.gz |
Extend and document compiler debugging utilities (#19841)
* Add two debugutils procs that native debuggers can break on use to execute commands when code of interest is being compiled. * Add GDB and LLDB programs to disable and enable breakpoints and watchpoints when code of interest is being compiled. * Extend the `intern.rst` docs regarding debugging the compiler. Co-authored-by: quantimnot <quantimnot@users.noreply.github.com>
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/debugutils.nim | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/compiler/debugutils.nim b/compiler/debugutils.nim index d109d2121..adbb0517f 100644 --- a/compiler/debugutils.nim +++ b/compiler/debugutils.nim @@ -54,3 +54,19 @@ proc isCompilerDebug*(): bool = {.undef(nimCompilerDebug).} echo 'x' conf0.isDefined("nimCompilerDebug") + +proc enteringDebugSection*() {.exportc, dynlib.} = + ## Provides a way for native debuggers to enable breakpoints, watchpoints, etc + ## when code of interest is being compiled. + ## + ## Set your debugger to break on entering `nimCompilerIsEnteringDebugSection` + ## and then execute a desired command. + discard + +proc exitingDebugSection*() {.exportc, dynlib.} = + ## Provides a way for native debuggers to disable breakpoints, watchpoints, etc + ## when code of interest is no longer being compiled. + ## + ## Set your debugger to break on entering `exitingDebugSection` + ## and then execute a desired command. + discard |