forked from enlightenment/enlightenment
by popular (overwhelming) demand, -i-really-know-what-i-am-doing-and-accept-full-responsibility-for-it now prevents enlightenment_start from ptracing, which allows gdb attaching once more
SVN revision: 79202
This commit is contained in:
parent
80858ec4fc
commit
e97ccf53cd
|
@ -417,8 +417,9 @@ main(int argc, char **argv)
|
|||
else if (child == 0)
|
||||
{
|
||||
#ifdef HAVE_SYS_PTRACE_H
|
||||
/* in the child */
|
||||
ptrace(PT_TRACE_ME, 0, NULL, NULL);
|
||||
if (!really_know)
|
||||
/* in the child */
|
||||
ptrace(PT_TRACE_ME, 0, NULL, NULL);
|
||||
#endif
|
||||
execv(args[0], args);
|
||||
return 0; /* We failed, 0 mean normal exit from E with no restart or crash so let exit */
|
||||
|
@ -431,11 +432,12 @@ main(int argc, char **argv)
|
|||
int status;
|
||||
Eina_Bool done = EINA_FALSE;
|
||||
#ifdef HAVE_SYS_PTRACE_H
|
||||
ptrace(PT_ATTACH, child, NULL, NULL);
|
||||
if (!really_know)
|
||||
ptrace(PT_ATTACH, child, NULL, NULL);
|
||||
#endif
|
||||
result = waitpid(child, &status, 0);
|
||||
#ifdef HAVE_SYS_PTRACE_H
|
||||
if (!stop_ptrace)
|
||||
if ((!really_know) && (!stop_ptrace))
|
||||
{
|
||||
if (WIFSTOPPED(status))
|
||||
ptrace(PT_CONTINUE, child, NULL, NULL);
|
||||
|
@ -459,7 +461,8 @@ main(int argc, char **argv)
|
|||
int back;
|
||||
|
||||
#ifdef HAVE_SYS_PTRACE_H
|
||||
r = ptrace(PTRACE_GETSIGINFO, child, NULL, &sig);
|
||||
if (!really_know)
|
||||
r = ptrace(PTRACE_GETSIGINFO, child, NULL, &sig);
|
||||
#endif
|
||||
back = r == 0 &&
|
||||
sig.si_signo != SIGTRAP ? sig.si_signo : 0;
|
||||
|
@ -485,13 +488,15 @@ main(int argc, char **argv)
|
|||
sig.si_signo != SIGABRT))
|
||||
{
|
||||
#ifdef HAVE_SYS_PTRACE_H
|
||||
ptrace(PT_CONTINUE, child, NULL, back);
|
||||
if (!really_know)
|
||||
ptrace(PT_CONTINUE, child, NULL, back);
|
||||
#endif
|
||||
continue ;
|
||||
}
|
||||
#ifdef HAVE_SYS_PTRACE_H
|
||||
/* E17 should be in pause, we can detach */
|
||||
ptrace(PT_DETACH, child, NULL, back);
|
||||
if (!really_know)
|
||||
/* E17 should be in pause, we can detach */
|
||||
ptrace(PT_DETACH, child, NULL, back);
|
||||
#endif
|
||||
/* And call gdb if available */
|
||||
if (home)
|
||||
|
@ -554,7 +559,8 @@ main(int argc, char **argv)
|
|||
kill(child, SIGSTOP);
|
||||
usleep(200000);
|
||||
#ifdef HAVE_SYS_PTRACE_H
|
||||
ptrace(PT_DETACH, child, NULL, NULL);
|
||||
if (!really_know)
|
||||
ptrace(PT_DETACH, child, NULL, NULL);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue