From 1095bbd4c8d2ff5ee1943641fdda2741a77f6069 Mon Sep 17 00:00:00 2001 From: Chia-Che Tsai Date: Thu, 3 Aug 2017 22:43:46 -0400 Subject: [PATCH] Remove two unnecessary files: Pal/test/test.c LibOS/shim/test/pal_loader --- LibOS/shim/test/pal_loader | 1 - Pal/test/test.c | 63 -------------------------------------- 2 files changed, 64 deletions(-) delete mode 120000 LibOS/shim/test/pal_loader delete mode 100644 Pal/test/test.c diff --git a/LibOS/shim/test/pal_loader b/LibOS/shim/test/pal_loader deleted file mode 120000 index 508715d1..00000000 --- a/LibOS/shim/test/pal_loader +++ /dev/null @@ -1 +0,0 @@ -../../../Runtime/pal_loader \ No newline at end of file diff --git a/Pal/test/test.c b/Pal/test/test.c deleted file mode 100644 index df65a5a4..00000000 --- a/Pal/test/test.c +++ /dev/null @@ -1,63 +0,0 @@ -#include // printf -#include // strerror -#include // errno -#include // execl -#include // ptrace -#include // user_regs_struct -#include // personality -#include -#include -#include -#include - -int -main(int argc, char *argv[], char *envp[]) { - - // create a child process - int pid = fork(); - - // if error occurs - if (0 > pid) { - printf("Error during forking: %s\n", strerror(errno)); - return 1; - } - - // child process - if (0 == pid) { - ptrace(PTRACE_TRACEME, 0, 0, 0); - personality(ADDR_NO_RANDOMIZE); - execve(argv[1], &(argv[1]), envp); - } - - // parent process - int status; - struct user_regs_struct regs; - int n; - - wait(&status); - if(1407 == status) { - char infilename[128], line[256], out[256]; - char* outfilename = "/tmp/pal_range"; - int mapfd, ret, outfd; - unsigned long vas; - unsigned long vae; - - sprintf(infilename, "/proc/%d/maps",pid); - while((mapfd = open(infilename,O_RDONLY)) == -1); - read(mapfd, &line, 256); - - /*scan for the virtual addresses*/ - n = sscanf(line, "%lX-%lX r-xp", &vas, &vae); - if(n == 2) - { - outfd = open(outfilename, O_WRONLY|O_CREAT, S_IRUSR); - memset(out,0,256); - sprintf(out,"%lX,%lX\n", vas, vae); - write(outfd, out, 256); - close(outfd); - } - close(mapfd); - } - kill(pid,SIGKILL); - return 0; -}