adinxu
by adinxu
~1 分钟 阅读用时

分类

标签

release版本core推导与相应工具学习_incomplete

一般进行开发工作时,会有debug版本和release版本之分,debug版本方便调试,但与release版本相比,体积臃肿,运行速度慢。一般debug版本会带有符号表与调试信息,而release版本会把符号表和调试信息等strip掉。这时候,如果release版本出现core,而又不具备在debug版本复现的条件,就需要直接在release版本定位,由于没有符号表与调试信息,定位难度极大。
先补充一下基础知识,涉及以下几个方面:
1.nm
2.readelf
3.objdump
4.objcopy
5.strip
6.obj文件段结构
7.符号表与调试信息
8.gdb命令
(gdb) help add-symbol-file
Load symbols from FILE, assuming FILE has been dynamically loaded.
Usage: add-symbol-file FILE ADDR [-s <SECT_ADDR> -s <SECT_ADDR> …]
ADDR is the starting address of the file’s text.
The optional arguments are section-name section-address pairs and
should be specified if the data and bss segments are not contiguous
with the text. SECT is a section name to be loaded at SECT_ADDR.
注意需要正确指定加载地址
info proc mappings

x与disassemble的异同

未完待续。。。
相关文章供参考:
Linux环境Release版本的符号表剥离及调试方法