当前位置:网站首页>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 .
边栏推荐
猜你喜欢

Kubernetes resource topology aware scheduling optimization

Development of NFT for digital collection platform

超分之VRT

Tiktok practice ~ sharing module ~ generate short video QR code

Six necessary threat tracking tools for threat hunters

数据库范式和主码的选择

Vscode 基础必备 常用插件

【Kubernetes】Kubernetes 原理剖析与实战应用(更新中)

(几何) 凸包问题

Good thing recommendation: mobile terminal development security tool
随机推荐
Résumé des points de connaissance
Wechat applet uniapp left slide delete with Delete Icon
Case description: the competition score management system needs to count the competition scores obtained by previous champions and record them in the file. The system has the following requirements: -
Commodity seckill system
Unit test of boot
On the escape of inequality value
Résolution du problème: la machine virtuelle n'a pas pu copier et coller le fichier
MySQL recharge
抖音实战~分享模块~生成短视频二维码
论数据库的传统与未来之争之溯源溯本----AWS系列专栏
Deep learning: numpy
抖音实战~搜索页面~视频详情
Current limiting design and Implementation
知识点总结
Development principle analysis and source code of dapp-lp single and dual currency liquidity pledge mining system
Boot指标监测
Tiktok practice ~ search page ~ video details
Kubernetes resource topology aware scheduling optimization
Some cold knowledge about QT database development
Request method 'POST' not supported