Skip to content

Instantly share code, notes, and snippets.

@epilys
Created June 20, 2023 05:44
Show Gist options
  • Save epilys/a29daf5cc49f3ef7aadd082cc19d2655 to your computer and use it in GitHub Desktop.
Save epilys/a29daf5cc49f3ef7aadd082cc19d2655 to your computer and use it in GitHub Desktop.
dbg_macro.c
#define DBG(val) ({ typeof(val) _val = (val); fprintf(stderr, "[%s:%d] %s = ", __FILE__, __LINE__, #val); __builtin_dump_struct(&_val, fprintf, stderr); _val; })
@epilys
Copy link
Author

epilys commented Jun 20, 2023

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment