Add READMEs

This commit is contained in:
Théophile Bastian 2018-05-15 18:13:09 +02:00
parent ee6e534fc9
commit 209e668505
2 changed files with 34 additions and 0 deletions

View file

@ -18,3 +18,12 @@ As of now, this project relies on the following libraries:
These libraries are expected to be installed somewhere your compiler can find These libraries are expected to be installed somewhere your compiler can find
them. them.
## Scripts and directories
* `./generate_eh_elf.py`: generate `.eh_elf.so` files for a binary (and its
dependencies if required)
* `./compare_sizes.py`: compare the sizes of the `.eh_frame` of a binary (and
its dependencies) with the sizes of the `.text` of the generated ELFs.
* `./extract_pc.py`: extracts a list of valid program counters of an ELF and
produce a file as read by `dwarf-assembly`

25
src/README.md Normal file
View file

@ -0,0 +1,25 @@
# 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`