我如何逐步调试 [英] How do I debug step by step

查看:96
本文介绍了我如何逐步调试的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以..我真的不知道它叫什么,几个星期前我常常使用它但完全忘记了如何找到它。



我想要什么要做的是..



有一个按钮或一个选项可以按下以使代码左边显示一个小箭头,你可以按下旁边看计算机从代码中读取的内容就像逐步调试一样我猜?



对不起,如果我没有任何意外!



我希望自己足够清楚。

解决方案

这些代码项目文章应该可以帮助您了解Visual Studio中的调试。



在Visual Studio 2010中掌握调试 - 初学者指南 [ ^ ]



Visual Studio中的高级调试 [ ^ ]

做一件简单的事情:在你开始密集使用一些新的IDE或其他一些工具之前,比如高级的edito r对于某些数据或媒体类型,执行此工具的广泛研究。至少,扫描所有模式中的每个菜单项,并了解它的作用。你不必记住任何东西,但至少你会熟悉你正在处理的事情。更一般的方式:不要立即跳到你认为的最终目标。首先,锐化您的工具并学习如何锐化它们。不是那么基础。没有什么比节省时间更好的了...更多时间来磨练你的工具。



特别是在Visual Studio调试上:与调试相关的一切都位于顶部级菜单项调试和查看。不要忘记解决方案资源管理器中的上下文菜单。另请注意,调试是在不同的Visual Studio 模式中完成的。也就是说,要进入调试模式,你必须......开始调试。从F10开始,或者更高效地设置至少一个断点并按F5。等等...



-SA


咳嗽看f10,f11例如 - 你也可以在代码行上设置'断点',使用f5并且执行将在(有希望的话,而不是'if')到达断点时停止...然后你可以使用各种窗口检查变量的内容到看看它们包含什么价值



这是一项有价值的技能,所以现在就了解它:-)在过去< sigh>中,我们不得不写/将我们的变量内容转储到控制台窗口进行调试 - 即,你要插入



 WriteLine(  x的值为{x},x); 





例如,如果您需要在修改后看到'x'包含的内容。


So.. I really dont know what its called, I used to use it a few weeks ago but completly forgot how to find it.

What I want to do is..

There isa button or an option you can press to make a little arrow show up to the left of the code and you can press next to see what the computer reads from the code like step by step debuggin I guess?

Sorry if im not making any sence!

I hope I made myself clear enough.

解决方案

These codeproject articles should help you learn about debugging in Visual Studio.

Mastering Debugging in Visual Studio 2010 - A Beginner's Guide[^]

Advanced Debugging in Visual Studio[^]


Do simple thing: before you start intensively using some new IDE, or some other tool, such as advanced editor for some data or media type, perform extensive study of this tool. As a minimum, scan each and every menu item in all modes and get a good idea on what it does. You don't have to remember anything, but at least you will be familiar with what you are dealing with. In more general way: don't jump immediately to what you consider as your ultimate goals. First, sharpen your tools and learn how to sharpen them. Isn't that elementary. There is nothing better for saving time than investing… good amount of time for sharpening your tools.

Specifically on Visual Studio debugging: everything related to debugging is located under the top-level menu items "Debug" and "View". Don't forget context menu in Solution Explorer. Also note that debugging is done in a different Visual Studio mode. That is, to get to debugging mode, you have to… start debugging. Start with F10, or more productively, set at least one breakpoint and press F5. And so on…

—SA


cough look at f10, f11 for example - you can also set 'break points' on lines of code, use f5 and the execution will stop when (hopefully when, not 'if') you get to a breakpoint ... you can then use various windows to inspect the content of variables to see what values they contain

This is a valuable skill, so learn up on it now :-) in the old days <sigh>, we had to write/dump our variable contents to the console window to debug - ie, you would insert

WriteLine("The value of x is {x}", x); 



for example if you needed to see what 'x' contained after you'd modified it.


这篇关于我如何逐步调试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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