GDB is a tool used for debugging
to use, compile code using the -g
flag
e.g. gcc -Wall -Werror -g -o file file.c
(this adds metadata to the executable file that allows gdb to )
run GDB with gdb ./file
<aside>
❓ is lldb
a suitable alternative for mac? https://lldb.llvm.org/use/map.html
</aside>
main usage of gdb is to debug segmentation faults (since they are hard to debug)
valgrind is a program that tries to detect memory leaks (memory that isn’t freed by the program)
similarly to gdb, compile with -g
flag and run with valgrind ./file
<aside>
❓ is leaks
a suitable alternative for mac?