Chinaunix首页 | 论坛 | 博客
  • 博客访问: 119732
  • 博文数量: 22
  • 博客积分: 488
  • 博客等级: 下士
  • 技术积分: 265
  • 用 户 组: 普通用户
  • 注册时间: 2009-02-09 09:31
文章分类

全部博文(22)

文章存档

2013年(1)

2011年(20)

2009年(1)

分类:

2011-03-16 10:04:46

The strip command removes the symbol table SHT_SYMTAB and its associated string table, debugging information, and line number information from ELF object files. That  is, besides the symbol table and associated string table, the following
sections are removed:
.line
.debug*
.stab*

该命令从可执行文件、动态链接库,等等,二进制文件的ELF对象文件中删除符号表SHT_SYMTAB,行号信息,调试信息,字符串表;
命令一旦执行成功,那么gdb就读不到这些文件的符号表了,也就不能进行正常的调试了;

一、下面是对可执行文件ISMG_LogServer_SOL10_GCC34_V500_090320执行strip命令前后,gdb命令对它的调试信息的变化:
strip前,用gdb工具调试:
-bash-3.00$ gdb
GNU gdb 6.2.1
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "sparc-sun-solaris2.10".
(gdb) file ISMG_LogServer_SOL10_GCC34_V500_090320
Reading symbols from /export/home1/ismg/ISMG5/bin/ISMG_LogServer_SOL10_GCC34_V500_090320...done.
(gdb)

执行strip命令:
strip ISMG_LogServer_SOL10_GCC34_V500_090320

string后,用gdb工具调试:
-bash-3.00$ gdb
GNU gdb 6.2.1
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "sparc-sun-solaris2.10".
(gdb) file ISMG_LogServer_SOL10_GCC34_V500_090320
Reading symbols from /export/home1/ismg/ISMG5/bin/ISMG_LogServer_SOL10_GCC34_V500_090320...(no debugging symbols found)...done.
(gdb)

二、下面是对可执行文件ISMG_LogServer_SOL10_GCC34_V500_090320执行strip命令前后,文件大小的变化:
strip前,文件的大小:
-bash-3.00$ ls -lt | grep LogServer
-rwxr-xr-x  1 ismg  dba  436944  3月 20日 10:39 ISMG_LogServer_SOL10_GCC34_V500_090320

执行strip命令:
strip ISMG_LogServer_SOL10_GCC34_V500_090320

strip后,文件的大小:
-bash-3.00$ ls -lt | grep LogServer
-rwxr-xr-x  1 ismg  dba  71116  3月 20日 10:40 ISMG_LogServer_SOL10_GCC34_V500_090320

阅读(988) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~