简体   繁体   English

即使条件为假,VScode中的条件断点也会跳闸

[英]Conditional breakpoints in VScode trip even when condition is false

Like the title said, any conditional breakpoints I set in VS code are always tripped, even when the condition is false. 就像标题所说的那样,我在VS代码中设置的任何条件断点总是被触发,即使条件为假。 I right-clicked in the margin, typed the condition into the little box that shows up, and hit enter. 我右键单击边距,在显示的小方框中键入条件,然后按Enter键。 Is the syntax? 是语法吗? I tried the following conditions and they were all tripped, even though they're obviously false. 我尝试了以下条件,他们都被绊倒了,尽管他们显然是假的。

(if False)

And this: 还有这个:

(False)

Using Python, if that makes any difference. 使用Python,如果这有任何区别。

I fall into a pitfall, 我陷入了陷阱

foo1 = 1
foo2 = 2

If you want to stop when foo1 == 1, you need to set a breakpoint at line 2. At line 1, the foo1 is not defined yet. 如果要在foo1 == 1时停止,则需要在第2行设置断点。在第1行,尚未定义foo1。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM