代码之家  ›  专栏  ›  技术社区  ›  nkassis

如何关闭sbcl中的调试器

  •  9
  • nkassis  · 技术社区  · 15 年前

    来自ruby和irb,我发现每次出错都会自动转移到调试器,这让我有点恼火。有没有办法在我玩的时候暂时关掉它。

    2 回复  |  直到 10 年前
        1
  •  12
  •   Rainer Joswig mmmmmm    15 年前

    *debugger-hook* ,可以绑定/设置为函数。

    * (aref "123" 10)
    
    debugger invoked on a SB-INT:INVALID-ARRAY-INDEX-ERROR:
      Index 10 out of bounds for (SIMPLE-ARRAY CHARACTER
                                  (3)), should be nonnegative and <3.
    
    Type HELP for debugger help, or (SB-EXT:QUIT) to exit from SBCL.
    
    restarts (invokable by number or by possibly-abbreviated name):
      0: [ABORT] Exit debugger, returning to top level.
    
    (SB-INT:INVALID-ARRAY-INDEX-ERROR "123" 10 3 NIL)
    0] 0
    
    * (defun debug-ignore (c h) (declare (ignore h)) (print c) (abort))
    
    DEBUG-IGNORE
    * (setf *debugger-hook* #'debug-ignore)
    
    #<FUNCTION DEBUG-IGNORE>
    * (aref "123" 10)
    
    #<SB-INT:INVALID-ARRAY-INDEX-ERROR {1002A661D1}>
    * 
    
        2
  •  10
  •   mechanical_meat nazca    15 年前

    --disable-debugger 命令行选项,例如:

    $ sbcl --disable-debugger
    

    默认情况下,当SBCL遇到 调试器,允许交互式 诊断和可能的调解。 导致打印回溯时出错 以状态1退出-- 哪种操作方式更好 适合批量加工。看到了吗 SB-EXT用户手册:DISABLE-DEBUGGER 详情。

    还有 --noinform --noprint CL选项您可能会发现有用。