gdb: disable ghc's rts timer and disable signal handlers
[mate.git] / Makefile
index b9033167dd764159eda5d0945982947257983124..cd0e887209a88be9fbdbc39a696c29faf0d5f59a 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -15,7 +15,7 @@ O_STATIC_FILES = $(shell ls $(B_STATIC)/Mate/*.o) $(wildcard $(B_STATIC)/ffi/*.o
 PACKAGES_ := bytestring harpy hs-java plugins
 PACKAGES := $(addprefix -package ,$(PACKAGES_))
 
-GHC_OPT := -I. -Wall -O0 -fno-warn-unused-do-bind
+GHC_OPT := -I. -Wall -O0 -fno-warn-unused-do-bind -rtsopts
 GHC_LD := -optl-Xlinker -optl-x
 
 
@@ -40,7 +40,7 @@ COMPILEF = $(basename $@).compile
 %.class: %.java
        @if [ -f $(COMPILEF) ]; \
                then $(SHELL) $(COMPILEF); \
-               else $(JAVAC) $<; fi
+               else $(JAVAC) $(JAVA_FILES) $<; fi
        @echo "JAVAC $<"
 
 ffi/native.o: ffi/native.c
@@ -58,6 +58,9 @@ mate.static: Mate.hs ffi/trap.c $(HS_FILES) $(HS_BOOT) ffi/native.o $(CLASS_FILE
 %.dbg: %.class mate.dbg
        ./mate.dbg $(basename $<)
 
+%.gdb: %.class mate.dbg
+       gdb -x .gdbcmds -q --args mate.dbg $(basename $<) +RTS -V0 --install-signal-handlers=no
+
 ifeq (${DBGFLAGS},)
 DEBUGFLAGS = -DDBG_JIT -DDBG_MP
 else
@@ -69,7 +72,8 @@ mate.dbg: Mate.hs ffi/trap.c $(HS_FILES) $(HS_BOOT) ffi/native.o
        ghc --make $(DEBUGFLAGS) $(GHC_OPT) Mate.hs $(B_DEBUG)/ffi/trap.o -o $@ $(GHC_LD) -outputdir $(B_DEBUG)
 
 clean:
-       rm -rf $(BUILD) mate mate.dbg tags ffi/native.o tests/*.class Mate/*_stub.* \
+       rm -rf $(BUILD) mate mate.static mate.dbg tags ffi/native.o \
+               tests/*.class Mate/*_stub.* \
                jmate/lang/*.class jmate/io/*.class java/io/*.class \
                java/lang/{Integer,Character,String,System}.class