Added trap for GDB &c.

This commit is contained in:
Jacob Signorovitch 2025-06-18 17:21:45 -04:00
parent 970fc39198
commit 3b5bee0695

View File

@ -1,6 +1,8 @@
#ifndef UTIL_H #ifndef UTIL_H
#define UTIL_H #define UTIL_H
#include <signal.h>
// Most of this file is cursed printing macros for `ast_print()`. Do not attempt // Most of this file is cursed printing macros for `ast_print()`. Do not attempt
// to comprehend. // to comprehend.
@ -10,6 +12,9 @@
// Get the length of an array. // Get the length of an array.
#define arrln(A) (sizeof(A)/sizeof(*A)) #define arrln(A) (sizeof(A)/sizeof(*A))
// Trap GDB &c.
#define TRAP() RAISE(SIGTRAP)
#ifdef DBG // Debug macros #ifdef DBG // Debug macros
// Log a message. // Log a message.