From 8ec19f523b94ac0ebc47f200a34a0a9fd91ecb60 Mon Sep 17 00:00:00 2001 From: Thomas Bernard Date: Thu, 15 Feb 2018 15:11:38 +0100 Subject: [PATCH] Easy leakchecks with "make valgrind" result is readable thanks to the suppression file --- src/Makefile | 5 +- valgrind.grafx2.suppr | 103 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 107 insertions(+), 1 deletion(-) create mode 100644 valgrind.grafx2.suppr diff --git a/src/Makefile b/src/Makefile index 4f0192bc..cc654ed0 100644 --- a/src/Makefile +++ b/src/Makefile @@ -528,7 +528,7 @@ endif ### And now for the real build rules ### -.PHONY : all debug release clean depend zip force install uninstall +.PHONY : all debug release clean depend zip force install uninstall valgrind # This is the list of the objects we want to build. Dependancies are built by "make depend" automatically. OBJS = main.o init.o graph.o sdlscreen.o misc.o special.o \ @@ -797,5 +797,8 @@ uninstall : endif +valgrind: $(BIN) + valgrind --suppressions=../valgrind.grafx2.suppr --leak-check=full --show-leak-kinds=all --num-callers=20 $(BIN) + -include Makefile.dep diff --git a/valgrind.grafx2.suppr b/valgrind.grafx2.suppr new file mode 100644 index 00000000..4bbc7ac6 --- /dev/null +++ b/valgrind.grafx2.suppr @@ -0,0 +1,103 @@ +{ + SDL_Init_1 + Memcheck:Cond + ... + fun:SDL_InitSubSystem + fun:SDL_Init + fun:Init_program + fun:main +} +{ + SDL_Init_2 + Memcheck:Value8 + ... + fun:SDL_InitSubSystem + fun:SDL_Init + fun:Init_program + fun:main +} +{ + SDL_Init Leaks + Memcheck:Leak + match-leak-kinds: all + ... + fun:SDL_InitSubSystem + fun:SDL_Init + ... +} +{ + SDL_VideoInit Leaks + Memcheck:Leak + match-leak-kinds: all + ... + fun:SDL_VideoInit + ... +} +{ + SDL_JoystickOpen + Memcheck:Cond + ... + fun:SDL_JoystickOpen + fun:Init_program + fun:main +} +{ + SDL_JoystickOpen 2 + Memcheck:Value8 + ... + fun:SDL_JoystickOpen + fun:Init_program + fun:main +} +{ + SDL_WM_SetCaption + Memcheck:Cond + ... + fun:SDL_WM_SetCaption + fun:Init_program +} +{ + SDL_WM_SetCaption_2 + Memcheck:Param + openat(filename) + fun:_openat + ... + fun:SDL_WM_SetCaption +} +{ + SDK_WM_SetCaption Leaks + Memcheck:Leak + match-leak-kinds: all + ... + fun:SDL_WM_SetCaption + fun:Init_program +} +{ + SDL_SetVideoMode + Memcheck:Param + writev(vector[...]) + fun:_writev + ... + fun:SDL_SetVideoMode + fun:Set_mode_SDL + fun:Init_mode_video +} +{ + SDL_JoystrickUpdate + Memcheck:Param + read(count) + fun:_read + ... + fun:SDL_JoystickUpdate + ... + fun:main +} +{ + SDL_JoystrickUpdate2 + Memcheck:Cond + ... + fun:SDL_JoystickUpdate + ... + fun:main +} +