* fix finding python path which only has python3.

* fix #1246, arm host issue.

* skip assembler tests on non-x86 host.

* update macro of dummy value.

* fix MSVC macro.

* update dummy array value macro.

* restore to original qemu code.
This commit is contained in:
Chen Huitao
2020-05-18 19:57:44 +08:00
committed by GitHub
parent 08240d5453
commit 2c66acf4ee
7 changed files with 29 additions and 6 deletions

View File

@@ -7,6 +7,7 @@ ASFLAGS += --32
OBJCOPY = objcopy
UNAME_S := $(shell uname -s)
UNAME_M := $(shell uname -m)
LDLIBS += -pthread
ifeq ($(UNAME_S), Linux)
LDLIBS += -lrt
@@ -32,12 +33,16 @@ TEST_PROGS = $(TEST_ASSEMBLY:%.s=%.o)
TEST_BINS = $(TEST_PROGS:%.o=%.bin)
ALL_TESTS = $(ALL_TESTS_SOURCES:%.c=%)
ifneq (,$(findstring x86,$(UNAME_M)))
ALL_TESTS += $(TEST_BINS)
endif
.PHONY: all
all: ${TEST_BINS} ${ALL_TESTS}
all: ${ALL_TESTS}
.PHONY: clean
clean:
rm -rf ${TEST_BINS} ${ALL_TESTS}
rm -rf ${ALL_TESTS}
%.bin: %.o
${OBJCOPY} -O binary $^ $@

View File

@@ -92,6 +92,9 @@ static void test_high_address_read_values(void **state)
uc_engine *uc = *state;
struct stat info;
char * code = read_file("high_address.bin", &info);
if (code == NULL) {
return;
}
uint64_t addr = 0x0010000000000001;
//addr = 0x000ffffffffffff8; // uncomment to fix wrong behaviour

View File

@@ -57,6 +57,9 @@ static void test_pc_change(void **state)
int32_t r_ecx = 3, r_edx = 15;
struct stat info;
char *code = read_file("pc_change.bin", &info);
if (code == NULL) {
return;
}
#define BASEADDR 0x1000000

View File

@@ -42,7 +42,14 @@ do { \
char * read_file(const char *filename, struct stat *info) {
stat(filename, info);
char *code = malloc(info->st_size);
if (code == NULL) {
return NULL;
}
FILE *fp = fopen(filename, "r");
if (fp == NULL) {
free(code);
return NULL;
}
fread(code, info->st_size, 1, fp);
return code;
}