esp-idf/components/esp_system/test_eh_frame_parser
Omar Chebib 0771bd1711 espsystem: Rearchitecture and fix eh_frame_parser bugs
eh_frame_parser is architecture independent, thus the files have
been rearchitectured. Some bugs have been fixed in the test.
A README file has also been added to eh_frame_parser host test
directory.

eh_frame_parser is now able to detect empty gaps in .eh_frame_hdr
table (missing DWARF information).
Fix a bug occuring when parsing backtraces originated from abort().
Fix build missing dependencies issue.
2021-07-15 12:47:51 +08:00
..
esp_private espsystem: Rearchitecture and fix eh_frame_parser bugs 2021-07-15 12:47:51 +08:00
eh_frame_parser_impl.h espsystem: Rearchitecture and fix eh_frame_parser bugs 2021-07-15 12:47:51 +08:00
linker.ld espsystem: Rearchitecture and fix eh_frame_parser bugs 2021-07-15 12:47:51 +08:00
main.c espsystem: Rearchitecture and fix eh_frame_parser bugs 2021-07-15 12:47:51 +08:00
Makefile espsystem: Rearchitecture and fix eh_frame_parser bugs 2021-07-15 12:47:51 +08:00
README.md espsystem: Rearchitecture and fix eh_frame_parser bugs 2021-07-15 12:47:51 +08:00

Host test for EH_FRAME_PARSER

This test is meant to be run on a Linux x86(_64) host. The main purpose is to trigger a SIGSEV (NULL pointer) exception at runtime in order to generate the backtrace. It is then checked that the functions in the call stack are indeed correctly determined in the right order.

Requirements

A Linux host, x86 or x86_64. In any case, the example will be compiled with the option -m32, it is then required to have gcc multilibs.

Compile the example

To compile the example, simply type:

make

Run the code

Execute the binary generated:

./eh_frame_test

If everything goes well, the output should be as is:

All tests passed

Known issue

DWARF instructions in x86 binaries include the instruction DW_CFA_expression. However, this instruction is not supported by the parser, this is why the test may print the following message:

Unsupported DWARF opcode 0: 0x10

This is not a big problem as the functions implemented for testing the backtrace will not generate unimplemented DWARF instructions.