文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>Public Symbols and Private Symbols

Public Symbols and Private Symbols

时间:2010-08-29  来源:Jackie Zhang

When you build a driver or other program, the program's symbols are usually stored in symbol files, although some older compilers store certain symbols in the executable file. When a debugger is analyzing a program, it needs to access the program's symbols.

Typically, symbol files can include any or all of the following symbols:

  • The names and addresses of all functions

  • All data type, structure, and class definitions

  • The names, data types, and addresses of global variables

  • The names, data types, addresses, and scopes of local variables

  • The line numbers in the source code that correspond to each binary instruction

Some program developers might feel uncomfortable sharing all this information with their customers. BinPlace can be used to reduce the amount of symbols in a symbol file.

Some basic symbols, such as function names and global variables, are needed for even the most rudimentary debugging. These are called public symbols. Symbols such as data structure names, global variables visible in only one object file, local variables, and line number information are not always required for debugging, although they are useful for a more in-depth debugging session. These are called private symbols.

A symbol file that contains both private and public symbols is called a full symbol file. A symbol file that contains public symbols alone is called a stripped symbol file.

BinPlace can create a stripped symbol file. It does this by creating a new symbol file that contains only public symbols; the private symbols are removed ("stripped" out). When the most common BinPlace options are used (-a -x -s -n), the stripped symbol files are placed in the directory that is listed after the -s switch, and the full symbol files are placed in the directory that is listed after the -n switch.

When BinPlace strips a symbol file, the stripped and full versions of the file are given identical signatures and other identifying information. This allows you to use either version for debugging.

Note   BinPlace will strip private symbols out of a symbol file when the symbol file is in the same directory as the executable file, and you specify the name of the executable file (along with the appropriate options) on the BinPlace command line. You should not specify the name of the symbol file itself -- doing so will result in BinPlace moving the file without altering it.

If you need to determine whether a symbol file contains private symbols, you can use the SymChk tool. SymChk is part of the Debugging Tools for Windows package, and is documented in the help file accompanying that package. See Debugging Tools for NT-Based Operating Systems for details.

相关阅读 更多 +
排行榜 更多 +
辰域智控app

辰域智控app

系统工具 下载
网医联盟app

网医联盟app

运动健身 下载
汇丰汇选App

汇丰汇选App

金融理财 下载