This repo contains some simple but very helpful tools for debugging your code.
debug_str(string, name of string)
debug_nbr(integer, name of integer)
check_leaks()
- Run
make
to create a library of the debug functions - Now you can add the function prototypes to your functions
- Check the
test.c
file for an easy example for a test main.c - Copy
debug.a
into your project folder to use it freely - Compile your test and run:
gcc test.c debug.a && ./a.out
-
Ever wondered what the difference is between SEGFAULT and BUS error?
-
A descriptive wiki about memory management:
man RTFM
- Shoutout to Rostyslav Druzhchenko for the leak checker gist
- Go give him a star!