medfall

A super great game engine
Log | Files | Refs

commit 97315fc8cf26c3cfb6655c001a5bb54e7b28eb89
parent a85591b173cc31d0caaeb884510ae088c3aa9b2b
Author: Michael Savage <mikejsavage@gmail.com>
Date:   Sun Apr 23 23:53:48 +0300

Warn on EPERM in autogdb

Diffstat:
autogdb.h | 5+++++
1 file changed, 5 insertions(+), 0 deletions(-)
diff --git a/autogdb.h b/autogdb.h @@ -80,6 +80,11 @@ static bool being_debugged() { if( child_pid == 0 ) { // if we can't ptrace the parent then gdb is already there if( ptrace( PTRACE_ATTACH, parent_pid, NULL, NULL ) != 0 ) { + if( errno == EPERM ) { + printf( "! echo 0 > /proc/sys/kernel/yama/ptrace_scope\n" ); + printf( "! or\n" ); + printf( "! sysctl kernel.yama.ptrace_scope=0\n" ); + } exit( 1 ); }