gpt4 book ai didi

debugging - 在中断时抑制某些 SBCL 调试器输出

转载 作者:行者123 更新时间:2023-12-02 02:40:03 25 4
gpt4 key购买 nike

可以通过执行 (break) 以编程方式调用调试器。例如,调试横幅然后显示导致中断的原因、帮助行、可用的重启、一些相关信息,最后是中断源:

debugger invoked on a SIMPLE-CONDITION in thread
#<THREAD "main thread" RUNNING {10010B0523}>:
break

Type HELP for debugger help, or (SB-EXT:EXIT) to exit from SBCL.

restarts (invokable by number or by possibly-abbreviated name):
0: [CONTINUE] Return from BREAK.
1: [ABORT ] Exit debugger, returning to top level.

#(
NODE: STATE=<NIL NIL NIL 0.0 0.0
( )> DEPTH=0)
#(
NODE: STATE=<NIL NIL NIL 0.0 0.0
((ACTIVE GATE1) (ACTIVE GATE2) (COLOR RECEIVER1 BLUE) (COLOR RECEIVER2 RED) (COLOR TRANSMITTER1 BLUE) (COLOR TRANSMITTER2 RED) (FREE ME) (LOC CONNECTOR1 AREA5) (LOC CONNECTOR2 AREA7) (LOC ME AREA5))> DEPTH=0)
(DF-BNB1 )
source: (BREAK)
0]

我不明白重启和来源之间的相关信息。是否可以抑制此信息,因为有时我的应用程序中有很多行。我试过更改调试和安全优化设置,但没有效果。

最佳答案

您混淆的输出与代码中调用 break 的位置有关。当我从 vanilla Lisp REPL(没有 SLIME)调用它时,它显示:

(SB-INT:SIMPLE-EVAL-IN-LEXENV (BREAK) #<NULL-LEXENV>)

但是,如果我在调试器中做错了什么,会发生以下情况:

0] q
; in: PROGN (PRINT 1)
; (PROGN Q)
;
; caught WARNING:
; undefined variable: COMMON-LISP-USER::Q
;
; compilation unit finished
; Undefined variable:
; Q
; caught 1 WARNING condition

debugger invoked on a UNBOUND-VARIABLE in thread
#<THREAD "main thread" RUNNING {10005204C3}>:
The variable Q is unbound.

Type HELP for debugger help, or (SB-EXT:EXIT) to exit from SBCL.

restarts (invokable by number or by possibly-abbreviated name):
0: [CONTINUE ] Retry using Q.
1: [USE-VALUE ] Use specified value.
2: [STORE-VALUE] Set specified value and use it.
3: [ABORT ] Reduce debugger level (to debug level 1).
4: Return from BREAK.
5: Exit debugger, returning to top level.

((LAMBDA (#:G498)) #<unused argument>)
source: (PROGN Q)

您可以看到最后一行类似于您从 source: 开始的行获得的输出。实际上,我们看到的输出包括 3 个主要部分:一、病情描述2.可用重启列表3. debug-loop-fun

打印调试REPL提示

最后的输出是提示的一部分,它是通过调用生成的:

(print-frame-call *current-frame* *debug-io* :print-frame-source t)

因此,您可以重新编译提供 :print-frame-source nil 的调用,或者尝试理解为什么您当前的框架看起来是这样的......

关于debugging - 在中断时抑制某些 SBCL 调试器输出,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60177696/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com