From e203ccda208abdea1d8d95cbbccb718ae17927ed Mon Sep 17 00:00:00 2001 From: Randy Heit Date: Sun, 8 Jun 2008 02:31:30 +0000 Subject: [PATCH] - Added self-modifying code notifications for Valgrind. Build with make VALGRIND=1 to turn them on. SVN r1025 (trunk) --- Makefile.linux | 7 +++++++ docs/rh-log.txt | 4 ++++ src/a.nas | 9 +++++++++ src/tmap.nas | 15 +++++++++++++++ src/tmap2.nas | 9 +++++++++ src/tmap3.nas | 6 ++++++ src/valgrind.inc | 31 +++++++++++++++++++++++++++++++ 7 files changed, 81 insertions(+) create mode 100644 src/valgrind.inc diff --git a/Makefile.linux b/Makefile.linux index 505fa34ac7..ec3299a30f 100644 --- a/Makefile.linux +++ b/Makefile.linux @@ -32,6 +32,11 @@ CFLAGS += -Dstricmp=strcasecmp -Dstrnicmp=strncasecmp -DNEED_STRUPR LDFLAGS += -lz -ljpeg `sdl-config --libs` `pkg-config gtk+-2.0 --libs` $(FMOD_PREFIX)/lib/libfmodex${X64}.so NASMFLAGS += -f elf -DM_TARGET_LINUX +ifdef VALGRIND + NOSTRIP = 1 + NASMFLAGS += -DVALGRIND_AWARE +endif + SRCDIRS = src/ $(addprefix src/,g_doom/ g_heretic/ g_hexen/ g_raven/ g_shared/ g_strife/ oplsynth/ sound/ sdl/ textures/ thingdef/ xlat/ timidity/) VPATH = $(SRCDIRS) INCLUDES = $(addprefix -I,$(SRCDIRS)) @@ -71,6 +76,8 @@ else LDFLAGS += -Wl,-Map=$(ZDOOM).map ifndef NOSTRIP LDFLAGS += -s + else + CFLAGS += -g endif ZDOOMBIN = $(ZDOOM) endif diff --git a/docs/rh-log.txt b/docs/rh-log.txt index eb86a25eed..5fc4ef8569 100644 --- a/docs/rh-log.txt +++ b/docs/rh-log.txt @@ -1,3 +1,7 @@ +June 7, 2008 +- Added self-modifying code notifications for Valgrind. + Build with make VALGRIND=1 to turn them on. + June 6, 2008 - Fixed: There was still an inventory bar check in FMugShot::GetFace() after separating it from DDoomStatusBar. diff --git a/src/a.nas b/src/a.nas index d4c4cf68fb..cdcbd7f0fd 100644 --- a/src/a.nas +++ b/src/a.nas @@ -3,6 +3,8 @@ ; See the included license file "BUILDLIC.TXT" for license info. ; This file has been modified from Ken Silverman's original release +%include "src/valgrind.inc" + SECTION .data %ifndef M_TARGET_LINUX @@ -56,6 +58,7 @@ setvlinebpl_: mov [fixchain1m+2], eax mov [fixchain2ma+2], eax mov [fixchain2mb+2], eax + selfmod fixchain1a, fixchain2mb+6 ret ; pass it log2(texheight) @@ -87,6 +90,7 @@ setupvlineasm: dec eax mov dword [machvsh2+2], eax ;(1<