mirror of
https://github.com/genodelabs/genode.git
synced 2024-12-22 15:02:25 +00:00
4a2319a4d6
The frame-pointer-based backtrace does not work without enabling -fno-omit-frame-pointer explicitly and in most cases leads to page faults because non-pointer stack values are dereferenced during the walk. The best we can do is to limit the backtrace walk to the stack of the current thread to prevent page faults unrelated to the system state without the use of the backtrace utility. This commit introduces a printable Backtrace class usable in Genode::log(), Genode::trace(), etc. The class is based on the new function for_each_return_address(auto const &fn) that walks the stack in its limits and calls fn() for each discovered return address on the stack in the new os/include/os/backtrace.h. Archtecture-specific stack-pointer retrieval and walk loops are implemented in dedicated os/include/spec/<arch>/os/for_each_return_address.h files. Also, the well-known Genode::backtrace() function (which logs the return-address values) is provided for backwards compatibility. Fixes #5078 |
||
---|---|---|
.. | ||
arm/os | ||
arm_64/os | ||
x86_32/os | ||
x86_64/os |