构建CentOS dwarves包

dwarves是一系列利用GCC等编译器在ELF二进制文件中插入的调试信息的工具,适用于GDB、systemtap等调试器。工具包括pahole,用于查找C/C++等语言结构体和类中的对齐空洞,以及提取CPU缓存行对齐等信息以优化缓存命中。此外,还有codiff进行源代码更改影响的比较,以及pfunct获取函数相关信息。要安装dwarves,请下载CentOS 8.3.2011的dwarves源码包并按照提示编译。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

dwarves is a set of tools that use the debugging information inserted in
ELF binaries by compilers such as GCC, used by well known debuggers such as
GDB, and more recent ones such as systemtap.

Utilities in the dwarves suite include pahole, that can be used to find
alignment holes in structs and classes in languages such as C, C++, but not
limited to these.

It also extracts other information such as CPU cacheline alignment, helping
pack those structures to achieve more cache hits.

These tools can also be used to encode and read the BTF type information format
used with the Linux kernel bpf syscall, using ‘pahole -J’ and ‘pahole -F btf’.

A diff like tool, codiff can be used to compare the effects changes in source
code generate on the resulting binaries.

Another tool is pfunct, that can be used to find all sorts of information about
functions, inlines, decisions made by the compiler about inlining, etc.

wget -c http://vault.centos.org/8.3.2011/PowerTools/Source/SPackages/dwarves-1.17-1.el8.src.rpm

rpm -ivh dwarves-1.17-1.el8.src.rpm

cd rpmbuild
cd SPECS
rpmbuild -ba dwarvers.spec

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值