How To Install dwarves on CentOS 7

In this tutorial we learn how to install dwarves on CentOS 7. dwarves is Debugging Information Manipulation Tools

Introduction

In this tutorial we learn how to install dwarves on CentOS 7.

What is dwarves

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. 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.

We can use yum or dnf to install dwarves on CentOS 7. In this tutorial we discuss both methods but you only need to choose one of method to install dwarves.

Install dwarves on CentOS 7 Using yum

Update yum database with yum using the following command.

sudo yum makecache

After updating yum database, We can install dwarves using yum by running the following command:

sudo yum -y install dwarves

Install dwarves on CentOS 7 Using dnf

If you don’t have dnf installed you can install DNF on CentOS 7 first. Update yum database with dnf using the following command.

sudo dnf makecache

After updating yum database, We can install dwarves using dnf by running the following command:

sudo dnf -y install dwarves

How To Uninstall dwarves on CentOS 7

To uninstall only the dwarves package we can use the following command:

sudo dnf remove dwarves

References

Summary

In this tutorial we learn how to install dwarves on CentOS 7 using yum and dnf.