Start moving examples in S files (#851)
* Move assembly to S files * more assembly files * osx compilation change * makefile mistake * add objcopy from crosstool * use gobjcopy on osx * start cmocka install cleanup * move wget to directory option * move back to cd * fix copy * First cut * free allocated memory * bad idea too much switching between python and c * add debug * cleanup bad size
This commit is contained in:
committed by
Nguyen Anh Quynh
parent
7f116846c0
commit
da21bd0589
@@ -6,6 +6,7 @@
|
||||
#include <setjmp.h>
|
||||
#include <cmocka.h>
|
||||
#include <unicorn/unicorn.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
/**
|
||||
* Assert that err matches expect
|
||||
@@ -38,5 +39,12 @@ do { \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
char * read_file(const char *filename, struct stat *info) {
|
||||
stat(filename, info);
|
||||
char *code = malloc(info->st_size);
|
||||
FILE *fp = fopen(filename, "r");
|
||||
fread(code, info->st_size, 1, fp);
|
||||
return code;
|
||||
}
|
||||
|
||||
#endif /* UNICORN_TEST_H */
|
||||
|
||||
Reference in New Issue
Block a user