diff options
author | Christian Persch <chpe@cvs.gnome.org> | 2004-09-27 21:19:53 +0800 |
---|---|---|
committer | Christian Persch <chpe@src.gnome.org> | 2004-09-27 21:19:53 +0800 |
commit | 01d4432d9c051e5381aa4ebca6b945d30f1075b8 (patch) | |
tree | e3d8582dd6aee70e146deeed697b416a31a17047 | |
parent | 43e470f7461e38da9ec1894df5fbe619fb65ceb2 (diff) | |
download | gsoc2013-epiphany-01d4432d9c051e5381aa4ebca6b945d30f1075b8.tar gsoc2013-epiphany-01d4432d9c051e5381aa4ebca6b945d30f1075b8.tar.gz gsoc2013-epiphany-01d4432d9c051e5381aa4ebca6b945d30f1075b8.tar.bz2 gsoc2013-epiphany-01d4432d9c051e5381aa4ebca6b945d30f1075b8.tar.lz gsoc2013-epiphany-01d4432d9c051e5381aa4ebca6b945d30f1075b8.tar.xz gsoc2013-epiphany-01d4432d9c051e5381aa4ebca6b945d30f1075b8.tar.zst gsoc2013-epiphany-01d4432d9c051e5381aa4ebca6b945d30f1075b8.zip |
Remove the hack, and just use the libc function for it. Thanks to Crispin
2004-09-27 Christian Persch <chpe@cvs.gnome.org>
* configure.ac:
* lib/ephy-debug.c: (trap_handler), (ephy_debug_init):
Remove the hack, and just use the libc function for it.
Thanks to Crispin for suggesting this.
-rw-r--r-- | ChangeLog | 8 | ||||
-rw-r--r-- | configure.ac | 7 | ||||
-rw-r--r-- | lib/ephy-debug.c | 23 |
3 files changed, 18 insertions, 20 deletions
@@ -1,6 +1,14 @@ 2004-09-27 Christian Persch <chpe@cvs.gnome.org> * configure.ac: + * lib/ephy-debug.c: (trap_handler), (ephy_debug_init): + + Remove the hack, and just use the libc function for it. + Thanks to Crispin for suggesting this. + +2004-09-27 Christian Persch <chpe@cvs.gnome.org> + + * configure.ac: Improve configure check for DumpStackToFile to actually work. diff --git a/configure.ac b/configure.ac index a4abe0f9e..100c20965 100644 --- a/configure.ac +++ b/configure.ac @@ -364,13 +364,6 @@ AC_DEFINE([GTKMOZEMBED_BROKEN_RELOAD],[1],[Define if GtkMozEmbed has broken relo AC_MSG_RESULT([couldn't autodetect, assuming yes]) -dnl check if mozilla's stack walker is accessible - -AC_CHECK_LIB([xpcom],[_Z15DumpStackToFileP8_IO_FILE], - [AC_DEFINE([HAVE_DUMPSTACKTOFILE], [1], [Define if DumpStackToFile is available]) result=yes], - [result=no], - [`pkg-config --libs $MOZILLA-xpcom`]) - dnl restore flags CXXFLAGS=$_SAVE_CXXFLAGS AC_LANG_POP(C++) diff --git a/lib/ephy-debug.c b/lib/ephy-debug.c index b9f8386b6..2ea13bee4 100644 --- a/lib/ephy-debug.c +++ b/lib/ephy-debug.c @@ -28,18 +28,15 @@ #include <glib/gbacktrace.h> #include <string.h> -#include <stdio.h> #include <signal.h> +#include <stdio.h> +#include <stdlib.h> +#include <execinfo.h> static GHashTable *ephy_profilers_hash = NULL; static const char *ephy_profile_modules = NULL; static const char *ephy_debug_break = NULL; -#ifdef HAVE_DUMPSTACKTOFILE -#define DumpStackToFile(f) _Z15DumpStackToFileP8_IO_FILE(f) -extern void _Z15DumpStackToFileP8_IO_FILE (FILE *f); -#endif - #endif #ifndef DISABLE_LOGGING @@ -85,6 +82,8 @@ log_module (const gchar *log_domain, } } +#define MAX_DEPTH 200 + static void trap_handler (const char *log_domain, GLogLevelFlags log_level, @@ -101,11 +100,11 @@ trap_handler (const char *log_domain, { if (strcmp (ephy_debug_break, "stack") == 0) { -#ifdef HAVE_DUMPSTACKTOFILE - DumpStackToFile (stderr); -#else - g_on_error_stack_trace (g_get_prgname ()); -#endif + void *array[MAX_DEPTH]; + size_t size; + + size = backtrace (array, MAX_DEPTH); + backtrace_symbols_fd (array, size, 2); } else if (strcmp (ephy_debug_break, "trap") == 0) { @@ -130,8 +129,6 @@ void ephy_debug_init (void) { #ifndef DISABLE_LOGGING - const char *debug_break; - ephy_log_modules = g_getenv ("EPHY_LOG_MODULES"); ephy_debug_break = g_getenv ("EPHY_DEBUG_BREAK"); |