C# pdb(程序调试数据库)的用途是什么?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1449060/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
What is the usage of pdb's (Program Debug DataBase)?
提问by Amit
When compiling a library or an application (e.g a Console Application in the Visual Studio IDE), in the Debug folder of the application, apart from the .dll or .exe, there will be one more file with extension ".pdb".
编译库或应用程序(例如Visual Studio IDE 中的Console Application)时,在应用程序的Debug 文件夹中,除了.dll 或.exe 之外,还会多出一个扩展名为“.pdb”的文件。
What is the exact usage of this .pdb file?
这个 .pdb 文件的确切用途是什么?
回答by Kris Erickson
PDB's allow debugging of applications, for examlple when they crash or if you have a minidump. They also allow you to find more detail about errors when outputting exceptions to logging (they will give a more complete stacktrace with line numbers rather than just showing the name of the function where the error occurred).
PDB 允许调试应用程序,例如当它们崩溃或您有小型转储时。它们还允许您在将异常输出到日志记录时找到有关错误的更多详细信息(它们将提供带有行号的更完整的堆栈跟踪,而不仅仅是显示发生错误的函数的名称)。
回答by Botz3000
As far as i know, they contain debugging information, such as line numbers, variable names, etc.
据我所知,它们包含调试信息,例如行号、变量名等。
回答by ChrisF
Well you've given yourself a big clue in your title.
好吧,你已经在你的标题中给了自己一个重要的线索。
It's the file Visual Studio needs to be able to debug your application.
这是 Visual Studio 调试应用程序所需的文件。
This MSDN pagehas more information.
这个MSDN 页面有更多信息。
A program database (PDB) file holds debugging and project state information that allows incremental linking of a Debug configuration of your program.
程序数据库 (PDB) 文件包含调试和项目状态信息,允许增量链接程序的调试配置。
回答by Richard Berg
John Robbins has written some really great articles on PDBs lately:
John Robbins 最近写了一些关于 PDB 的非常棒的文章:
回答by gbjbaanb
PDBs contain debugging symbols, so you can ship a compiled binary to your customer without exposing your source code algorithms and other private details to them.
PDB 包含调试符号,因此您可以将编译后的二进制文件发送给您的客户,而无需向他们公开您的源代码算法和其他私人细节。
If your app goes wrong on a customer site, you can get a crash dump from them (using DrWatson), bring it back to your dev workstation and debug the crash, the debugger will use the symbols file in conjunction with the crash to show you the source code, data structures etc. In many cases, all you have to do is open the crash dump and the debugger will take you directly to the source code of the exception, and show you variables and threads too.
如果您的应用程序在客户站点上出错,您可以从他们那里获得故障转储(使用 DrWatson),将其带回您的开发工作站并调试崩溃,调试器将使用符号文件与崩溃一起向您展示源代码、数据结构等。在很多情况下,您所要做的就是打开故障转储,调试器将直接带您到异常的源代码,并向您显示变量和线程。
That's the primary use of them, they're invaluable when a customer reports a crash. The things you need to know about using them though - they are only valid for the build that created them, so if you recompile, your symbols file is next to worthless.
这是它们的主要用途,当客户报告崩溃时,它们是无价的。关于使用它们你需要知道的事情——它们只对创建它们的构建有效,所以如果你重新编译,你的符号文件几乎一文不值。
John Robbins has an excellent articlewhy you would use them.
John Robbins 有一篇很棒的文章为什么要使用它们。
回答by Mez
PDB's are useful when you want to do remote debugging as well.
Keeping the PDB's together with your installed application makes it possible to hook up visual studio remotely to the client's production environment and debug the application when necessary.
当您还想进行远程调试时,PDB 也很有用。
将 PDB 与已安装的应用程序保持在一起,可以将 Visual Studio 远程连接到客户端的生产环境,并在必要时调试应用程序。