diff options
author | Martin Pitt <martin.pitt@ubuntu.com> | 2009-12-22 11:09:20 +0100 |
---|---|---|
committer | Chris Coulson <chrisccoulson@googlemail.com> | 2009-12-23 15:51:11 +0000 |
commit | da66897950431870390f8dc3f798e24f23ffb8c8 (patch) | |
tree | acdc2ae47e090f26c42b47ce75e0474cebccdc9b /tests/.gitignore | |
parent | e9ab9eaff66b62c9653b90cca2eaf1d142f716a1 (diff) |
Support storing assertion messages into core dump
Crash interception/debugging systems like Apport or ABRT capture core dumps for
later crash analysis. However, if a program exits with an assertion failure,
the core dump is not useful since the assertion message is only printed to
stderr.
glibc recently got a patch which stores the message of assert() into the
__abort_msg global variable.
(http://sourceware.org/git/?p=glibc.git;a=commitdiff;h=48dcd0ba)
That works fine for programs which actually use the standard C assert() macro.
This patch adds the same functionality for glib's assertion tests. If we are
building against a glibc which already has __abort_msg (2.11 and later, or
backported above git commit), use that, otherwise put it into our own field
__glib_assert_msg.
Usage:
$ cat test.c
#include <glib.h>
int main() {
g_assert(1 < 0);
return 0;
}
$ ./test
**ERROR:test.c:5:main: assertion failed: (1 < 0)
Aborted (Core dumped)
$ gdb --batch --ex 'print (char*) __abort_msg' ./test core
[...]
$1 = 0x93bf028 "ERROR:test.c:5:main: assertion failed: (1 < 0)"
https://bugzilla.gnome.org/show_bug.cgi?id=594872
Diffstat (limited to 'tests/.gitignore')
-rw-r--r-- | tests/.gitignore | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/tests/.gitignore b/tests/.gitignore index 0b37c5e85..0ab78eb23 100644 --- a/tests/.gitignore +++ b/tests/.gitignore @@ -1,3 +1,4 @@ +assert-msg-test asyncqueue-test atomic-test base64-test |