diff for duplicates of <576E509A.7090702@huawei.com> diff --git a/a/1.txt b/N1/1.txt index 03b9511..f4835f9 100644 --- a/a/1.txt +++ b/N1/1.txt @@ -101,3 +101,116 @@ index d85fe94..06d5e1b 100644 #undef __SYSCALL -- 1.7.7 + + + +-------------- next part -------------- +#include <stdio.h> +#include <stdlib.h> +#include <sys/ptrace.h> +#include <unistd.h> +#include <errno.h> +#include <sys/types.h> +#include <sys/wait.h> +#include <sys/user.h> +#include <signal.h> + +int main() +{ + pid_t child; + unsigned long exit_status; + int status; + int is_get_event = 0; + long ptrace_ret; + + int result = SIGTRAP | (PTRACE_EVENT_EXIT<<8); + + child = fork(); + if(child < 0) + { + printf("fork error\n"); + exit(1); + } + else if(child == 0) + { + sleep(1); + exit(127); + } + else + { + ptrace_ret = ptrace(PTRACE_ATTACH, child, NULL, NULL); + if(ptrace_ret != 0) + { + printf("ptrace PTRACE_ATTACH error %d \n", errno); + exit(1); + } + + printf("ATTACH SUCCESS\n"); + sleep(1); + + ptrace_ret = ptrace(PTRACE_SETOPTIONS, child, NULL, PTRACE_O_TRACEEXIT); + if(ptrace_ret != 0) + { + printf("ptrace PTRACE_SETOPTIONS PTRACE_O_TRACEFORK error %d \n", errno); + ptrace(PTRACE_DETACH, child, NULL, NULL); + exit(1); + } + + printf("SETOPTIONS SUCCESS!\n"); + + while(1) + { + usleep(1); + pid_t pid; + if ((pid = wait(&status)) == -1) { + perror("wait"); + exit(1); + }; + + printf("pid : %d\n", pid); + printf("the child process stops. status: %d, signal? %d, exit? %d, continue? %d, stop? %d\n" , WEXITSTATUS(status) , WIFSIGNALED(status) , WIFEXITED(status) , WIFCONTINUED(status) ,WIFSTOPPED(status)); + + if (WSTOPSIG(status) == SIGTRAP) + { + printf("status : %d\n", status>>8); + if (status>>8 == result) + { + if (ptrace(PTRACE_GETEVENTMSG, child, NULL, &exit_status)) + { + perror("error geteventmsg"); + exit(1); + } + + printf("exit_status %d\n", WEXITSTATUS((int)exit_status)); + + exit_status = WEXITSTATUS(exit_status); + + if (exit_status != 127) + { + printf("exit status is not equal with 127!\n"); + exit(1); + } + is_get_event = 1; + } + } + + if (WIFEXITED(status)) + { + printf("child exit!\n"); + break; + } + + if(ptrace(PTRACE_CONT, pid, NULL, (void *) SIGCONT)) + { + printf("ptrace cont %d error %d\n", pid, errno); + exit(1); + } + + } + + if (is_get_event) + exit(0); + else + exit(1); + } +} diff --git a/a/2.hdr b/a/2.hdr deleted file mode 100644 index e3012f9..0000000 --- a/a/2.hdr +++ /dev/null @@ -1,4 +0,0 @@ -Content-Type: text/plain; charset="gb18030"; - name="tc_ptrace_setoptions_09.c" -Content-Transfer-Encoding: 7bit -Content-Disposition: attachment; filename="tc_ptrace_setoptions_09.c" diff --git a/a/2.txt b/a/2.txt deleted file mode 100644 index eea22e6..0000000 --- a/a/2.txt +++ /dev/null @@ -1,109 +0,0 @@ -#include <stdio.h> -#include <stdlib.h> -#include <sys/ptrace.h> -#include <unistd.h> -#include <errno.h> -#include <sys/types.h> -#include <sys/wait.h> -#include <sys/user.h> -#include <signal.h> - -int main() -{ - pid_t child; - unsigned long exit_status; - int status; - int is_get_event = 0; - long ptrace_ret; - - int result = SIGTRAP | (PTRACE_EVENT_EXIT<<8); - - child = fork(); - if(child < 0) - { - printf("fork error\n"); - exit(1); - } - else if(child == 0) - { - sleep(1); - exit(127); - } - else - { - ptrace_ret = ptrace(PTRACE_ATTACH, child, NULL, NULL); - if(ptrace_ret != 0) - { - printf("ptrace PTRACE_ATTACH error %d \n", errno); - exit(1); - } - - printf("ATTACH SUCCESS\n"); - sleep(1); - - ptrace_ret = ptrace(PTRACE_SETOPTIONS, child, NULL, PTRACE_O_TRACEEXIT); - if(ptrace_ret != 0) - { - printf("ptrace PTRACE_SETOPTIONS PTRACE_O_TRACEFORK error %d \n", errno); - ptrace(PTRACE_DETACH, child, NULL, NULL); - exit(1); - } - - printf("SETOPTIONS SUCCESS!\n"); - - while(1) - { - usleep(1); - pid_t pid; - if ((pid = wait(&status)) == -1) { - perror("wait"); - exit(1); - }; - - printf("pid : %d\n", pid); - printf("the child process stops. status: %d, signal? %d, exit? %d, continue? %d, stop? %d\n" , WEXITSTATUS(status) , WIFSIGNALED(status) , WIFEXITED(status) , WIFCONTINUED(status) ,WIFSTOPPED(status)); - - if (WSTOPSIG(status) == SIGTRAP) - { - printf("status : %d\n", status>>8); - if (status>>8 == result) - { - if (ptrace(PTRACE_GETEVENTMSG, child, NULL, &exit_status)) - { - perror("error geteventmsg"); - exit(1); - } - - printf("exit_status %d\n", WEXITSTATUS((int)exit_status)); - - exit_status = WEXITSTATUS(exit_status); - - if (exit_status != 127) - { - printf("exit status is not equal with 127!\n"); - exit(1); - } - is_get_event = 1; - } - } - - if (WIFEXITED(status)) - { - printf("child exit!\n"); - break; - } - - if(ptrace(PTRACE_CONT, pid, NULL, (void *) SIGCONT)) - { - printf("ptrace cont %d error %d\n", pid, errno); - exit(1); - } - - } - - if (is_get_event) - exit(0); - else - exit(1); - } -} diff --git a/a/content_digest b/N1/content_digest index 3fea1e7..38c31fc 100644 --- a/a/content_digest +++ b/N1/content_digest @@ -2,34 +2,11 @@ "ref\01464048292-30136-18-git-send-email-ynorov@caviumnetworks.com\0" "ref\057577611.9000607@huawei.com\0" "ref\020160608170048.GA24482@yury-N73SV\0" - "From\0zhouchengming <zhouchengming1@huawei.com>\0" - "Subject\0Re: [PATCH 17/23] arm64: ptrace: handle ptrace_request differently for aarch32 and ilp32\0" + "From\0zhouchengming1@huawei.com (zhouchengming)\0" + "Subject\0[PATCH 17/23] arm64: ptrace: handle ptrace_request differently for aarch32 and ilp32\0" "Date\0Sat, 25 Jun 2016 17:36:26 +0800\0" - "To\0Yury Norov <ynorov@caviumnetworks.com>\0" - "Cc\0arnd@arndb.de" - catalin.marinas@arm.com - linux-arm-kernel@lists.infradead.org - linux-kernel@vger.kernel.org - linux-doc@vger.kernel.org - linux-arch@vger.kernel.org - linux-s390@vger.kernel.org - libc-alpha@sourceware.org - kilobyte@angband.pl - pinskia@gmail.com - szabolcs.nagy@arm.com - Nathan_Lynch@mentor.com - heiko.carstens@de.ibm.com - agraf@suse.de - geert@linux-m68k.org - Prasun.Kapoor@caviumnetworks.com - klimov.linux@gmail.com - broonie@kernel.org - schwidefsky@de.ibm.com - bamvor.zhangjian@huawei.com - philipp.tomsich@theobroma-systems.com - joseph@codesourcery.com - " christoph.muellner@theobroma-systems.com\0" - "\01:1\0" + "To\0linux-arm-kernel@lists.infradead.org\0" + "\00:1\0" "b\0" "On 2016/6/9 1:00, Yury Norov wrote:\n" "> On Wed, Jun 08, 2016 at 09:34:09AM +0800, zhouchengming wrote:\n" @@ -133,10 +110,11 @@ "\n" " #undef __SYSCALL\n" "-- \n" - 1.7.7 - "\01:2\0" - "fn\0tc_ptrace_setoptions_09.c\0" - "b\0" + "1.7.7\n" + "\n" + "\n" + "\n" + "-------------- next part --------------\n" "#include <stdio.h>\n" "#include <stdlib.h>\n" "#include <sys/ptrace.h>\n" @@ -247,4 +225,4 @@ " }\n" } -8b7af1864529f8797dd0b51973125dc51b4b4f5795b38154509f97473e970806 +f9467ecda2fbd2a18542607e728d1dcbe10d0d727791f4ac292d85d144780d53
diff --git a/a/content_digest b/N2/content_digest index 3fea1e7..2b1e60e 100644 --- a/a/content_digest +++ b/N2/content_digest @@ -6,29 +6,29 @@ "Subject\0Re: [PATCH 17/23] arm64: ptrace: handle ptrace_request differently for aarch32 and ilp32\0" "Date\0Sat, 25 Jun 2016 17:36:26 +0800\0" "To\0Yury Norov <ynorov@caviumnetworks.com>\0" - "Cc\0arnd@arndb.de" - catalin.marinas@arm.com - linux-arm-kernel@lists.infradead.org - linux-kernel@vger.kernel.org - linux-doc@vger.kernel.org - linux-arch@vger.kernel.org - linux-s390@vger.kernel.org - libc-alpha@sourceware.org - kilobyte@angband.pl - pinskia@gmail.com - szabolcs.nagy@arm.com - Nathan_Lynch@mentor.com - heiko.carstens@de.ibm.com - agraf@suse.de - geert@linux-m68k.org - Prasun.Kapoor@caviumnetworks.com - klimov.linux@gmail.com - broonie@kernel.org - schwidefsky@de.ibm.com - bamvor.zhangjian@huawei.com - philipp.tomsich@theobroma-systems.com - joseph@codesourcery.com - " christoph.muellner@theobroma-systems.com\0" + "Cc\0<arnd@arndb.de>" + <catalin.marinas@arm.com> + <linux-arm-kernel@lists.infradead.org> + <linux-kernel@vger.kernel.org> + <linux-doc@vger.kernel.org> + <linux-arch@vger.kernel.org> + <linux-s390@vger.kernel.org> + <libc-alpha@sourceware.org> + <kilobyte@angband.pl> + <pinskia@gmail.com> + <szabolcs.nagy@arm.com> + <Nathan_Lynch@mentor.com> + <heiko.carstens@de.ibm.com> + <agraf@suse.de> + <geert@linux-m68k.org> + <Prasun.Kapoor@caviumnetworks.com> + <klimov.linux@gmail.com> + <broonie@kernel.org> + <schwidefsky@de.ibm.com> + <bamvor.zhangjian@huawei.com> + <philipp.tomsich@theobroma-systems.com> + <joseph@codesourcery.com> + " <christoph.muellner@theobroma-systems.com>\0" "\01:1\0" "b\0" "On 2016/6/9 1:00, Yury Norov wrote:\n" @@ -247,4 +247,4 @@ " }\n" } -8b7af1864529f8797dd0b51973125dc51b4b4f5795b38154509f97473e970806 +dadc76cdcabda1b8a9266019b2c7a67fdca517307ff22386b9337c4543e864b9
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.