Friday, April 10, 2015

However, if you do not have the PDBs, your crash dump or your IntelliTrace log will be virtually us


The great challenge to debug a C ++ application (or any other language that is compiled to native adp code) is that once generated native code (either an EXE or a DLL), all we have are opcodes instructions (low instructions level) and pointers. adp In other words, anything that allows us to run a line-by-line program and inspect the value of its variables. adp
For a line-by-line execution, like we have in Visual Studio, basically we would need: A list with the names of variables and their corresponding addresses in memory. Thus, when the debugger found a memory pointer, he would know that one address corresponds variable; Another list with the names of source files, their line numbers and the corresponding memory address. So when the debugger would execute an instruction in a particular memory address, know which line it matches and could display it on the screen.
The compiler is able to generate all this information. The question was: Where stores them? Save this information within the same binary file would not make sense at all would create an unnecessary adp overhead. The files would be very large, filled with information that would be useful only during adp a debugging adp session. Hence came the idea of creating an auxiliary file to store this information: the PDB file.
Introduced along with Visual C ++ 1.0, the PDB files store the following information (metadata) of a binary C ++: public symbols (typically all functions, static variables and global variables); A list of objects that are responsible for sections of code in executable file; Frame-pointer adp omission of information (FPO); adp Name information and data type for local variables and data structures; adp Information adp source file name and line number.
Thus, debug C ++ code has become much easier. Visual Studio has a database full of detailed information about our executable files without this creates an unnecessary overhead to put them into production. PDB files and .NET
Executable files in .NET (assemblies) are completely different from their counterparts in native code. Although they have the same extensions (EXE and DLL), its internal structure is quite different. adp Not only the language (MSIL vs. native code) but mainly by the presence of metadata. .NET Assemblies are rich in metadata. They are allowing, for example, adp we can do reflection (reflection) on our objects. That is, much of the information that a native PDB needs to store to compile C ++ applications is already present within the .NET assembly itself and is therefore redundant. For .NET, the PDB files contain only: Information on names and addresses of local variables; and information adp source file name and line number.
And this has nothing to do with the application have been compiled in Debug or Release mode. Below that even compiling in Release mode (note the path in the window title bar), the file name and the line are displayed:
Now the fun part: the usefulness of PDBs goes far beyond a typical F5 debugging session. PDBs if the show really useful when used to diagnose problems in production ...! PDBs in Production
There are several tools that help diagnose problems in production: from traditional to modern crash dump IntelliTrace and System Center Operations Manager (SCOM) APM. Thus, exceptions being triggered production could be captured in the production and development corrected without the need for direct intervention by the development team.
However, if you do not have the PDBs, your crash dump or your IntelliTrace log will be virtually useless because you can not correlate the torque production with the source code under development.
First things first: The PDB files are important? Yes, a lot! In effect, consider that the PDB files are as important as your EXE and DLL binary. I mean that I always keep PDBs, even when I put my application in production? Yes, it should. Even when compiles its binary in Release mode. Then I copy my PDBs to the production environment, along with the binaries, whenever you make a deployment? This is where things start to get a little more confusing. As we said, you should save the PDB. However he should not go into production. It is not useful there - and in addition may represent adp a security vulnerability, leaving available information about its source code should be available only in development. So where I keep my PDBs if I can not copy them for production? That's what you should have a symbol server (symbol server) adp in your company. Symbols server
In fact, the files in PDB su00e3o

No comments:

Post a Comment