Click here to Skip to main content
15,887,135 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
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.
Posted
Comments
Sergey Alexandrovich Kryukov 3-Mar-12 23:01pm    
This is plain wrong.
--SA

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.
 
Share this answer
 
v2
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
 
Share this answer
 
Comments
Rishikesh_Singh 3-Mar-12 23:21pm    
What about the Symbol store and source store that microsoft and many other companies are are maintaining.. May be not always but just because its confusing for some.. shouldn't be reason.
Sergey Alexandrovich Kryukov 3-Mar-12 23:48pm    
What are you talking about? In your PDB file, of course. It is created each time, not comes with source code.
Do not preserve it. If that the reason of your vote of 1? If so, I would advise to understand first.
--SA
Sergey Alexandrovich Kryukov 3-Mar-12 23:49pm    
Perhaps you just did not get it. This file stays with you, you just should not preserve it, ever.
--SA
Rishikesh_Singh 4-Mar-12 6:14am    
I know there is no need to preserve PDBs and it doesn't come with Source, and i don't think any programmer will not know this.
In my question i didn't mention that for debugging i need PDB files , I said when we attach Running program(Attach to process option) to debugger then we need PDB files.

I read somewhere that if we maintain Source Store and Symbol store and source is indexed with Symbol then we can debug the application in QA or any environment without having actual Source there (but ofcourse visual studio is needed there)
Sergey Alexandrovich Kryukov 4-Mar-12 13:20pm    
That's the point: you can rely only of freshly generated PDB. Of course it is important.
Don't you think we already understood each other; and there is nothing to argue about?
--SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900