dwarf-assembly/src
2018-08-08 14:33:20 +02:00
..
.gitignore Refactor code generation: use shared/context_struct.h 2018-04-25 18:11:59 +02:00
CodeGenerator.cpp Can generate PC holes in eh_elfs 2018-07-04 18:14:30 +02:00
CodeGenerator.hpp Refactor switch compiler factories 2018-06-25 11:54:45 +02:00
ConseqEquivFilter.cpp Can generate PC holes in eh_elfs 2018-07-04 18:14:30 +02:00
ConseqEquivFilter.hpp Can generate PC holes in eh_elfs 2018-07-04 18:14:30 +02:00
DwarfReader.cpp dwarf-assembly: support common exprs DW_OP_breg<n> 2018-08-08 14:33:20 +02:00
DwarfReader.hpp dwarf-assembly: support common exprs DW_OP_breg<n> 2018-08-08 14:33:20 +02:00
EmptyFdeDeleter.cpp Can generate PC holes in eh_elfs 2018-07-04 18:14:30 +02:00
EmptyFdeDeleter.hpp Can generate PC holes in eh_elfs 2018-07-04 18:14:30 +02:00
FactoredSwitchCompiler.cpp Can generate PC holes in eh_elfs 2018-07-04 18:14:30 +02:00
FactoredSwitchCompiler.hpp Can generate PC holes in eh_elfs 2018-07-04 18:14:30 +02:00
main.cpp Can generate PC holes in eh_elfs 2018-07-04 18:14:30 +02:00
Makefile Can generate PC holes in eh_elfs 2018-07-04 18:14:30 +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 Can generate PC holes in eh_elfs 2018-07-04 18:14:30 +02:00
PcHoleFiller.hpp Can generate PC holes in eh_elfs 2018-07-04 18:14:30 +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
plt_std_expr.hpp Detect PLT standard expression 2018-07-02 16:22:13 +02:00
README.md Add and implement --enable-deref-arg feature 2018-06-01 19:52:41 +02:00
settings.cpp Can generate PC holes in eh_elfs 2018-07-04 18:14:30 +02:00
settings.hpp Can generate PC holes in eh_elfs 2018-07-04 18:14:30 +02:00
SimpleDwarf.cpp Handle rbx 2018-06-22 09:15:10 +02:00
SimpleDwarf.hpp Detect PLT standard expression 2018-07-02 16:22:13 +02:00
SimpleDwarfFilter.cpp Can generate PC holes in eh_elfs 2018-07-04 18:14:30 +02:00
SimpleDwarfFilter.hpp Can generate PC holes in eh_elfs 2018-07-04 18:14:30 +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