2 Copyright (c) 2006 Paolo Capriotti <p.capriotti@sns.it>
3 (c) 2006 Maurizio Monge <maurizio.monge@kdemail.net>
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
16 #include <sys/types.h>
22 static void handler(int) {
27 const char* args
[] = { "/bin/sh", "-c", command
, NULL
};
28 //char *term = "xterm";
29 const char* term
= "kshell konsole";
30 snprintf(command
, 1024,
32 "\"echo -e \\\"\\\\33]0;SANGE & CRASHA\\\\7\\\"; "
33 "gdb attach %d\"", term
, getppid());
34 execve(args
[0], const_cast<char**>(args
), environ
);
40 static void handler2(int) {
41 printf("Sange & Crasha!!!!\n");
42 printf("I'm sorry, i crashed.\n");
43 printf("Now run somewhere\n");
44 printf(" gdb attach %d\n", getpid() );
48 void installCrashHander() {
49 signal(SIGSEGV
,handler2
);
50 signal(SIGABRT
,handler2
);
55 void installCrashHander() {