Serene Runtime 1.0.0-dev
C runtime for the Serene programming language
Loading...
Searching...
No Matches
srn_trace_frames_t Struct Reference

This is how we create a traceback for the C level code in the runtime lib. More...

#include <errors.h>

Data Fields

void * return_addrs [TRACE_FRAME_DEPTH]
uint16_t count

Detailed Description

This is how we create a traceback for the C level code in the runtime lib.

It's similar to how Zig handles it as well. The hard part is to remember to call __builtin_return_address(0) every time we return an error and add the address to this array. Later we can use dladdr on POSIX (and SymFromAddr on Windows) to resolve the function name, and look up the line number in DWARF data when printing the error.

Definition at line 164 of file errors.h.

Field Documentation

◆ count

uint16_t srn_trace_frames_t::count

Definition at line 166 of file errors.h.

◆ return_addrs

void* srn_trace_frames_t::return_addrs[TRACE_FRAME_DEPTH]

Definition at line 165 of file errors.h.


The documentation for this struct was generated from the following file: