如何在 VSCode 上设置数据断点(即观察点) [英] How to set data breakpoints (i.e. watchpoints) on VSCode

查看:530
本文介绍了如何在 VSCode 上设置数据断点(即观察点)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不是 VSCode 的专家,但我看到从 1.38 版开始,可以添加观察点(修改给定内存区域时中断的断点,许多调试器支持的功能),至少对于C/C++,见这里 https://jaxenter.com/vs-code-1-38-161797.html 和这里 https://github.com/microsoft/vscode/issues/58304.现在我的VSCode版本是1.48.2,还是不知道怎么弄,也找不到合适的解释.如果有人可以解释如何做(或是否可行),那肯定对我和 VSCode 社区都非常有益.

I am no expert in VSCode, but I saw that since version 1.38 there is the possibility to add watchpoints (a breakpoint which breaks when a given memory area is modified, a feature that is supported by many debuggers), at least for C/C++, see here https://jaxenter.com/vs-code-1-38-161797.html and here https://github.com/microsoft/vscode/issues/58304. Now my version of VSCode is 1.48.2, and I still can't figure out how to do it, and I couldn't find a proper explanation either. If anyone can give an explanation on how to do it (or whether it is possible), for sure it will very beneficial for me and for the VSCode community.

推荐答案

我个人使用 CodeLLDB 扩展进行 C++ 调试,因为我使用 LLDB.我创建变量观察点的方式:

I personally use the CodeLLDB extension for C++ debugging as I use LLDB. The way I create a variable watchpoint:

  • 在定义变量的地方放置一个常规断点
  • 到达断点后,在 Variables 窗格中找到变量,右键单击,然后选择 Break When Value Changes
  • Put a regular break-point at where the variable is defined
  • Upon hitting the break-point, find the variable in the Variables pane, right click, and choose Break When Value Changes

这篇关于如何在 VSCode 上设置数据断点(即观察点)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆