genode/repos/os
Christian Helmuth 4a2319a4d6 os: limit backtrace to stack of current thread
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
2024-02-26 08:31:02 +01:00
..
doc Remove SIGNAL/CAP/RAM services from run scripts 2022-04-13 08:08:00 +02:00
include os: limit backtrace to stack of current thread 2024-02-26 08:31:02 +01:00
lib monitor: add more debugging features 2023-08-23 13:46:37 +02:00
recipes depot: update recipe hashes 2023-12-13 12:33:05 +01:00
run os/run/test.run: build libs listed in <content> 2023-12-13 12:33:05 +01:00
src vfs/ram_file_system: deferred unlink 2023-12-13 12:33:05 +01:00
xsd sntp_client: add DNS lookup option 2023-11-28 14:24:23 +01:00
README API documentation refinements 2017-05-31 13:16:21 +02:00

This source-code repository contains genuine low-level OS components and
interfaces of Genode. It solely depends on the framework's base API.