mirror of
https://github.com/edeproject/ede.git
synced 2023-08-10 21:13:03 +03:00
Some text alignement in ede-bug-report so it can be easily read in the source.
Rewriten ede-crasher. Now is able to call ede-bug-report, display png icon, do backtrace in random temporary files and etc.
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* ede-crasher, a crash handler tool
|
||||
* Part of Equinox Desktop Environment (EDE).
|
||||
* Copyright (c) 2008 EDE Authors.
|
||||
* Copyright (c) 2008-2009 EDE Authors.
|
||||
*
|
||||
* This program is licensed under terms of the
|
||||
* GNU General Public License version 2 or newer.
|
||||
@@ -30,10 +30,11 @@ static void help(void) {
|
||||
puts("EDE crash handler\n");
|
||||
puts("Options:");
|
||||
puts(" -h, --help this help");
|
||||
puts(" -e, --edeapp use this flag for EDE applications");
|
||||
puts(" -b, --bugaddress [ADDRESS] bug address to use");
|
||||
puts(" -p, --pid [PID] the PID of the program");
|
||||
puts(" -a, --appname [NAME] name of the program");
|
||||
puts(" -e, --apppath [PATH] path to the executable");
|
||||
puts(" -t, --apppath [PATH] path to the executable");
|
||||
puts(" -s, --signal [SIGNAL] the signal number that was caught");
|
||||
}
|
||||
|
||||
@@ -43,49 +44,54 @@ int main(int argc, char** argv) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
const char* a;
|
||||
const char* bugaddress = NULL;
|
||||
const char* appname = NULL;
|
||||
const char* apppath = NULL;
|
||||
const char* pid = 0;
|
||||
const char* signal_num = 0;
|
||||
const char* a;
|
||||
ProgramDetails p;
|
||||
|
||||
p.bugaddress = NULL;
|
||||
p.name = NULL;
|
||||
p.path = NULL;
|
||||
p.pid = NULL;
|
||||
p.sig = NULL;
|
||||
p.ede_app = false;
|
||||
|
||||
for(int i = 1; i < argc; i++) {
|
||||
a = argv[i];
|
||||
if(CHECK_ARGV(a, "-h", "--help")) {
|
||||
help();
|
||||
return 0;
|
||||
} else if(CHECK_ARGV(a, "-e", "--edeapp")) {
|
||||
p.ede_app = true;
|
||||
} else if(CHECK_ARGV(a, "-b", "--bugaddress")) {
|
||||
bugaddress = next_param(i, argv, argc);
|
||||
if(!bugaddress) {
|
||||
p.bugaddress = next_param(i, argv, argc);
|
||||
if(!p.bugaddress) {
|
||||
puts("Missing bug address parameter");
|
||||
return 1;
|
||||
}
|
||||
i++;
|
||||
} else if(CHECK_ARGV(a, "-p", "--pid")) {
|
||||
pid = next_param(i, argv, argc);
|
||||
if(!pid) {
|
||||
p.pid = next_param(i, argv, argc);
|
||||
if(!p.pid) {
|
||||
puts("Missing pid parameter");
|
||||
return 1;
|
||||
}
|
||||
i++;
|
||||
} else if(CHECK_ARGV(a, "-a", "--appname")) {
|
||||
appname = next_param(i, argv, argc);
|
||||
if(!appname) {
|
||||
p.name = next_param(i, argv, argc);
|
||||
if(!p.name) {
|
||||
puts("Missing application name");
|
||||
return 1;
|
||||
}
|
||||
i++;
|
||||
} else if(CHECK_ARGV(a, "-e", "--apppath")) {
|
||||
apppath = next_param(i, argv, argc);
|
||||
if(!apppath) {
|
||||
} else if(CHECK_ARGV(a, "-t", "--apppath")) {
|
||||
p.path = next_param(i, argv, argc);
|
||||
if(!p.path) {
|
||||
puts("Missing application path");
|
||||
return 1;
|
||||
}
|
||||
i++;
|
||||
} else if(CHECK_ARGV(a, "-s", "--signal")) {
|
||||
signal_num = next_param(i, argv, argc);
|
||||
if(!signal_num) {
|
||||
p.sig = next_param(i, argv, argc);
|
||||
if(!p.sig) {
|
||||
puts("Missing signal number");
|
||||
return 1;
|
||||
}
|
||||
@@ -96,14 +102,5 @@ int main(int argc, char** argv) {
|
||||
}
|
||||
}
|
||||
|
||||
CrashDialog cd;
|
||||
cd.set_appname(appname);
|
||||
cd.set_apppath(apppath);
|
||||
cd.set_bugaddress(bugaddress);
|
||||
cd.set_pid(pid);
|
||||
cd.set_signal(signal_num);
|
||||
|
||||
cd.run();
|
||||
|
||||
return 0;
|
||||
return crash_dialog_show(p);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user