《VisualC6.0调试功能图解教程1快速》由会员分享,可在线阅读,更多相关《VisualC6.0调试功能图解教程1快速(10页珍藏版)》请在金锄头文库上搜索。
1、Visual C+ 6.0调试功能这是我自己在学习时整理的,希望对大家有用.其中有几个部分的内容,如下:My Note全部由我截图并参考资料进行说明,这其中有大量的内容是调试过程中体会总结才写的.有不当之处请大家更正.From Visual C+ Debugger这本书写得非常的不错,从里面截了一些有用的图,主要是强烈推荐大家阅读这本书.Debug Menu From MSDN这是我从Visual C+ 6.0 MSDN Library October 2001中查来的,在My Note中有很多是从那里参考的.强烈推荐大家看这份英文说明.From visual C+ 6.0开发工具与调试这是我
2、从网络上搜索到的,问题很经典,强烈推荐大家参看学习,避免不必要的错误.My Note常用功能:1. Restart(Ctrl+shift+F5):此debugger功能将从程序的开始(第一有效行)处全速执行,而不是从当前所跟踪的位置开始调试,这时所有变量的当前值都将被丢弃,debugger会自动停在程序的main()开始处.这时如果选择Step Over(F10)就可以逐步执行main()函数了.2. Stop Debugging(Shift+F5):此debugger功能将终止(所有)调试,并返回到常规编辑状态.3. Break(此功能常常在遇到调用函数的语句时可见.):此功能将在调试过程中
3、的debugger当前位置挂起程序的执行,然后就可以在调试状态一修改程序的代码,接着可以用Apply Code Changes(Alt+F10)来应用修改的代码到正在调试的程序当中.如果,当前(需要,待)可以(从DOS等窗口)输入值,挂起后将不能再输入.4. Apply Code Changes(Alt+F10):此功能可以在程序正在调试程序过程中应用(挂起)修改后的源代码.如,选择Break功能并修改代码后,只要选择Apply Code Changes(Alt+F10)就能将修改后的代码应用到正在调试的程序当中.5. Show Next Statement(Alt+Num*):此功能将显示程
4、序代码的下一条语句,如果源代码中找不到,则在Disassembly窗口中显示语句.当在Disassembly窗口中显示时,可以单击Disassembly 返回到源代码窗口.6. Step Into(F11):此功能可以单步进入到在调试过程中所跟踪的调用函数的语句的函数内部.如,当前语句是”d.Display()”,选择Step Into(F11)后,Debugger将进入Display()函数内部并停在Display()函数内部的第一条语句上.(此时,就可以Step Over(F10)对Display()函数进行单步调试了.)7. Step Over(F10):此功能可以单步对所在函数单步调试
5、,如果调试的语句是一个调用函数的语句时,Debugger将全速执行所调用的函数,单步(一步)通过所调用的函数,Debugger停该调用语句的下一条语句上.8. Step Out(Shift+F11):此功能将使Debugger切换回全速执行到被调用函数结束,并停在该函数调用语句的下一条语句上.当确定所调用的函数没有问题时可以用这个功能全速执行被调用函数.9. Run to Cursor(Ctrl+F10):此功能将全速执行到包含插入点光标所在的行,可以作为在插入点光标处设置常规断点的一种选择.注意,当光标处不是一个有效的执行语句时此功能将不起作用.10. Go(F5):此功能将全速执行程序直到
6、遇到一个断点或程序结束,或直到程序暂停等待用户输入. 注意,此功能最能有效的调试循环,常将断点设置在循环体内,重复的按F5全速执行循环体可以测试循环过程中的产生的变化.11. Step Into Specific Function:此功能可以可以单步通过程序中的指令,并进入指定的函数调用,此功能对于函数的嵌套层不限.调试常用快捷键单步进入F11单步跳过F10单步跳出SHIFT+F11运行到光标CTRL+F10开关断点F9清除断点CTRL+SHIFT+F9Breakpoints(断点管理)CTRL+B 或ALT+F9GOF5Compile(编译,生成.obj文件)CTRL+F7Build(组建,
7、先Compile生成.obj再Link生成.exe)F7From Visual C+ DebuggerDebug Menu From MSDNStart Debug Commands (Build menu)MenucommandActionGoExecutes code from the current statement until a breakpoint or the end of the program is reached, or until the application pauses for user input. (Equivalent to the Go button on
8、 the toolbar.)Step IntoSingle-steps through instructions in the program, and enters each function call that is encountered.Run to CursorExecutes the program as far as the line that contains the insertion point. This is equivalent to setting a temporary breakpoint at the insertion point location.Atta
9、ch to ProcessAttaches the debugger to a process that is running. Then you can break into the process and perform debugging operations like normal. When you begin debugging, the Debug menu appears, replacing the Build menu on the menu bar. You can then control program execution using the commands lis
10、ted in the following table.Debug Menu Commands that Control Program ExecutionDebug menucommandActionGoExecutes code from the current statement until a breakpoint or the end of the program is reached, or until the application pauses for user input. (Equivalent to the Go button on the Standard toolbar
11、.) When the Debug menu is not available, you can choose Go from the Start Debug submenu of the Build menu.Restart Resets execution to the first line of the program. This command reloads the program into memory, and discards the current values of all variables (breakpoints and watch expressions still
12、 apply). It automatically halts at the main( ) or WinMain( ) function.Stop Debugging Terminates the debugging session, and returns to a normal editing session. Break Halts the program at its current location. Step IntoSingle-steps through instructions in the program, and enters each function call th
13、at is encountered. When the Debug menu is not available, you can choose Step Into from the Start Debug submenu of the Build menu.Step OverSingle-steps through instructions in the program. If this command is used when you reach a function call, the function is executed without stepping through the fu
14、nction instructions.Step OutExecutes the program out of a function call, and stops on the instruction immediately following the call to the function. Using this command, you can quickly finish executing the current function after determining that a bug is not present in the function.Run to CursorExe
15、cutes the program as far as the line that contains the insertion point. This command is equivalent to setting a temporary breakpoint at the insertion point location. When the Debug menu is not available, you can choose Run To Cursor from the Start Debug submenu of the Build menu.Step Into Specific FunctionSingle steps through instructions in the program, and enters the specified function call. This works for any number of nesting levels of functions. The following additional commands appear on the Debug menu:ExceptionsDisplays the Exceptions dialog, which you can u