⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 apd.htm

📁 A very good resource on Visual C++ 6.0 environment. It teaches through step by step approach and fin
💻 HTM
📖 第 1 页 / 共 3 页
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>

<HEAD>
<SCRIPT LANGUAGE="JavaScript">

<!--

function popUp(pPage) {
 var fullURL = document.location;
 var textURL = fullURL.toString();
 var URLlen = textURL.length;
 var lenMinusPage = textURL.lastIndexOf("/");
 lenMinusPage += 1;
 var fullPath = textURL.substring(0,lenMinusPage);
 popUpWin = window.open('','popWin','resizable=yes,scrollbars=no,width=525,height=394');
 figDoc= popUpWin.document;
 zhtm= '<HTML><HEAD><TITLE>' + pPage + '</TITLE>';
 zhtm += '<link rel="stylesheet" href="/includes/stylesheets/ebooks.css"></head>';
 zhtm += '<BODY bgcolor="#FFFFFF">';
 zhtm += '<IMG SRC="' + fullPath + pPage + '">';
 zhtm += '<P><B>' + pPage + '</B>';
 zhtm += '</BODY></HTML>';
 window.popUpWin.document.write(zhtm);
 window.popUpWin.document.close();
 // Johnny Jackson 4/28/98
 }

//-->
                                                                
</SCRIPT>
<link rel="stylesheet" href="ebooks.css" tppabs="http://www.fintech.ru/includes/stylesheets/ebooks.css">

	
	<TITLE>Special Edition Using Visual C++ 6 -- Appendix D -- Debugging</TITLE>
</HEAD>

<BODY TEXT="#000000" BGCOLOR="#FFFFFF">

<CENTER>
<H1><IMG SRC="que.gif" tppabs="http://www.fintech.ru/library/prog/SEUsingVC6/button/que.gif" WIDTH="171" HEIGHT="66" ALIGN="BOTTOM" BORDER="0"><BR>
Special Edition Using Visual C++ 6</H1>
</CENTER>
<CENTER>
<P><A HREF="apc.htm" tppabs="http://www.fintech.ru/library/prog/SEUsingVC6/apc/apc.htm"><IMG SRC="previous.gif" tppabs="http://www.fintech.ru/library/prog/SEUsingVC6/button/previous.gif" WIDTH="128" HEIGHT="28"
ALIGN="BOTTOM" ALT="Previous chapter" BORDER="0"></A><A HREF="ape.htm" tppabs="http://www.fintech.ru/library/prog/SEUsingVC6/ape/ape.htm"><IMG
SRC="next.gif" tppabs="http://www.fintech.ru/library/prog/SEUsingVC6/button/next.gif" WIDTH="128" HEIGHT="28" ALIGN="BOTTOM" ALT="Next chapter"
BORDER="0"></A><A HREF="index.htm" tppabs="http://www.fintech.ru/library/prog/SEUsingVC6/index.htm"><IMG SRC="contents.gif" tppabs="http://www.fintech.ru/library/prog/SEUsingVC6/button/contents.gif" WIDTH="128"
HEIGHT="28" ALIGN="BOTTOM" ALT="Contents" BORDER="0"></A> 
<HR>

</CENTER>
<CENTER>
<H1>- D -</H1>
</CENTER>
<CENTER>
<H1>Debugging</H1>
</CENTER>

<UL>
	<LI><A HREF="#Heading1">Debugging Vocabulary</A>
	<LI><A HREF="#Heading2">Debugging Commands and Windows</A>
	<UL>
		<LI><A HREF="#Heading3">Menu Items</A>
		<LI><A HREF="#Heading4">Setting Breakpoints</A>
		<LI><A HREF="#Heading5">Examining Variable Values</A>
		<LI><A HREF="#Heading6">Stepping Through Code</A>
		<LI><A HREF="#Heading7">Edit and Continue</A>
		<LI><A HREF="#Heading8">Other Debug Windows</A>
	</UL>
	<LI><A HREF="#Heading9">Using MFC Tracer</A>
	<LI><A HREF="#Heading10">Defining a Dump Member Function</A>
	<UL>
		<LI><A HREF="#Heading11">An Example Using CDumpContext, CFile, and axfDump</A>
	</UL>
</UL>

<P>
<HR SIZE="4">

<CENTER>
<H1></H1>
</CENTER>
<P>Debugging is a vital part of programming. Whenever a program doesn't do what you
expect, even if it doesn't blow up, you should turn to the debugger to see what's
really going on. Some of the philosophies and techniques of debugging have been explained
elsewhere in this book, especially in Chapter 24, &quot;Improving Your Application's
Performance.&quot; This appendix concentrates on the nuts and bolts of how to use
the debugger: the menus, toolbars, and windows that were not covered in Appendix
C, &quot;The Visual Studio User Interface, Menus, and Toolbars.&quot;</P>
<P>
<H2><A NAME="Heading1"></A>Debugging Vocabulary</H2>
<P>Probably the most important word in debugging is <I>breakpoint</I>. A breakpoint
is a spot in your program, a single line of code, where you would like to pause.
Perhaps you are wondering how many times a loop is executed, whether control transfers
inside a certain if statement, or whether a function is even called. Setting a breakpoint
on a line will make execution stop when that line is about to be executed. At that
point you may want the program to be off and running again or want to move through
your code a line or so at a time. You may want to know some of your variables' values
or see how control transferred to this point by examining the call stack. Often,
you'll spot the cause of a bug and correct your code on the spot.</P>
<P>When it's time to move along, there are a number of ways you might like execution
to resume. These are explained in the following list:</P>

<UL>
	<LI><I>Go</I>--Execute to the next breakpoint or, if there are no more breakpoints,
	until the program completes.
	<P>
	<LI><I>Restart</I>--Start again from the beginning.
	<P>
	<LI><I>Step Over</I>--Execute only the next statement, and then pause again. If it
	is a function call, run the whole function and pause after returning from it.
	<P>
	<LI><I>Step Into</I>--Execute just the next statement, but if it is a function, go
	into it and pause before executing the first statement in the function.
	<P>
	<LI><I>Step Out</I>--Execute the rest of the current function and pause in the function
	that called this one.
	<P>
	<LI><I>Run to Cursor</I>--Start running and stop a few (or many) lines from here,
	where the cursor is positioned.
</UL>

<P>Most information made available to you by the debugger is in the form of new windows.
These are discussed in the following sections.</P>
<P>
<H2><A NAME="Heading2"></A>Debugging Commands and Windows</H2>
<P>Developer Studio has a powerful debugger with a rich interface. There are menu
items, toolbar buttons, and windows (output areas) that are used only when debugging.</P>
<P>
<H3><A NAME="Heading3"></A>Menu Items</H3>
<P>The user interface for debugging starts with items on some ordinary menus that
are used only in debugging and are not discussed in Appendix C. These include</P>

<UL>
	<LI>Edit, Breakpoints
	<P>
	<LI>View, Debug Windows, Watch
	<P>
	<LI>View, Debug Windows, Call Stack
	<P>
	<LI>View, Debug Windows, Memory
	<P>
	<LI>View, Debug Windows, Variables
	<P>
	<LI>View, Debug Windows, Registers
	<P>
	<LI>View, Debug Windows, Disassembly
	<P>
	<LI>Build, Start Debug, Go
	<P>
	<LI>Build, Start Debug, Step Into
	<P>
	<LI>Build, Start Debug, Run to Cursor
	<P>
	<LI>Build, Start Debug, Attach to Process
	<P>
	<LI>Build, Debugger Remote Connection
</UL>

<P>These are not the only menu items you'll use, of course. For example, the Edit,
Go To dialog box can be used to scroll the editor to a specific breakpoint as easily
as a line, bookmark, or address. Many menu items you've already learned about are
useful during debugging.</P>
<P>When you start debugging, the Build menu disappears and a Debug menu appears.
The items on that menu are as follows:</P>

<UL>
	<LI>Debug, Go
	<P>
	<LI>Debug, Restart
	<P>
	<LI>Debug, Stop Debugging
	<P>
	<LI>Debug, Break
	<P>
	<LI>Debug, Apply Code Changes
	<P>
	<LI>Debug, Step Into
	<P>
	<LI>Debug, Step Over
	<P>
	<LI>Debug, Step Out
	<P>
	<LI>Debug, Run to Cursor
	<P>
	<LI>Debug, Step into Specific Function
	<P>
	<LI>Debug, Exceptions
	<P>
	<LI>Debug, Threads
	<P>
	<LI>Debug, Show Next Statement
	<P>
	<LI>Debug, QuickWatch
</UL>

<P>As you can see, some items from the Build, Start Debug cascading menu are also
on the Debug menu, along with many other items. The sections that follow discuss
the individual items.</P>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -