summaryrefslogtreecommitdiff
path: root/os
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2012-01-11 09:04:02 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2012-01-13 09:03:05 +1000
commita60d87ffe6d9a15fa830c8da2947c72487863c2b (patch)
tree0d367bdd445837ffef298969ad34a96365650dc7 /os
parentc495a839ace7fcc1f1fe414d3d3ba04f08885434 (diff)
os: prettify backtrace output
Changes to output: * "Backtrace:" now appears on a separate line _with_ a timestamp * A blank line is inserted after the last backtrace line Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Julien Cristau <jcristau@debian.org>
Diffstat (limited to 'os')
-rw-r--r--os/backtrace.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/os/backtrace.c b/os/backtrace.c
index 298bf1898..edaeb17c7 100644
--- a/os/backtrace.c
+++ b/os/backtrace.c
@@ -43,7 +43,8 @@ void xorg_backtrace(void)
const char *mod;
int size, i;
Dl_info info;
- ErrorF("\nBacktrace:\n");
+ ErrorF("\n");
+ ErrorF("Backtrace:\n");
size = backtrace(array, 64);
for (i = 0; i < size; i++) {
int rc = dladdr(array[i], &info);
@@ -59,6 +60,7 @@ void xorg_backtrace(void)
ErrorF("%d: %s (%p+0x%lx) [%p]\n", i, mod,
info.dli_fbase, (long unsigned int)((char *) array[i] - (char *) info.dli_fbase), array[i]);
}
+ ErrorF("\n");
}
#else /* not glibc or glibc < 2.1 */
@@ -188,7 +190,8 @@ static int xorg_backtrace_pstack(void) {
void xorg_backtrace(void) {
- ErrorF("\nBacktrace:\n");
+ ErrorF("\n");
+ ErrorF("Backtrace:\n");
# ifdef HAVE_PSTACK
/* First try fork/exec of pstack - otherwise fall back to walkcontext
@@ -207,6 +210,7 @@ void xorg_backtrace(void) {
# endif
ErrorF("Failed to get backtrace info: %s\n", strerror(errno));
}
+ ErrorF("\n");
}
# else