dwarf-assembly/src
2018-06-25 16:56:07 +02:00
..
.gitignore Refactor code generation: use shared/context_struct.h 2018-04-25 18:11:59 +02:00
CodeGenerator.cpp Merge branch 'rbx' into lighter_c_rbx 2018-06-25 16:56:07 +02:00
CodeGenerator.hpp Refactor switch compiler factories 2018-06-25 11:54:45 +02:00
ConseqEquivFilter.cpp Handle rbx 2018-06-22 09:15:10 +02:00
ConseqEquivFilter.hpp Filter out consecutive equal DWARF lines 2018-06-22 09:01:57 +02:00
DwarfReader.cpp Handle rbx 2018-06-22 09:15:10 +02:00
DwarfReader.hpp SimpleDwarf, DwarfReader: fix machine registers 2018-04-23 16:46:03 +02:00
FactoredSwitchCompiler.cpp Add FactoredSwitchCompiler - great space gain 2018-06-25 16:32:52 +02:00
FactoredSwitchCompiler.hpp Add FactoredSwitchCompiler - great space gain 2018-06-25 16:32:52 +02:00
main.cpp Add FactoredSwitchCompiler - great space gain 2018-06-25 16:32:52 +02:00
Makefile Add FactoredSwitchCompiler - great space gain 2018-06-25 16:32:52 +02:00
NativeSwitchCompiler.cpp Add FactoredSwitchCompiler - great space gain 2018-06-25 16:32:52 +02:00
NativeSwitchCompiler.hpp Add FactoredSwitchCompiler - great space gain 2018-06-25 16:32:52 +02:00
PcHoleFiller.cpp Patch holes in big switches 2018-06-20 14:13:19 +02:00
PcHoleFiller.hpp Patch holes in big switches 2018-06-20 14:13:19 +02:00
PcListReader.cpp Fix various problems in PC list handling 2018-05-11 15:52:38 +02:00
PcListReader.hpp Fix various problems in PC list handling 2018-05-11 15:52:38 +02:00
README.md Add and implement --enable-deref-arg feature 2018-06-01 19:52:41 +02:00
settings.cpp Add and implement --enable-deref-arg feature 2018-06-01 19:52:41 +02:00
settings.hpp Add and implement --enable-deref-arg feature 2018-06-01 19:52:41 +02:00
SimpleDwarf.cpp Handle rbx 2018-06-22 09:15:10 +02:00
SimpleDwarf.hpp Handle rbx 2018-06-22 09:15:10 +02:00
SimpleDwarfFilter.cpp Patch holes in big switches 2018-06-20 14:13:19 +02:00
SimpleDwarfFilter.hpp Patch holes in big switches 2018-06-20 14:13:19 +02:00
SwitchStatement.cpp Refactor switch compiler factories 2018-06-25 11:54:45 +02:00
SwitchStatement.hpp Add FactoredSwitchCompiler - great space gain 2018-06-25 16:32:52 +02:00

Dwarf-assembly

Generates C code from the DWARF embedded in an ELF file. This code can then be compiled into a .so, and used to unwind stack frames.

Options

Switch generation policy

The code can either generate one big switch statement for every PC in the ELF, or one switch and a function per FDE, plus a lookup function.

One of the two options must be passed:

  • --switch-per-func: one switch and function per FDE;
  • --global-switch: a single big switch for the whole ELF.

PC list

Instead of generating interval switches (eg case 0x42 ... 0x100), it is possible to provide a binary file (generated by ../extract_pc.py) containing a list of all PCs in the ELF. The file contains one 8-bytes chunk per PC, which is the PC in little endian.

--pc-list PC_LIST_FILE_PATH

Dereferencing function

The lookup functions can also take an additional argument, a pointer to a function of prototype

  uintptr_t deref(uintptr_t address)

that will, in spirit, contain a return *((uintptr_t*)address);.

This argument can be used to work on remote address spaces instead of local address spaces, eg. to work with libunwind.

To enable the presence of this argument, you must pass the option --enable-deref-arg