|
Serene Runtime 1.0.0-dev
C runtime for the Serene programming language
|
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 |
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.
| void* srn_trace_frames_t::return_addrs[TRACE_FRAME_DEPTH] |