Commit Graph

29 Commits (a5c67098a79533e130586d1901d079f280e75310)

Author SHA1 Message Date
Giel van Schijndel 1b11d622f1 Exceptionhandler: Remove signal descriptions for signals that are either non fatal or simply not handled by our signal handler
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@7539 4a71c877-e1ca-e34f-864e-861f7616d084
2009-05-28 09:59:29 +02:00
Dennis Schridde aac41748dc Bump copyright
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6617 4a71c877-e1ca-e34f-864e-861f7616d084
2009-02-10 18:01:48 +00:00
Dennis Schridde cbbc58d1e9 Move files which extend a c std library header to a filename of similar name
Extension functions dealing with ...
 * strings are in string_ext.h
 * stdio (namely printf variants) are in stdio_ext.h
 * math are in math_ext.h

These headers are no longer included by frame.h

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6613 4a71c877-e1ca-e34f-864e-861f7616d084
2009-02-10 17:23:09 +00:00
Giel van Schijndel a47f0e94a7 Oops, need to copy filename template into template buffer (see r6214, r6217)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6218 4a71c877-e1ca-e34f-864e-861f7616d084
2008-10-25 22:16:13 +00:00
Giel van Schijndel a5c5328609 Make sure we take sizeof(array), not sizeof(pointer)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6217 4a71c877-e1ca-e34f-864e-861f7616d084
2008-10-25 22:11:43 +00:00
Giel van Schijndel 0269d11d16 In the exception handler:
* use mkstemp(3) to create a temporary file that's guaranteed not to exist already

Prevents a potential symlink attack (e.g. where /tmp/warzone2100.gdmp is symlinked by user A to a file owned by user B, then having user B crash warzone)


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6214 4a71c877-e1ca-e34f-864e-861f7616d084
2008-10-25 21:47:00 +00:00
Giel van Schijndel 2b572a9492 Work around the fact that on FreeBSD POLL_ERR and POLL_HUP are defined to the same value
This problem is similar to DebianBug:492786

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5795 4a71c877-e1ca-e34f-864e-861f7616d084
2008-08-11 15:29:51 +00:00
Giel van Schijndel ed3f1508b8 * Remove the dumpLog function and associated code from debug.c
* Add a new function dbgDumpLog to dumpinfo.cpp for dumping the last debug messages
 * Add a debug output callback to dumpinfo.cpp which is used to fetch the debug messages and store them in a ring buffer


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5581 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-19 01:08:07 +00:00
Giel van Schijndel ec4784973e Add the used command line to crash dump reports
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5536 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-13 21:26:09 +00:00
Giel van Schijndel a4e8c96977 Move the code to spawn GDB, and arrange for a communication pipe, to a separate function: execGdb
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5391 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-04 22:41:33 +00:00
Giel van Schijndel 619e1e1943 * Deal with a failure of exeve() by writing a debug message indicating that it failed and terminating the child of our fork()
* Flush the write end of the pipe after writing all GDB commands into it
 * Process the return data (both return value and the contents of the output integer) from waitpid()

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5390 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-04 22:41:25 +00:00
Giel van Schijndel 2d6615a30a Refactor function gdbExtendedBacktrace:
* return as soon as an error condition is detected, thus preventing the need for deep nested if-branches.
 * Add some additional comments
 * Return true or false, false indicating an error, true indicating success

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5389 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-04 22:41:17 +00:00
Giel van Schijndel 6953f0fd6d Move the code that provides GDB backtraces in a function of its own to refactor it later (i.e. get rid of the deep if-branch nesting)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5388 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-04 22:41:07 +00:00
Giel van Schijndel aadfec4677 Document the gdb commands; what they do and why they're there
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5387 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-04 22:41:00 +00:00
Giel van Schijndel 38eea0b640 The syscall open() returns -1 on an error *not* 0, as 0 is a *valid* file descriptor:
* Thus check for a return value of -1, not 0

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5386 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-04 22:40:52 +00:00
Giel van Schijndel f8e5f8ddb8 * Don't duplicate code just because there's a single platform (Mac OSX) on which it isn't used
* Instead compile that code on all platforms except for the given one (Mac OSX)

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5385 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-04 22:40:43 +00:00
Giel van Schijndel 43bdd9575d Factor out the code to retrieve absolute program paths and move it into a separate function of its own: fetchProgramPath
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5384 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-04 22:40:20 +00:00
Giel van Schijndel fd6b6262ba Apply patch #1078: Expand the GDB exceptionhandler.
With our current backtrace dumps I quite oftenly find that in case of segfaults, which combined with assert failures are the most common crash cause, I cannot easily see what value the dereferenced pointer held.

To be able to see this the exception handler will now invoke the "disassemble" and "info registers" commands when producing a back trace using GDB. This gives us the ability to see the precise assembly instruction that triggered the crash, together with the value of the register that was used as pointer.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5352 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-01 20:40:40 +00:00
Giel van Schijndel f6693eebdf Fix a typo strrcat => sstrcat
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5183 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-25 15:42:02 +00:00
Giel van Schijndel 855ec725d4 Use sstrcpy|sstrcat instead of strlcpy|strlcat for manipulation of statically sized strings
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5176 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-25 13:46:49 +00:00
Giel van Schijndel bfb035d41a Merge r4804 from the 2.1 branch into trunk (except for the removal of the SQLite stuff from the XCode projectfile)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4849 4a71c877-e1ca-e34f-864e-861f7616d084
2008-04-28 21:41:12 +00:00
Giel van Schijndel 0555874c44 Pass programCommand to dbgDumpInit() so that it can use that to set up debug dump info
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4844 4a71c877-e1ca-e34f-864e-861f7616d084
2008-04-28 20:45:28 +00:00
Giel van Schijndel 61c8bbc4b9 * Don't "Guarantee nul-termination" after snprintf as snprintf does that itself already (per the C99 spec)
* Use strlcpy for copying strings instead of snprintf "%s"
 * Don't cast the return value from vsnprintf to (void)
 * When we use va_start make sure to use va_end as well...
 * Fix indentation


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4785 4a71c877-e1ca-e34f-864e-861f7616d084
2008-04-26 14:21:41 +00:00
Giel van Schijndel 36766ec8ce Use a more unified system for the "default" info in exception reports (i.e. the same code for the Windows & GDB on GNU/Linux handlers)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4623 4a71c877-e1ca-e34f-864e-861f7616d084
2008-04-14 23:17:51 +00:00
Giel van Schijndel ff663196a3 * Forward declare debug_callback_win32debug when compiling for Windows
* Don't define windowsExceptionHandler when compiling with MinGW (as we don't use it on MinGW)


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4587 4a71c877-e1ca-e34f-864e-861f7616d084
2008-04-13 22:54:58 +00:00
Giel van Schijndel 5bcc0ed6df Keep track of the previous exceptionhandler and call it when we're finished in our own
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4508 4a71c877-e1ca-e34f-864e-861f7616d084
2008-04-05 22:14:16 +00:00
Giel van Schijndel 0ae93346f0 Only set up Dr. MinGW as exceptionhandler when compiling with MinGW (the BFD lib is a huge pain to compile with MSVC)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4503 4a71c877-e1ca-e34f-864e-861f7616d084
2008-04-05 21:10:36 +00:00
Giel van Schijndel fdcadfcc8f Compile & link in Dr. MinGW's exceptionhandler
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4490 4a71c877-e1ca-e34f-864e-861f7616d084
2008-04-05 16:15:14 +00:00
Giel van Schijndel 665e57dc12 Move the exceptionhandler to a directory of its own
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4484 4a71c877-e1ca-e34f-864e-861f7616d084
2008-04-05 15:11:43 +00:00