调式DirectX应用程序

这部分包含下列关于调试C和C++应用程序的主题。

。Debug VS Retail DLLs

。删除或添加DebugDLLs

。其他资源

Debug VS. Retail DLLs

    DirectX SDK 安装程序提供了安装由DirectX DLLs构建的Debug或Retail的选项。当你用C++开发软件,最好安装DirectX DLLs的debug版本,这个选择将在你的系统安装debug和retail DLLs(retail版本之安装Retail DLLs)。debug DLLs有使内部数据结构有效和输出调试错误信息的辅助代码,当你的程序执行的时候可以利用OutputDebugString函数来查看错误信息。当一个错误出现,debug会给你输出更多的问题详细描述。debug DLLs 比retail DLLs 运行得更慢,但是对于调试一个应用程序更有用。务必用retail版本去跑你的应用程序。

    如果你有debug SDK安装程序,你可以使用DirectX控制面板在更多的DirectX组件的debug和retail构建中作出选择,要激活这个特性,在你安装SDK的时候请选择Debug选项。

    想要看调试信息,配置你的系统以便使它输出到窗口或者远程计算机。像Visual Studio.NET这样的开发环境让你能够这样做,请参考环境安装指导文件。

    为了确保使调用者能够在使用debug构建的时候找到相关的文字信息,请查看如下文本文件:

 

.pdb file location: Same directory as binary

.dbg file location: %SystemRoot%/Symbols/<binary extension>/

 

删除或添加Debug DLLs

    如果你安装了retail运行时并希望改成debug运行时,请运行DxSetup.exe,在(SDK root)/Redist/ folder中可以找到它。
    如果你有debug运行时并想恢复到retail运行时,请运行Undxxpdebug.exe,在windows系统文件夹中可以找到它。你也能通过在开始菜单中选择“运行”并在框中输入“undxxpdebug”来运行它。

其它资源
    微软应用程序兼容工具包包含一些工具和文件,当你开发你的应用程序之前需要去评估并减小兼容问题。
    想发现C++内存泄漏和其他一些问题,你可以使用Microsoft window AppLication Verifier(Appverifier)。Appverifier工具监视应用程序的例如内存泄漏,死锁和无效句柄等一些问题。为了尽快知道如何去使用该工具,请看用Appverifier测试应用程序的文章。

 

 

原文

 

Debugging DirectX Applications

This section covers the following topics pertaining to debugging C and C++ applications.

Debug vs. Retail DLLs

The DirectX SDK installation program provides the option of installing either debug or retail builds of the DirectX DLLs>.

When you develop software in C++, it is best to install the debug versions of the DLLs>. This option installs both debug and retail DLLs> on your system (the retail version installs only the retail DLLs>). The debug DLLs> have additional code that validates internal data structures and outputs debug error messages, using the OutputDebugString function while your program is executing. When an error occurs, the debug output gives you a more detailed description of the problem. The debug DLLs> run more slowly than the retail DLLs> but are much more useful for debugging an application. Be sure to ship the retail version with your application.

If you have the debug SDK installed, you can use the DirectX Control Panel utility to switch between the debug and retail builds of most components. To enable this feature, select the Debug option when you install the SDK.

To see the debug messages, configure your system so that debug output appears in a window or on a remote computer. A development environment such as Visual Studio .NET enables you to do this. Consult the environment documentation for setup instructions.

To ensure that the debugger can find the relevant symbolic information when using debug builds, locate the symbol files as follows:

.pdb file location: Same directory as binary

.dbg file location: %SystemRoot%/Symbols/<binary extension>/

Removing or Adding Debug DLLs

If you installed the retail runtime and would like to change to the debug runtime, run Dxsetup.exe, which is located in the (SDK root)/Redist/ folder.

If you have the debug runtime and would like to revert to the retail runtime, run Undxxpdebug.exe, which is located in the Windows System folder. You can also run this by selecting Run from the Start menu and typing undxxpdebug in the box.

Other Resources

The Microsoft Application Compatibility Toolkit contains the tools and documentation you need to evaluate and mitigate application compatibility issues before deploying your application.

To find C++ memory corruption and other problems, you can use the Microsoft Windows Application Verifier (AppVerifier). The AppVerifier tool monitors an application for things like heap corruption, locks usage, and invalid handles. See the Testing Applications with AppVerifier Article for steps on how to use this tool.

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值