Visual C++ (2008) 调试快照

发布于 2024-11-17 04:32:07 字数 212 浏览 3 评论 0原文

有时我需要跟踪我感兴趣的对象上变量值发生变化的几行代码。当对象发生变化时,我需要比较变量以查看发生了什么,以及它是否与预期值不同。这类似于监视窗口,但可以保存并显示代码。在监视窗口中,您可以按最后添加的顺序排列一堆变量名称(不能轻易更改!?),没有代码来显示它们的来源。

目前,我正在记事本++中输入所有内容。 那么,是否有办法捕获包含变量值的几行代码的快照?

Sometimes I need to keep track of several lines of code where variable values change on the object I am interested in. When the object changes, I need to compare the variables to see what is happening, and whether it is different than expected values. This is similar to a watch window, but one that can be saved and shows the code along with it. In the watch window, you can have a bunch of variable names in order of last added (which can't be changed easily!?) with no code to show where they came from.

Currently, I am typing everything in notepad++. So, is there anyway to capture a snapshot of a few lines of code which includes the variable values?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

仙女山的月亮 2024-11-24 04:32:07

当变量发生变化时,截取桌面的屏幕截图。您将获得代码(您可以选择确切的代码以进一步增强)和变量作为可视快照。如您所知,刚刚更改的变量也将用红色表示。

如果您可以容纳所需的所有信息,您还可以将窗口调整得更小,然后使用 Shift+PrintScreen 来制作更紧凑的快照。

当您拥有快照集合时,只需使用查看器滚动它们,您就应该拥有一个非常整洁的快照调试步进工具。

Make a screenshot of your desktop when variables change. You'll have the code (you can select the exact code to further enhance), and the variables as a visual snapshot. The variables that just changed will also as you know be indicated with red color.

You can also resize the window smaller if you can fit all info you need, and then use shift+printscreen to make more compact snapshots.

When you have your collection of snapshots just scroll through them with a viewer and you should have a pretty neat snapshot-debug-stepping-thingy.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文