WindowsSymbolFiles
Windows Symbol Files
1.什么是Symbol File?
Symbol files hold a variety of data which are not actually needed when running the binaries(), but which could be very useful in the debugging process(It´s a good partner for VC6++ and WinDbg).
通俗的说,Symbol File是包含了相关⼆进制⽂件(EXE,DLL)调试信息的⼀种⽂件,它以.pdb为扩展名,⽐如WinXP下有⼀个GDI32.dll,那么微软在编译该DLL的时候会产⽣⼀个GDI32.pdb⽂件,程序员有了这个PDB⽂件愿意的话就可以⽤它来调试,跟踪到GDI32.dll的内部去!
该⽂件和⼆进制⽂件的编译版本密切相关,⽐如你修改了DLL的输出函数等,再编译该DLL那么原先的PDB⽂件就过时了,不能再胜任调试的重担了,这时候你需要的是修改后编译产⽣的PDB⽂件.
⼤家在⽤VC6编译的时候会发现PDB⽂件会存在于Debug/Release⽬录下(关于如何产⽣Release版本的PDB请参看4.如何在VC6++中编译产⽣Release版本的⼆进制⽂件的PDB⽂件?).
Typically, symbol files might contain:
1.全局变量(Global variables)
2.局部变量(Local variables)
3.函数名和它们的⼊⼝地址(Function names and the addresses of their entry points)
pdb文件阅读器安卓4.FPO data(frame pointer omission),frame pointer是⼀种⽤来在调⽤堆栈(Call stack)中到下⼀个将要被调⽤的函数的数据结构源代码的⾏序号(Source-line numbers)
Symbol Files
A symbol file contains the same debugging information that an executable file would contain. However, the information is stored in a debug (.dbg) file or a program database (.pdb), rather than the executable file. Therefore, you can install only the symbol files you will need during debugging. This reduces the file size of the executable, saving load time and disk storage.
The operating system dynamic-link libraries (DLL) have associated symbol files. These .pdb files are not installed during installation. To install the system symbol files, create a directory on your hard disk, and copy the files from your system installation compact disc (CD). The symbol files are located in the
SUPPORT\DEBUG\I386\SYMBOLS directory tree.
A debug symbol is information that tells you which programming-language constructs generated a specific piece of machine code in a given executable module. Sometimes the symbolic information is compiled together with the module's binary file, or distributed in separate file, or simply discarded during the compilation and/or linking. This information enables a person using a symbolic debugger to gain additional information about the binary, such as the names of variables and routines from the original source code. This information is sometimes extremely helpful while trying to investigate and fix a crashing application or any other fault.
When the debug symbols are embedded in the binary itself, the file can then grow significantly larger (sometimes by several megabytes). To avoid this extra size, modern compilers and early mainframe debugging systems output the symbolic information into a separate file (for Microsoft compilers, this file is called a file). Some companies ship the PDB on their CD/DVD to enable troubleshooting and other companies (like ) have special online servers from which it's possible to download the debug symbols separately. When using Microsoft's debugger it automatically downloads debug symbols for on demand as they are needed. However, the PDB debug symbols that Microsoft distributes are only partial (they include only public functions, global variables and their data types). Other vendors, such
as the have similar infrastructure but their symbol server distributes full debug information, making it easier to find bugs because this data contains all functions, all variables and all data types.
In 2008, Microsoft also started to offer the for certain components (most of the for instance) to make debugging easier and some debuggers, like and , will actually download the code on demand in a fashion similar to how debug symbols are retrieved (there is a special source server that serves the requested code). Mozilla operated
such a source server several years before this.
转⾃ hi.baidu/donghaozheng/blog/item/af5f0d3b628eb7e214cecb6c.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论