对PDB文件的怀疑 [英] Doubt about PDB files

查看:79
本文介绍了对PDB文件的怀疑的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

始终建议为每个公共版本存储PDB文件,以便我们可以调试生产服务器上是否存在任何问题.

我的疑问是,即使由于添加了两行代码,我的源代码是否也会更改,那么在运行程序并将其附加到调试器时是否能够调试?
据我了解,由于PDB包含行号.仅限局部变量,如果源代码被更改,我们将无法调试,因此除非我们返回创建dll的原始源,否则它会很有帮助,但是如果我们知道源文件,那么为什么我们需要原始pdb,因为我们可以将其替换为我们的本地pdb.
我肯定我在这里会丢失一些东西.如果您清除此内容,将非常高兴.

Its always recommended to store the PDB files for each public build so that we can debug if there is any issue on Production server.

My doubt is if my source code is changed even due to addition of two lines whether i will be able to debug when i run the program and try to attach it to my debugger?
In my understanding since PDB contains the line no. and local variable only,if the source code is changed we can''t debug , so how its helpful unless we go back to original source which created the dll but if we know the source file then why we need the original pdb since we can replace it our local pdb.
I am sure i am missing something here..Will be glad if you clear this.

推荐答案

每次在Debug模式下编译时,都会重新生成PDB文件.因此,它们将过时.我相信如果编译时有版本更新,那么系统将识别出它们已过时.它们包含符号,这使调试变得更容易,因为您仍然可以调试程序,但是您将看到IL代码,并且将无法与原始源文件关联.

从Microsoft网站:
.PDB扩展名代表程序数据库".它具有Visual C ++版本1.0中引入的用于存储调试信息的新格式.将来,.PDB文件还将保存其他项目状态信息.更改格式的最重要动机之一是允许增量链接程序的调试版本,这是Visual C ++ 2.0版首次引入的更改.

注意:带有此信息的Microsoft网站的位置为 http://support.microsoft.com/kb/121366 [ ^ ]

还有很多其他地方可以获取信息. PDB文件的实际格式实际上是Microsoft的秘密,因此您必须使用Microsoft工具来获得对该格式的可见性.
The PDB files are regenerated everytime you compile in Debug mode. Therefore, they will be out of date. I beleive if there is a version update with the compile, then the system will recognize they are out of date. They contain the symbols, making it easier to debug since you Program can still be debugged, but you will see the IL code, and there will be no way to associate to the original source file.

From the microsoft site:
The .PDB extension stands for "program database." It holds the new format for storing debugging information that was introduced in Visual C++ version 1.0. In the future, the .PDB file will also hold other project state information. One of the most important motivations for the change in format was to allow incremental linking of debug versions of programs, a change first introduced in Visual C++ version 2.0.

Note: the location of the Microsoft site with this information is http://support.microsoft.com/kb/121366[^]

There are quite a few other places to get information. The actual format of the PDB file is actually a microsoft secret, so you must use Microsoft tools to get visibility into this format.


问题开头的语句是完全错误的. br/>
PDB是临时文件,不应保留,也不应以任何形式将其添加到版本控制系统中.也许这并不危险,但是当文件过时时,很容易混淆没有经验的人.

—SA
The statement in the beginning of the question is plain wrong.

PDB is temporary file and should not be preserved, added to the Revision Control System, deployed in any form. Maybe, it''s not dangerous but could easily confuse inexperienced when the file is outdated.

—SA


这篇关于对PDB文件的怀疑的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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