esp-idf/components/esp_system/test_eh_frame_parser
2024-01-30 15:17:15 +08:00
..
esp_private refactor(system): removed esp_system from astyle ignore list and reformated it 2024-01-30 15:17:15 +08:00
linker.ld refactor(tools): Tidy up core component files copyright ignore 2024-01-22 18:07:35 +08:00
main.c refactor(system): removed esp_system from astyle ignore list and reformated it 2024-01-30 15:17:15 +08:00
Makefile System: implement libunwind library for RISC-V backtracing 2023-05-15 11:19:03 +08:00
README.md espsystem: Rearchitecture and fix eh_frame_parser bugs 2021-07-15 12:47:51 +08:00
sdkconfig.h System: implement libunwind library for RISC-V backtracing 2023-05-15 11:19:03 +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.