forked from enlightenment/enlightenment
gdb: detect that the file was generated properly.
This is a workaround kernel that prevent ptrace to another process.
This commit is contained in:
parent
fd271ba0c8
commit
147f088efa
|
@ -81,9 +81,9 @@ main(int argc, char **argv)
|
|||
else if (i == 2)
|
||||
pid = atoi(argv[i]); // E's pid
|
||||
else if (i == 3)
|
||||
backtrace_str = argv[i];
|
||||
else if (i == 4)
|
||||
exit_gdb = atoi(argv[i]);
|
||||
else if (i == 4)
|
||||
backtrace_str = argv[i];
|
||||
}
|
||||
|
||||
fprintf(stderr, "exit_gdb: %i\n", exit_gdb);
|
||||
|
|
|
@ -563,8 +563,11 @@ main(int argc, char **argv)
|
|||
#endif
|
||||
/* And call gdb if available */
|
||||
r = 0;
|
||||
|
||||
if (home)
|
||||
{
|
||||
struct stat st;
|
||||
|
||||
/* call e_sys gdb */
|
||||
snprintf(buffer, sizeof(buffer),
|
||||
"gdb "
|
||||
|
@ -585,6 +588,10 @@ main(int argc, char **argv)
|
|||
"%s/.e-crashdump.txt",
|
||||
home);
|
||||
|
||||
/* Check the file was correctly generated (may fail on crappy kernel with ptrace
|
||||
diable). In which case a manual : echo 0 > /proc/sys/kernel/yama/ptrace_scope
|
||||
as root is necessary. */
|
||||
if (!stat(buffer, &st))
|
||||
backtrace_str = strdup(buffer);
|
||||
r = WEXITSTATUS(r);
|
||||
}
|
||||
|
@ -592,13 +599,13 @@ main(int argc, char **argv)
|
|||
/* call e_alert */
|
||||
snprintf(buffer, 4096,
|
||||
backtrace_str ?
|
||||
"%s/enlightenment/utils/enlightenment_alert %i %i '%s' %i" :
|
||||
"%s/enlightenment/utils/enlightenment_alert %i %i '%s' %i",
|
||||
"%s/enlightenment/utils/enlightenment_alert %i %i %i '%s'" :
|
||||
"%s/enlightenment/utils/enlightenment_alert %i %i %i",
|
||||
eina_prefix_lib_get(pfx),
|
||||
sig.si_signo == SIGSEGV && remember_sigusr1 ? SIGILL : sig.si_signo,
|
||||
child,
|
||||
backtrace_str,
|
||||
r);
|
||||
r,
|
||||
backtrace_str);
|
||||
r = system(buffer);
|
||||
|
||||
/* kill e */
|
||||
|
|
Loading…
Reference in New Issue