aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>2012-11-13 07:46:02 (GMT)
committerMike Blumenkrantz <michael.blumenkrantz@gmail.com>2012-11-13 07:46:02 (GMT)
commite97ccf53cd0c93ff76b5b0c993918348e721e03b (patch)
treeedd5c8e70fed6d7a4474f80e393420742809ab1d
parent1. move crashdump to its own file - not in xsession-errors (gets (diff)
downloadenlightenment-e97ccf53cd0c93ff76b5b0c993918348e721e03b.tar.gz
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
-rw-r--r--src/bin/e_start_main.c24
1 files changed, 15 insertions, 9 deletions
diff --git a/src/bin/e_start_main.c b/src/bin/e_start_main.c
index bf71460..847c0d4 100644
--- a/src/bin/e_start_main.c
+++ b/src/bin/e_start_main.c
@@ -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
}
}