Index: CrashLogger.cpp
===================================================================
--- CrashLogger.cpp	(revision b3734660b44b83ea30bd28f6fbf37ea72889956e)
+++ CrashLogger.cpp	(revision 47623017a2217e9514cfa12d5cf3eb3a2488a5bb)
@@ -5,4 +5,5 @@
 #include <csignal>
 #include <cstring>
+#include <cstdint> // Check if this lets me remove any windows includes
 
 #include <fcntl.h>
@@ -133,5 +134,5 @@
 
    // retrieve current stack addresses
-   uint32_t addrlen = backtrace(addrlist, sizeof(addrlist) / sizeof(void*));
+   unsigned int addrlen = backtrace(addrlist, sizeof(addrlist) / sizeof(void*));
 
    if (addrlen == 0) {
@@ -144,13 +145,13 @@
 
    size_t funcnamesize = 1024;
-   char* funcname = (char*)malloc(funcnamesize);
+   char funcname[1024];
 
    // iterate over the returned symbol lines
    // skip the first few, since those are printStackTrace, abortHandler,
    // and a couple others called after the crash
-   for (unsigned int i = 4; i < addrlen; i++) {
+   for (unsigned int i = 0; i < addrlen; i++) {
       char* begin_name = NULL;
       char* begin_offset = NULL;
-      char* end_offset = NULL; // Iirc, this is used in the Linux code (Check what it's used for)
+      char* end_offset = NULL;
 
 #ifdef MAC
@@ -158,5 +159,5 @@
          if ((*p == '_') && (*(p-1) == ' ')) {
             begin_name = p-1;
-         } else if(*p == '+') {
+         } else if (*p == '+') {
             begin_offset = p-1;
          }
@@ -175,31 +176,71 @@
          if (status == 0)  {
             funcname = ret; // use possibly realloc()-ed string
+            write(fd_out, "  ", 2);
             write(fd_out, symbollist[i], strlen(symbollist[i]));
             write(fd_out, " ", 1);
             write(fd_out, funcname, strlen(funcname));
             write(fd_out, " ", 1);
-            write(fd_out, begin_offset, strlen(begin_offset));
          } else {
             // demangling failed. Output function name as a C function with no arguments.
-            write(fd_out, "Error\n", 6);
+            write(fd_out, "  ", 2);
             write(fd_out, symbollist[i], strlen(symbollist[i]));
             write(fd_out, " ", 1);
             write(fd_out, begin_name, strlen(begin_name));
             write(fd_out, "() ", 3);
+         }
+         write(fd_out, begin_offset, strlen(begin_offset));
+         write(fd_out, "\n", 1);
+      } else {`
+         // couldn't parse the line? print the whole line.
+         write(fd_out, symbollist[i], strlen(symbollist[i]));
+      }
+#else
+      for (char *p = symbollist[i]; *p; p++) {
+         if (*p == '(') {
+            begin_name = p;
+         } else if (*p == '+') {
+            begin_offset = p;
+         } else if (*p == ')' && (begin_offset || begin_name)) {
+            end_offset = p;
+         }
+      }
+
+      if (begin_name && end_offset && (begin_name < end_offset)) {
+         *begin_name++ = '\0';
+         *end_offset++ = '\0';
+         if (begin_offset) {
+            *begin_offset++ = '\0';
+         }
+
+         // mangled name is now in [begin_name, begin_offset) and caller
+         // offset in [begin_offset, end_offset). now apply
+         // __cxa_demangle():
+         int status;
+         char* ret = abi::__cxa_demangle(begin_name, funcname, &funcnamesize, &status);
+
+         write(fd_out, "  ", 2);
+         write(fd_out, symbollist[i], strlen(symbollist[i]));
+         write(fd_out, " ( ", 3);
+         if (status == 0) {
+            write(fd_out, ret, strlen(ret));
+         } else {
+            write(fd_out, begin_name, strlen(begin_name));
+	 }
+         if (begin_offset) {
+            write(fd_out, " + ", 3);
             write(fd_out, begin_offset, strlen(begin_offset));
-         }
+         } else {
+            write(fd_out, "         ", 9);
+         }
+         write(fd_out, ") ", 1);
+         write(fd_out, end_offset, strlen(end_offset));
+         write(fd_out, "\n", 1);
       } else {
          // couldn't parse the line? print the whole line.
          write(fd_out, symbollist[i], strlen(symbollist[i]));
       }
-      write(fd_out, "\n", 1);
-#else
-      // Check that this works on Linux Mint
-      write(fd_out, symbollist[i], strlen(symbollist[i]));
-      write(fd_out, "\n", 1);
 #endif
    }
 
-   free(funcname);
    free(symbollist);
 
Index: makefile
===================================================================
--- makefile	(revision b3734660b44b83ea30bd28f6fbf37ea72889956e)
+++ makefile	(revision 47623017a2217e9514cfa12d5cf3eb3a2488a5bb)
@@ -1,5 +1,6 @@
 OS = $(shell uname)
 CC = g++
-CFLAGS = -std=c++0x -Wall -pedantic#-Wextra -fno-inline
+CFLAGS = -std=c++0x -Wall -pedantic -rdynamic
+#-Wextra -fno-inline
 
 ifeq ($(OS),Darwin)
Index: utils.h
===================================================================
--- utils.h	(revision b3734660b44b83ea30bd28f6fbf37ea72889956e)
+++ utils.h	(revision 47623017a2217e9514cfa12d5cf3eb3a2488a5bb)
@@ -5,4 +5,5 @@
 
 #include <glm/mat4x4.hpp>
+#include <glm/gtc/type_ptr.hpp>
 
 using namespace std;
