On Thursday, 22 February 2007 at 10:40, Per Inge Mathisen wrote:
> Also see "info Backtrace glibc". The best would be to automatically
> connect gdb to the program and give a "bt full" dump. If you
> automatically emailed that back to us, it would be an invaluable debug
> aid, and a massive privacy violation ;-)

You know, that's possible. There are such things as "core dumps". Quite
useful, those.

Imagine a warzone2100 wrapper script like this:

[pseudo shell script]

cd /tmp/unique-empty-and-writeable-directory
ulimit -c 100000000 # or other large number
warzone2100-bin "$@"
test -f core || exit
test -f /`which gdb` || exit and nag user to install gdb, or send whole core 
dump
uname -a > warzone-crash-report
gdb -x gdb.cmd warzone2100-bin core >> warzone-crash-report
cat /proc/cpuinfo >> warzone-crash-report
cat other-relevant-or-interesting-data-like-secret-passwords >> 
warzone-crash-report
cat warzone-crash-report | mail -s "Automatic crash report for `warzone2100-bin 
--version` (`date`)" warzone-dev@gna.org

[/pseudo shell script]


[gdb.cmd]

echo \n Backtrace \n\n
bt
echo \n Full Backtrace \n\n
bt full
echo \n Registers \n\n
info registers
quit

[/gdb.cmd]

Enhance it with some nice dialogs (with zenity or something like that,
possibly included as a static binary, if it's not too large) asking for
permission to send the data, an option to show it before sending, and
entering an email address for further questions, et voilĂ ! If only
things were that easy on Windows...

I also found code to generate a core dump from a running program at
http://code.google.com/p/google-coredumper/.  Bind to a key and ask
users to send us a core dump if Warzone doesn't behave... might be
useful when the problem can't be reproduced from a savegame... perhaps.

-- 
Simulations are like miniskirts, they show a lot and hide the essentials.
                -- Hubert Kirrman

_______________________________________________
Warzone-dev mailing list
Warzone-dev@gna.org
https://mail.gna.org/listinfo/warzone-dev

Reply via email to