Zephyr API Documentation 4.0.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
Architecture-specific Stack Walk APIs

To add API support to an architecture, arch_stack_walk() should be implemented and a non-user configurable Kconfig ARCH_HAS_STACKWALK that is default to y should be created in the architecture's top level Kconfig, with all the relevant dependencies. More...

Typedefs

typedef bool(* stack_trace_callback_fn) (void *cookie, unsigned long addr)
 stack_trace_callback_fn - Callback for arch_stack_walk
 

Functions

void arch_stack_walk (stack_trace_callback_fn callback_fn, void *cookie, const struct k_thread *thread, const struct arch_esf *esf)
 Architecture-specific function to walk the stack.
 

Detailed Description

To add API support to an architecture, arch_stack_walk() should be implemented and a non-user configurable Kconfig ARCH_HAS_STACKWALK that is default to y should be created in the architecture's top level Kconfig, with all the relevant dependencies.

Typedef Documentation

◆ stack_trace_callback_fn

typedef bool(* stack_trace_callback_fn) (void *cookie, unsigned long addr)

#include <zephyr/arch/arch_interface.h>

stack_trace_callback_fn - Callback for arch_stack_walk

Parameters
cookieCaller supplied pointer handed back by arch_stack_walk
addrThe stack entry address to consume
Returns
True, if the entry was consumed or skipped. False, if there is no space left to store

Function Documentation

◆ arch_stack_walk()

void arch_stack_walk ( stack_trace_callback_fn callback_fn,
void * cookie,
const struct k_thread * thread,
const struct arch_esf * esf )

#include <zephyr/arch/arch_interface.h>

Architecture-specific function to walk the stack.

Parameters
callback_fnCallback which is invoked by the architecture code for each entry.
cookieCaller supplied pointer which is handed back to callback_fn
threadPointer to a k_thread struct, can be NULL
esfPointer to an arch_esf struct, can be NULL

============ ======= ============================================ thread esf ============ ======= ============================================ thread NULL Stack trace from thread (can be arch_current_thread()) thread esf Stack trace starting on esf ============ ======= ============================================