Makefile: debug option - attach to running instance
authornorly <ny-git@enpas.org>
Mon, 11 Feb 2013 01:08:31 +0000 (01:08 +0000)
committernorly <ny-git@enpas.org>
Mon, 11 Feb 2013 01:24:36 +0000 (01:24 +0000)
Makefile

index df5f59fc4e95f672bdfc7ba4ca52ea4433d5b21f..726b92af7935ac51716def9c993676bf0b522457 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -21,6 +21,10 @@ LDFLAGS  := -lelf
 default: $(EXE)
 
 
+.PHONY: debug
+debug: $(EXE)
+       gdb $(EXE) $(shell ps -e | sed "s/^ *\([0-9]\+\) .*$(PROJ).*$$/\1/g;te;d;:e")
+
 
 $(EXE): $(OBJS)
        @if [ ! -d $(BUILDDIR) ] ; then echo "Error: Build dir '$(BUILDDIR)' does not exist." ; false ; fi