Özgür Kesim
554ae92194
gdb_test.go and testdata implement a go test to compare and verify that we get correct results from the scanner. testdata/simple.c is a small program that embeds Python and runs the same code as in runforever.py. The Makefile compiles this using python3.7. Adjustments to the flags might be needed in your environment gdb_test.go contains only one test, TestSimpleGDB, that 1. compiles simple.c 2. runs it multiple times 3. calls gdb to extract the address of symbol _PyRuntime for each pid 4. runs our Scanner 5. compares the results from gdb and our scanner
13 lines
234 B
Makefile
13 lines
234 B
Makefile
CC=gcc
|
|
PC=python3.7dm-config
|
|
PIE=-fPIE # this was necessary on my machine
|
|
CFLAGS=$(shell $(PC) --cflags)
|
|
LDFLAGS=$(shell $(PC) --ldflags)
|
|
|
|
simple: simple.o
|
|
$(CC) -o $@ $< $(LDFLAGS)
|
|
|
|
simple.o: simple.c
|
|
$(CC) -c $(CFLAGS) $(PIE) $<
|
|
|