当前位置:网站首页>Separate save file for debug symbols after strip
Separate save file for debug symbols after strip
2022-06-26 19:42:00 【NoName51C_ T_ O】
Operating system environment
Linux ubuntu 3.2.0-24-generic-pae #37-Ubuntu SMP Wed Apr 25 10:47:59 UTC 2012 i686 i686 i386 GNU/Linux
background :
Generate release Version program , Conduct strip operation , however strip after , The executable program no longer has debugging information and some symbol tables . When something goes wrong , The investigation has brought great difficulties .
As the saying goes :strip The better , When something goes wrong , The worse the headache .
Purpose :
In order to balance , The symbol table is removed , When something goes wrong, you can use the symbol table . The symbol table and executable program are separated .
compiler :
gcc -g test.c -o test
Make a symbol table
objcopy --only-keep-debug test test.dbg
test.dbg: Generated symbol table file
Executable program strip
strip test -o test_release
test_release: after strip The procedure after
already strip Program adds symbol table connection
objcopy --add-gnu-debuglink=test.dbg test_release
test_release: The file already contains the symbol table name connection
here test_release Namely strip Executable program after , When an exception occurs in the program core After the document , take test.dbg Put it in test_release Same directory ,
Can directly gdb test_strip core View segment error location , It's fine too GDB Mount program , This will show more information .
If the library file is strip, You can put debugging information in '/usr/lib/debug'
Where can I put it in gdb In mode , Use command :show debug-file-directory see
Here it is. Ubuntu Tried under the platform . This method can be used for dynamic libraries and executable programs , Static libraries are not allowed strip Of , Because it will work with the final executable program strip.
In the main program of our department , This method should be no problem , Interested colleagues can try , Let the main program also realize this function , Every time release When it comes to programming , At the same time, a symbol table ,
So there won't be any more GDB There's nothing I can do .
边栏推荐
- 链游开发成品源码 链游系统开发详情说明
- What are the specific steps for opening a stock account? Is it safe to open an account online?
- Basic and necessary common plug-ins of vscade
- Tiktok practice ~ sharing module ~ short video download (save to photo album)
- [MySQL series] collection of common working SQL (continuous update)
- Solidity - contract inheritance sub contract contains constructor errors and one contract calls the view function of another contract to charge gas fees
- 元宇宙链游开发案例版 NFT元宇宙链游系统开发技术分析
- 为什么我不推荐去SAP培训机构参加培训?
- 微服务版单点登陆系统(SSO)
- (树) 树状数组
猜你喜欢
随机推荐
超分之VRT
Good thing recommendation: mobile terminal development security tool
C语言 文件光标 fseek
抖音实战~首页视频~下拉刷新
一些基本错误
Boot indicator monitoring
tsconfig. json
uni-app使用canvas绘制二维码
Summary of several common UML diagrams
Reading notes: process consulting III
mysql存储过程
stm32和电机开发(直流有刷电机和步进电机)
微信小程序 uniapp 左滑 删除 带删除icon
品达通用权限系统(Day 1~Day 2)
好物推荐:移动端开发安全工具
成功解决之微服务@Value获取配置文件乱码问题
What are the specific steps for opening a stock account? Is it safe to open an account online?
Wechat applet custom pop-up components
mysql的充值问题
To: seek truth from facts









