Synopsis: Automating GDB backtraces. October 96 From: erwin@pip.dknet.dk To: MERC/Envy Mailing List Subject: Re: Segmentation Fault Problem On Sat, 5 Oct 1996, Eric Kidder wrote: > Well, maybe not the core file itself *shudder*, but a backtrace and > info local from gdb would be nice :) Here's how automatically send yourself a stack backtrace using the startup file: In your area directory, create a .gdbinit file containing: bt info locals and in your startup file: ../src/envy bla bla if ( -e core ) gdb -batch ../src/envy core | mail your@address mv core core.`date +%s` endif gdb will read your binary file, your core file, then execute everything in .gdbinit. When finished, it exits, because you used the -batch switch. The mv lines causes the core file to be moved to a file named core.timestamp, so that repeated crashes do not overwite cores. This might be dangerous though if you have limited disk space, should you accidentally use it all up Note that under BSD-style Unices the core file is called something else (binaryfilename.core) ============================================================================== Erwin Andreasen Viby J, Denmark Computer Science Student at Aarhus Business erwin@pip.dknet.dk College ==============================================================================