esp-idf/components/esp_system/test_eh_frame_parser
Sudeep Mohanty a9fda54d39 esp_hw_support/esp_system: Re-evaluate header inclusions and include directories
This commit updates the visibility of various header files and cleans up
some unnecessary inclusions. Also, this commit removes certain header
include paths which were maintained for backward compatibility.
2022-03-07 11:18:08 +05:30
..
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 esp_hw_support/esp_system: Re-evaluate header inclusions and include directories 2022-03-07 11:18:08 +05:30
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.