A compiler from DWARF unwinding data to native x86_64 binaries.
This repository also contains various experiments, tools, benchmarking scripts, stats scripts, etc. to work on this compiler.
As of now, this project relies on the following libraries:
- libelf
- libdwarf
- libdwarfpp, itself depending on
These libraries are expected to be installed somewhere your compiler can find
them. If you are using Archlinux, you can check
these PKGBUILDs.
-
./generate_eh_elf.py: generate.eh_elf.sofiles for a binary (and its dependencies if required) -
./compare_sizes.py: compare the sizes of the.eh_frameof a binary (and its dependencies) with the sizes of the.textof the generated ELFs. -
./extract_pc.py: extracts a list of valid program counters of an ELF and produce a file as read bydwarf-assembly, deprecated. -
benching: all about benchmarking -
env: environment variables manager to ease the use of variouseh_elfs in parallel, for experiments. -
shared: code shared between various subprojects -
src: the compiler code itself -
stack_walker: a primitive stack walker usingeh_elfs -
stack_walker_libunwind: a primitive stack walker using vanillalibunwind -
stats: a statistics gathering module -
tests: some tests regardingeh_elfs, deprecated.
To compile eh_elfs for a given ELF file, say foo.bin, it is recommended to
use generate_eh_elf.py. Help can be obtained with --help. A standard
command is
./generate_eh_elf.py --deps --enable-deref-arg --global-switch -o eh_elfs foo.binThis will compile foo.bin and all the shared objects it relies on into
eh_elfs, in the directory ./eh_elfs, using a dereferencing argument (which
is necessary for perf-eh_elfs).
If you're curious about the intermediary C file generated for a given ELF file
foo.bin, you must call dwarf-assembly directly. A parameter --help can be
passed; a standard command is
./dwarf-assembly --global-switch --enable-deref-arg foo.binBeware! This will generate the C code on the standard output.