Visual Studio能够记住以前调试会话中的断点,这非常棒。
但是,当我在调试时,通过单击它来清除其中一个“旧”断点时,它只是被暂时删除了。我的意思是,下次调试时,我以为我删除的断点又回来了。
这非常烦人——有没有设置让它不这样做?
Visual Studio能够记住以前调试会话中的断点,这非常棒。
但是,当我在调试时,通过单击它来清除其中一个“旧”断点时,它只是被暂时删除了。我的意思是,下次调试时,我以为我删除的断点又回来了。
这非常烦人——有没有设置让它不这样做?
当前回答
Start your debug session with a minimal number of files open, as you debug the unwanted breakpoints will show up and the containing files will open in new tabs. Terminate the debug session and open the breakpoints window (from the debug toolbar, for some reason it is not in the view menu). For each file, enter the name of the file in the search area of the breakpoints window and press enter to filter out the breakpoints by file. You can then click on each breakpoint in the window to see where they are located in the code and delete them if you want. A bit tedious but that the best way I found to get rid of those unwanted ghost breakpoints... Bookmarks and breakpoints management.. Those functions were probably last enhanced sometime during the last century...
其他回答
问题是断点的子断点会持续存在。在调试会话期间设置断点时会创建子断点(在某些情况下)。
删除断点(及其子)的一种可靠方法是在断点窗口中手动查找断点,并从那里删除它。(选择条目的顶部节点,点击Delete。)
如果你正在运行一个支持VBScript宏的(旧)版本的Visual Studio,你可以运行这里发布的宏(在调试会话之间),以删除子断点。这将使通过单击符号来删除断点在某种程度上更加有效和可预测,但这仍然是有问题的和尴尬的。
Start your debug session with a minimal number of files open, as you debug the unwanted breakpoints will show up and the containing files will open in new tabs. Terminate the debug session and open the breakpoints window (from the debug toolbar, for some reason it is not in the view menu). For each file, enter the name of the file in the search area of the breakpoints window and press enter to filter out the breakpoints by file. You can then click on each breakpoint in the window to see where they are located in the code and delete them if you want. A bit tedious but that the best way I found to get rid of those unwanted ghost breakpoints... Bookmarks and breakpoints management.. Those functions were probably last enhanced sometime during the last century...
在Vscode的新版本中,它被称为:Remove all Breakpoints
Vscode版:
Version: 1.57.1
Commit: 507ce72a4466fbb27b715c3722558bb15afa9f48
Date: 2021-06-17T13:28:32.912Z (1 wk ago)
我一直在努力寻找“断点窗口”。这里有一个快速打开它的方法- ctrl+alt+B
或者你可以手动转到“调试->Windows->断点”来打开它。
或者你可以按ctrl+shift+F9一次删除所有断点!
进入调试菜单,然后按Ctrl+Shift+F9删除所有断点