diff --git a/.debugusrc1.js.txt b/.debugusrc1.js similarity index 100% rename from .debugusrc1.js.txt rename to .debugusrc1.js diff --git a/.gitignore b/.gitignore index f133de9..af914b1 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,3 @@ *.d debugus test -.debugusrc1.js diff --git a/Makefile b/Makefile index 8df3dcc..9174ae7 100644 --- a/Makefile +++ b/Makefile @@ -6,17 +6,14 @@ SRCS=debugus.c linenoise.c hash.c pmparser.c OBJS=$(patsubst %.c,%.o,$(SRCS)) DEPS=$(patsubst %.c,%.d,$(SRCS)) -all: debugus .debugusrc1.js test +all: debugus test -test: test.o - $(CC) $(CFLAGS) -o $@ $^ +test: test.o test2.o + $(CC) -o $@ $^ debugus: $(OBJS) ./mujs/build/debug/libmujs.o ./libelfin_wrap.o $(CC) -o $@ $^ $(LDFLAGS) -.debugusrc1.js: test .debugusrc1.js.txt - cat .debugusrc1.js.txt | sed "s/@DUPA_ADDR/0x$$(nm ./test | grep 'dupa' | awk '{ print $$1 }')/g" > .debugusrc1.js - ./mujs/build/debug/libmujs.o: make -C mujs -j$(shell nproc) @@ -25,7 +22,7 @@ debugus: $(OBJS) ./mujs/build/debug/libmujs.o ./libelfin_wrap.o -include $(DEPS) -clean: $(OBJS) test.o $(DEPS) .debugusrc1.js +clean: $(OBJS) test.o test2.o $(DEPS) rm -f $^ make -C mujs clean diff --git a/test.c b/test.c index 3ea7283..e0d9c33 100644 --- a/test.c +++ b/test.c @@ -2,6 +2,8 @@ #include #include +extern void dupa2(void); + void dupa(void) { printf("a\n"); printf("b\n"); @@ -19,6 +21,8 @@ int main(void) } } + dupa2(); + int *a = NULL; *a = 6969; diff --git a/test2.c b/test2.c new file mode 100644 index 0000000..55a22fc --- /dev/null +++ b/test2.c @@ -0,0 +1,7 @@ +#include + +void dupa2(void) +{ + printf("function in test2.c\n"); +} +