diff --git a/Makefile b/Makefile index ba8455d..7f29c4f 100644 --- a/Makefile +++ b/Makefile @@ -201,12 +201,17 @@ bear: clean $(CCLSROOT) @touch .ccls-root @$(BEAR) -- make compile -##################################### LSP (ccls) +##################################### valgrind (mem check) .PHONY: memcheck VALGRIND = valgrind VALGRINDFLAGS = --leak-check=full --show-leak-kinds=all VALGRINDFLAGS += --track-origins=yes --sigill-diagnostics=yes VALGRINDFLAGS += --quiet --show-error-list=yes +VALGRINDFLAGS += --log-file=valgrind.out +# We need to suppress libreadline leaks here. See : +# https://stackoverflow.com/questions/72840015 +VALGRINDFLAGS += --suppressions=etc/libreadline.supp -memcheck: brchess +memcheck: bin + @$(VALGRIND) $(VALGRINDFLAGS) ./brchess diff --git a/etc/libreadline.supp b/etc/libreadline.supp new file mode 100644 index 0000000..75210e5 --- /dev/null +++ b/etc/libreadline.supp @@ -0,0 +1,6 @@ +{ + ignore_libreadline_leaks + Memcheck:Leak + ... + obj:*/libreadline.so.* +} \ No newline at end of file