* base-specs/bug-buddy.spec : Based on community feedback removed one
authormattman
Mon, 01 Sep 2008 15:57:52 +0000
changeset 13341 846dca93b6b6
parent 13340 1fa0aced6ec6
child 13342 7b087c1e5222
* base-specs/bug-buddy.spec : Based on community feedback removed one patch and merged another. * patches/bug-buddy-01-use-pstack.diff : Partial merge 02-enable-breakpad * patches/bug-buddy-02-enable-breakpad.diff : Removed, partially upstream, the remaining has been merged into 01-use-pstack.diff * patches/bug-buddy-03-dlopen-java.diff : Re-numbered * patches/bug-buddy-04-disable-google-breakpad.diff : Re-numbered
ChangeLog
base-specs/bug-buddy.spec
patches/bug-buddy-01-use-pstack.diff
patches/bug-buddy-02-dlopen-java.diff
patches/bug-buddy-02-enable-breakpad.diff
patches/bug-buddy-03-disable-google-breakpad.diff
patches/bug-buddy-03-dlopen-java.diff
patches/bug-buddy-04-disable-google-breakpad.diff
--- a/ChangeLog	Mon Sep 01 15:54:37 2008 +0000
+++ b/ChangeLog	Mon Sep 01 15:57:52 2008 +0000
@@ -1,3 +1,13 @@
+2008-09-01 Matt Keenan <[email protected]>
+
+    * base-specs/bug-buddy.spec : Based on community feedback removed one
+      patch and merged another.
+    * patches/bug-buddy-01-use-pstack.diff : Partial merge 02-enable-breakpad
+    * patches/bug-buddy-02-enable-breakpad.diff : Removed, partially upstream, 
+      the remaining has been merged into 01-use-pstack.diff
+    * patches/bug-buddy-03-dlopen-java.diff : Re-numbered
+    * patches/bug-buddy-04-disable-google-breakpad.diff : Re-numbered
+
 2008-09-01 Matt Keenan <[email protected]>
 
     * base-specs/gnome-applets.spec : Remove patch -06-fixsticky.diff, as
--- a/base-specs/bug-buddy.spec	Mon Sep 01 15:54:37 2008 +0000
+++ b/base-specs/bug-buddy.spec	Mon Sep 01 15:57:52 2008 +0000
@@ -21,12 +21,10 @@
 %endif
 # date:2004-11-08 type:feature owner:mattman bugster:5102045 bugzilla:473559
 Patch1:       bug-buddy-01-use-pstack.diff
-# date:2007-08-28 type:bug owner:mattman bugzilla:473561
-Patch2:       bug-buddy-02-enable-breakpad.diff
 # date:2007-09-07 type:bug owner:mattman bugster:6600538
-Patch3:       bug-buddy-03-dlopen-java.diff
+Patch2:       bug-buddy-02-dlopen-java.diff
 # date:2007-10-19 type:bug owner:mattman bugzilla:473561
-Patch4:       bug-buddy-04-disable-google-breakpad.diff
+Patch3:       bug-buddy-03-disable-google-breakpad.diff
 URL:          http://www.gnome.org/
 BuildRoot:    %{_tmppath}/%{name}-%{version}-build
 Docdir:       %{_docdir}/bug-buddy
@@ -52,7 +50,6 @@
 %patch1 -p1
 %patch2 -p1
 %patch3 -p1
-%patch4 -p1
 
 %build
 %ifos linux
@@ -127,6 +124,11 @@
  
 
 %changelog
+* Mon Sep 01 2008 - [email protected]
+- Remove patch 01-enable-breakpad, partially fixed upstream, rest of patch has
+  been merged into patch 01.
+- Merge part of patch 01-enable-breakpad into 01-use-pstack.
+- Re-number remaining patches
 * Mon Sep 01 2008 - [email protected]
 - Bump to 2.23.91
 * Tue Aug 19 2008 - [email protected]
--- a/patches/bug-buddy-01-use-pstack.diff	Mon Sep 01 15:54:37 2008 +0000
+++ b/patches/bug-buddy-01-use-pstack.diff	Mon Sep 01 15:57:52 2008 +0000
@@ -1,6 +1,136 @@
---- bug-buddy-2.22.0.old/src/bug-buddy.c	2008-04-28 11:59:20.005224000 +0100
-+++ bug-buddy-2.22.0/src/bug-buddy.c	2008-04-28 12:00:04.933927000 +0100
-@@ -963,19 +963,30 @@
+--- bug-buddy-2.23.90.old/src/gdb-buddy.c	2008-09-01 16:29:22.471669000 +0100
++++ bug-buddy-2.23.90/src/gdb-buddy.c	2008-09-01 16:34:09.490863000 +0100
+@@ -191,11 +191,9 @@
+ 	GIOChannel *ioc;
+ 	GError *error = NULL;
+ 	GdbData *gdb_data = NULL;
+-	char *args[] = { "gdb",
+-			 "--batch", 
+-			 "--quiet",
+-			 "--command=" BUDDY_DATADIR "/gdb-cmd",
+-			 NULL, NULL, NULL };
++    char *args[7];
++    char *gdb = NULL;
++    char *pstack = NULL;
+ 
+ 	g_return_val_if_fail (app != NULL, 0);
+ 	g_return_val_if_fail (*app != '\0', 0);
+@@ -206,6 +204,29 @@
+ 
+ 	d (g_print ("app=%s\n", app));
+ 
++#if defined(sun) && defined(__SVR4)
++    pstack = g_find_program_in_path ("pstack");
++
++    if (pstack) {
++        args[0] = pstack;
++        args[2] = args[3] = args[4] = args[5] = args[6] = NULL;
++    } else {
++        gdb = g_find_program_in_path ("gdb");
++        args[0] = gdb;
++        args[1] = "--batch";
++        args[2] = "--quiet";
++        args[3] = "--command=" BUDDY_DATADIR "/gdb-cmd";
++        args[4] = args[5] = args[6] = NULL;
++    }
++#else
++    gdb = g_find_program_in_path ("gdb");
++    args[0] = gdb;
++    args[1] = "--batch";
++    args[2] = "--quiet";
++    args[3] = "--command=" BUDDY_DATADIR "/gdb-cmd";
++    args[4] = args[5] = args[6] = NULL;
++#endif /* defined(sun) && defined(__SVR4) */
++
+ 	/* apply a SIGCONT to the process */
+ 	kill (pid, SIGCONT);
+ 
+@@ -226,33 +247,41 @@
+ 	if (!long_app) {
+ 		g_set_error (err, GDB_BUDDY_ERROR, GDB_BUDDY_BINARY_NOT_FOUND, 
+ 		             _("The binary file could not be found. Try using an absolute path."));
++        g_free (args[0]);
+ 		return 0;
+ 	}
+ 
+-	args[0] = g_find_program_in_path ("gdb");
+-	args[4] = long_app;
++    if (!pstack)
++        args[4] = long_app;
+ 
+ 	if (args[0] == NULL) {
+ 		d(g_message ("Path: %s", getenv ("PATH")));
+ 		g_free (long_app);
+ 		g_set_error (err, GDB_BUDDY_ERROR, GDB_BUDDY_GDB_NOT_FOUND, 
+-			     _("GDB could not be found on your system. "
+-			       "Debugging information will not be obtained."));
++			     _("%s could not be found on your system. "
++			       "Debugging information will not be obtained."),
++                    pstack != NULL ? "pstack" : "GDB");
++        g_free (args[0]);
+ 		return 0;
+ 	} 
+ 	
+ 	d(g_message ("About to debug '%s'", long_app));
+ 	
+-	if (!g_file_test (BUDDY_DATADIR "/gdb-cmd", G_FILE_TEST_EXISTS)) {
+-		g_set_error (err, GDB_BUDDY_ERROR, GDB_BUDDY_GDB_CMD_NOT_FOUND, 
+-			     _("Could not find the gdb-cmd file.\n"
+-			       "Please try reinstalling Bug Buddy."));
+-		g_free (args[0]);
+-		g_free (long_app);
+-		return 0;
+-	}
++    if (gdb) {
++	    if (!g_file_test (BUDDY_DATADIR "/gdb-cmd", G_FILE_TEST_EXISTS)) {
++		    g_set_error (err, GDB_BUDDY_ERROR, GDB_BUDDY_GDB_CMD_NOT_FOUND, 
++			        _("Could not find the gdb-cmd file.\n"
++			        "Please try reinstalling Bug Buddy."));
++            g_free (args[0]);
++		    g_free (long_app);
++		    return 0;
++	    }
++    }
+ 	
+-	args[5] = g_strdup_printf ("%d", pid);
++    if (pstack) 
++	    args[1] = g_strdup_printf ("%d", pid);
++    else
++	    args[5] = g_strdup_printf ("%d", pid);
+ 	
+ 	if (!g_spawn_async_with_pipes (NULL, args, NULL, 0, NULL, NULL,
+ 				       &gdb_pid,
+@@ -263,8 +292,11 @@
+ 			     _("There was an error running gdb:\n\n%s"),
+ 			     error->message);
+ 		g_error_free (error);
+-		g_free (args[0]);
+-		g_free (args[5]);
++        g_free (args[0]);
++        if (pstack)
++		    g_free (args[1]);
++        else
++		    g_free (args[5]);
+ 		g_free (long_app);
+ 		return 0;
+ 	} 
+@@ -288,8 +320,11 @@
+ 	                                 gdb_handle_input, gdb_data, gdb_destroy);
+ 	g_io_channel_unref (ioc);
+ 
+-	g_free (args[0]);
+-	g_free (args[5]);
++    g_free (args[0]);
++    if (pstack)
++	    g_free (args[1]);
++    else
++	    g_free (args[5]);
+ 	g_free (long_app);
+ 
+ 	return source_id;
+--- bug-buddy-2.23.90.old/src/bug-buddy.c	2008-09-01 16:29:22.470638000 +0100
++++ bug-buddy-2.23.90/src/bug-buddy.c	2008-09-01 16:35:04.943188000 +0100
+@@ -1082,19 +1082,30 @@
  	GtkTextView *text_view;
  	GtkTextIter end;
  	GtkTextBuffer *buffer;
@@ -43,7 +173,7 @@
  
  	text_view = GTK_TEXT_VIEW (gtk_builder_get_object (ui, "gdb-text"));
  	buffer = gtk_text_view_get_buffer (text_view);
-@@ -984,6 +995,8 @@
+@@ -1103,6 +1114,8 @@
  	/* add the stacktrace to the GtkTextView */
  	gtk_text_buffer_insert (buffer, &end, stacktrace, strlen (stacktrace));
  
@@ -52,132 +182,117 @@
  	return TRUE;
  }
  
---- bug-buddy-2.22.0.old/src/gdb-buddy.c	2008-04-28 11:59:20.026360000 +0100
-+++ bug-buddy-2.22.0/src/gdb-buddy.c	2008-04-28 12:01:31.033484000 +0100
-@@ -191,11 +191,9 @@
- 	GIOChannel *ioc;
+--- bug-buddy-2.23.91.old/gnome-breakpad/gnome-breakpad.cc	2008-09-01 16:48:05.336792000 +0100
++++ bug-buddy-2.23.91/gnome-breakpad/gnome-breakpad.cc	2008-09-01 16:47:48.785366000 +0100
+@@ -222,25 +222,52 @@
+ static bool
+ run_gdb (const gchar *appname, pid_t pid)
+ {
+-	gchar *exec_str;
++	gchar *exec_str = NULL;
+ 	gchar *title;
+ 	gboolean res;
  	GError *error = NULL;
- 	GdbData *gdb_data = NULL;
--	char *args[] = { "gdb",
--			 "--batch", 
--			 "--quiet",
--			 "--command=" BUDDY_DATADIR "/gdb-cmd",
--			 NULL, NULL, NULL };
-+    char *args[7];
-+    char *gdb = NULL;
-+    char *pstack = NULL;
++	gchar *gdb = NULL;
  
- 	g_return_val_if_fail (app != NULL, 0);
- 	g_return_val_if_fail (*app != '\0', 0);
-@@ -206,6 +204,28 @@
- 
- 	d (g_print ("app=%s\n", app));
+ 	title = g_strdup_printf ("Debugging %s", appname);
  
 +#if defined(sun) && defined(__SVR4)
-+    pstack = g_find_program_in_path ("pstack");
-+    if (pstack) {
-+        args[0] = pstack;
-+        args[2] = args[3] = args[4] = args[5] = args[6] = NULL;
-+    } else {
-+        gdb = g_find_program_in_path ("gdb");
-+        args[0] = gdb;
-+        args[1] = "--batch";
-+        args[2] = "--quiet";
-+        args[3] = "--command=" BUDDY_DATADIR "/gdb-cmd";
-+        args[4] = args[5] = args[6] = NULL;
-+    }
++	gdb = g_find_program_in_path("gdb");;
++	if (gdb) {
++		exec_str = g_strdup_printf("gnome-terminal "
++				 "--title=\"%s\" "
++				 "--disable-factory "
++				 "--command=\"gdb %s %d\"",
++				title, appname, (int)pid);
++		g_free (gdb);
++	} else {
++		gchar *dbx = g_find_program_in_path("dbx");
++		if (dbx) {
++			exec_str = g_strdup_printf("gnome-terminal "
++				 	"--title=\"%s\" "
++				 	"--disable-factory "
++				 	"--command=\"dbx /proc/%d/object/a.out %d\"",
++					title, (int)pid, (int)pid);
++		}
++		g_free (dbx);
++	}
 +#else
-+    gdb = g_find_program_in_path ("gdb");
-+    args[0] = gdb;
-+    args[1] = "--batch";
-+    args[2] = "--quiet";
-+    args[3] = "--command=" BUDDY_DATADIR "/gdb-cmd";
-+    args[4] = args[5] = args[6] = NULL;
+ 	exec_str = g_strdup_printf("gnome-terminal "
+ 				 "--title=\"%s\" "
+ 				 "--disable-factory "
+ 				 "--command=\"gdb %s %d\"",
+ 				title, appname, (int)pid);
+-				g_free (title);
+-	res = g_spawn_command_line_sync (exec_str, NULL, NULL,
 +#endif /* defined(sun) && defined(__SVR4) */
 +
- 	/* apply a SIGCONT to the process */
- 	kill (pid, SIGCONT);
- 
-@@ -226,33 +246,41 @@
- 	if (!long_app) {
- 		g_set_error (err, GDB_BUDDY_ERROR, GDB_BUDDY_BINARY_NOT_FOUND, 
- 		             _("The binary file could not be found. Try using an absolute path."));
-+        g_free (args[0]);
- 		return 0;
++	g_free (title);
++
++	if (exec_str) {
++		res = g_spawn_command_line_sync (exec_str, NULL, NULL,
+ 					 NULL, &error);
+-	g_free(exec_str);
+-	if (!res) {
+-		g_warning("Couldn't run debugger\n");
+-		return false;
++		g_free(exec_str);
++		if (!res) {
++			g_warning("Couldn't run debugger\n");
++			return false;
++		}
  	}
  
--	args[0] = g_find_program_in_path ("gdb");
--	args[4] = long_app;
-+    if (!pstack)
-+        args[4] = long_app;
+ 	return true;
+@@ -250,7 +277,11 @@
+ check_if_gdb (void *callback_context)
+ {
+ 	char mypath[255];
+-	gchar *gdb;
++	gchar *gdb = NULL;
++#if defined(sun) && defined(__SVR4)
++	gchar *pstack = NULL;
++	gchar *dbx = NULL;
++#endif /* defined(sun) && defined(__SVR4) */
+ 	bool has_debug_symbols;
+ 	char *filename;
+ 	gchar *appname;
+@@ -264,9 +295,18 @@
  
- 	if (args[0] == NULL) {
- 		d(g_message ("Path: %s", getenv ("PATH")));
- 		g_free (long_app);
- 		g_set_error (err, GDB_BUDDY_ERROR, GDB_BUDDY_GDB_NOT_FOUND, 
--			     _("GDB could not be found on your system. "
--			       "Debugging information will not be obtained."));
-+			     _("%s could not be found on your system. "
-+			       "Debugging information will not be obtained."),
-+                    pstack != NULL ? "pstack" : "gdb");
-+        g_free (args[0]);
- 		return 0;
- 	} 
- 	
- 	d(g_message ("About to debug '%s'", long_app));
+ 	appname = g_get_prgname ();
+ 	pid = getpid ();
++
++#if defined(sun) && defined(__SVR4)
++	gdb = g_find_program_in_path ("gdb");
++	pstack = g_find_program_in_path ("pstack");
++	dbx = g_find_program_in_path ("dbx");
++
++	if ((gdb || dbx) && g_getenv("GNOME_HACKER")) {
++#else
+ 	gdb = g_find_program_in_path ("gdb");
+ 
+ 	if (gdb && g_getenv("GNOME_HACKER")) {
++#endif /* defined(sun) && defined(__SVR4) */
+ 		res = run_gdb (appname, pid);
+ 		if (!res)
+ 			_exit (1);
+@@ -274,11 +314,19 @@
+ 	}
  	
--	if (!g_file_test (BUDDY_DATADIR "/gdb-cmd", G_FILE_TEST_EXISTS)) {
--		g_set_error (err, GDB_BUDDY_ERROR, GDB_BUDDY_GDB_CMD_NOT_FOUND, 
--			     _("Could not find the gdb-cmd file.\n"
--			       "Please try reinstalling Bug Buddy."));
--		g_free (args[0]);
--		g_free (long_app);
--		return 0;
--	}
-+    if (gdb) {
-+	    if (!g_file_test (BUDDY_DATADIR "/gdb-cmd", G_FILE_TEST_EXISTS)) {
-+		    g_set_error (err, GDB_BUDDY_ERROR, GDB_BUDDY_GDB_CMD_NOT_FOUND, 
-+			        _("Could not find the gdb-cmd file.\n"
-+			        "Please try reinstalling Bug Buddy."));
-+            g_free (args[0]);
-+		    g_free (long_app);
-+		    return 0;
-+	    }
-+    }
- 	
--	args[5] = g_strdup_printf ("%d", pid);
-+    if (pstack) 
-+	    args[1] = g_strdup_printf ("%d", pid);
-+    else
-+	    args[5] = g_strdup_printf ("%d", pid);
- 	
- 	if (!g_spawn_async_with_pipes (NULL, args, NULL, 0, NULL, NULL,
- 				       &gdb_pid,
-@@ -263,8 +291,11 @@
- 			     _("There was an error running gdb:\n\n%s"),
- 			     error->message);
- 		g_error_free (error);
--		g_free (args[0]);
--		g_free (args[5]);
-+        if (pstack)
-+		    g_free (args[1]);
-+        else
-+		    g_free (args[5]);
-+        g_free (args[0]);
- 		g_free (long_app);
- 		return 0;
- 	} 
-@@ -288,8 +319,11 @@
- 	                                 gdb_handle_input, gdb_data, gdb_destroy);
- 	g_io_channel_unref (ioc);
+ 	memset(mypath, 0, sizeof(mypath));
++#if defined(sun) && defined(__SVR4)
++    snprintf (mypath, sizeof (mypath), "/proc/%d/object/a.out", (int)pid);
++#else
+ 	readlink ("/proc/self/exe", mypath, sizeof(mypath));
++#endif /* defined(sun) && defined(__SVR4) */
+ 	has_debug_symbols = elf_has_debug_symbols (mypath);
+ 
  
--	g_free (args[0]);
--	g_free (args[5]);
-+    if (pstack)
-+	    g_free (args[1]);
-+    else
-+	    g_free (args[5]);
-+    g_free (args[0]);
- 	g_free (long_app);
- 
- 	return source_id;
++#if defined(sun) && defined(__SVR4)
++	if (bugbuddy && (gdb || pstack) && has_debug_symbols) {
++#else
+ 	if (bugbuddy && gdb && has_debug_symbols) {
++#endif /* defined(sun) && defined(__SVR4) */
+ 		res = run_bug_buddy (appname, pid, NULL);
+ 		if (!res)
+ 			_exit (1);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/bug-buddy-02-dlopen-java.diff	Mon Sep 01 15:57:52 2008 +0000
@@ -0,0 +1,121 @@
+--- bug-buddy-2.20.1.old/gnome-breakpad/gnome-breakpad.cc	2007-10-08 13:08:48.629741000 +0100
++++ bug-buddy-2.20.1/gnome-breakpad/gnome-breakpad.cc	2007-10-08 13:14:19.366685000 +0100
+@@ -13,6 +13,7 @@
+ #include <sys/stat.h>
+ #include <fcntl.h>
+ #include <signal.h>
++#include <dlfcn.h>
+ #include <sys/wait.h>
+ 
+ #include <glib.h>
+@@ -339,34 +340,39 @@
+ int
+ gtk_module_init (int *argc, char** argv[])
+ {
++	void *handle;
+ 	bugbuddy = g_find_program_in_path ("bug-buddy");
+ 	
+ 	if (bugbuddy && !g_getenv ("GNOME_DISABLE_CRASH_DIALOG")) {
+ #ifdef ENABLE_GOOGLE_BREAKPAD
+-        	static struct sigaction old_action;
++       	static struct sigaction old_action;
+ 
+-		sigaction(SIGSEGV, NULL, &old_action);
+-		if (old_action.sa_handler != SIG_DFL)
+-			return 0;
+-
+-                sigaction(SIGABRT, NULL, &old_action);
+-		if (old_action.sa_handler != SIG_DFL)
+-			return 0;
+-
+-                sigaction(SIGTRAP, NULL, &old_action);
+-		if (old_action.sa_handler != SIG_DFL)
+-			return 0;
+-
+-                sigaction(SIGFPE, NULL, &old_action);
+-		if (old_action.sa_handler != SIG_DFL)
+-			return 0;
+-
+-                sigaction(SIGBUS, NULL, &old_action);
+-		if (old_action.sa_handler != SIG_DFL)
+-			return 0;
++		if ((handle = dlopen ("libjsig.so", RTLD_LAZY)) == NULL) {
++			sigaction(SIGSEGV, NULL, &old_action);
++			if (old_action.sa_handler != SIG_DFL)
++				return 0;
++
++			sigaction(SIGABRT, NULL, &old_action);
++			if (old_action.sa_handler != SIG_DFL)
++				return 0;
++
++            sigaction(SIGTRAP, NULL, &old_action);
++			if (old_action.sa_handler != SIG_DFL)
++				return 0;
++
++            sigaction(SIGFPE, NULL, &old_action);
++			if (old_action.sa_handler != SIG_DFL)
++				return 0;
++
++            sigaction(SIGBUS, NULL, &old_action);
++			if (old_action.sa_handler != SIG_DFL)
++						return 0;
+ 
+-  		static ExceptionHandler handler("/tmp", check_if_gdb,
++  			static ExceptionHandler handler("/tmp", check_if_gdb,
+ 						MinidumpCallback, NULL, true);
++		} else {
++			dlclose (handle);
++		}
+ #else
+         	static struct sigaction *setptr;
+         	static struct sigaction old_action;
+@@ -376,25 +382,30 @@
+ 
+                 sa.sa_handler = bugbuddy_segv_handle;
+ 
+-                sigaction(SIGSEGV, NULL, &old_action);
+-		if (old_action.sa_handler == SIG_DFL)
+-                	sigaction(SIGSEGV, setptr, NULL);
+-
+-                sigaction(SIGABRT, NULL, &old_action);
+-		if (old_action.sa_handler == SIG_DFL)
+-                	sigaction(SIGABRT, setptr, NULL);
+-
+-                sigaction(SIGTRAP, NULL, &old_action);
+-		if (old_action.sa_handler == SIG_DFL)
+-                	sigaction(SIGTRAP, setptr, NULL);
+-
+-                sigaction(SIGFPE, NULL, &old_action);
+-		if (old_action.sa_handler == SIG_DFL)
+-                	sigaction(SIGFPE, setptr, NULL);
+-
+-                sigaction(SIGBUS, NULL, &old_action);
+-		if (old_action.sa_handler == SIG_DFL)
+-                	sigaction(SIGBUS, setptr, NULL);
++				if ((handle = dlopen ("libjsig.so", RTLD_LAZY)) == NULL) {
++
++                	sigaction(SIGSEGV, NULL, &old_action);
++					if (old_action.sa_handler == SIG_DFL)
++                		sigaction(SIGSEGV, setptr, NULL);
++
++                	sigaction(SIGABRT, NULL, &old_action);
++					if (old_action.sa_handler == SIG_DFL)
++                		sigaction(SIGABRT, setptr, NULL);
++
++                	sigaction(SIGTRAP, NULL, &old_action);
++					if (old_action.sa_handler == SIG_DFL)
++                		sigaction(SIGTRAP, setptr, NULL);
++
++                	sigaction(SIGFPE, NULL, &old_action);
++					if (old_action.sa_handler == SIG_DFL)
++                		sigaction(SIGFPE, setptr, NULL);
++
++                	sigaction(SIGBUS, NULL, &old_action);
++					if (old_action.sa_handler == SIG_DFL)
++                		sigaction(SIGBUS, setptr, NULL);
++				} else {
++					dlclose (handle);
++				}
+ #endif
+ 	}
+ 	return 0;
--- a/patches/bug-buddy-02-enable-breakpad.diff	Mon Sep 01 15:54:37 2008 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,109 +0,0 @@
---- bug-buddy-2.20.1.old/gnome-breakpad/gnome-breakpad.cc	2007-10-08 11:54:17.291663000 +0100
-+++ bug-buddy-2.20.1/gnome-breakpad/gnome-breakpad.cc	2007-10-08 13:05:10.523038000 +0100
-@@ -223,25 +223,52 @@
- static bool
- run_gdb (const gchar *appname, pid_t pid)
- {
--	gchar *exec_str;
-+	gchar *exec_str = NULL;
- 	gchar *title;
- 	gboolean res;
- 	GError *error = NULL;
-+	gchar *gdb = NULL;
- 
- 	title = g_strdup_printf ("Debugging %s", appname);
- 
-+#if defined(__SUNPRO_CC) || (defined(__GNUC__) && defined(__sun__))
-+	gdb = g_find_program_in_path("gdb");;
-+	if (gdb) {
-+		exec_str = g_strdup_printf("gnome-terminal "
-+				 "--title=\"%s\" "
-+				 "--disable-factory "
-+				 "--command=\"gdb %s %d\"",
-+				title, appname, (int)pid);
-+		g_free (gdb);
-+	} else {
-+		gchar *dbx = g_find_program_in_path("dbx");
-+		if (dbx) {
-+			exec_str = g_strdup_printf("gnome-terminal "
-+				 	"--title=\"%s\" "
-+				 	"--disable-factory "
-+				 	"--command=\"dbx /proc/%d/object/a.out %d\"",
-+					title, (int)pid, (int)pid);
-+		}
-+		g_free (dbx);
-+	}
-+#else
- 	exec_str = g_strdup_printf("gnome-terminal "
- 				 "--title=\"%s\" "
- 				 "--disable-factory "
- 				 "--command=\"gdb %s %d\"",
- 				title, appname, (int)pid);
--				g_free (title);
--	res = g_spawn_command_line_sync (exec_str, NULL, NULL,
-+#endif /* defined(sun) && defined(__SVR4) */
-+
-+	g_free (title);
-+
-+	if (exec_str) {
-+		res = g_spawn_command_line_sync (exec_str, NULL, NULL,
- 					 NULL, &error);
--	g_free(exec_str);
--	if (!res) {
--		g_warning("Couldn't run debugger\n");
--		return false;
-+		g_free(exec_str);
-+		if (!res) {
-+			g_warning("Couldn't run debugger\n");
-+			return false;
-+		}
- 	}
- 
- 	return true;
-@@ -251,7 +278,11 @@
- check_if_gdb (void *callback_context)
- {
- 	char mypath[255];
--	gchar *gdb;
-+	gchar *gdb = NULL;
-+#if defined(__SUNPRO_CC) || (defined(__GNUC__) && defined(__sun__))
-+	gchar *pstack = NULL;
-+	gchar *dbx = NULL;
-+#endif /* defined(sun) && defined(__SVR4) */
- 	bool has_debug_symbols;
- 	char *filename;
- 	gchar *appname;
-@@ -265,9 +296,21 @@
- 
- 	appname = g_get_prgname ();
- 	pid = getpid ();
-+
-+#if defined(__SUNPRO_CC) || (defined(__GNUC__) && defined(__sun__))
-+	gdb = g_find_program_in_path ("gdb");
-+	pstack = g_find_program_in_path ("pstack");
-+	dbx = g_find_program_in_path ("dbx");
-+
-+	if (!gdb)
-+		pstack = g_find_program_in_path ("pstack");
-+	
-+	if ((gdb || dbx) && g_getenv("GNOME_HACKER")) {
-+#else
- 	gdb = g_find_program_in_path ("gdb");
- 
- 	if (gdb && g_getenv("GNOME_HACKER")) {
-+#endif /* defined(sun) && defined(__SVR4) */
- 		res = run_gdb (appname, pid);
- 		if (!res)
- 			_exit (1);
-@@ -279,7 +322,11 @@
- 	has_debug_symbols = elf_has_debug_symbols (mypath);
- 
- 
-+#if defined(__SUNPRO_CC) || (defined(__GNUC__) && defined(__sun__))
-+	if (bugbuddy && (gdb || pstack)) {
-+#else
- 	if (bugbuddy && gdb && has_debug_symbols) {
-+#endif /* defined(sun) && defined(__SVR4) */
- 		res = run_bug_buddy (appname, pid, NULL);
- 		if (!res)
- 			_exit (1);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/bug-buddy-03-disable-google-breakpad.diff	Mon Sep 01 15:57:52 2008 +0000
@@ -0,0 +1,11 @@
+--- bug-buddy-2.20.1.old/configure.in	2007-10-16 14:41:00.154725000 +0000
++++ bug-buddy-2.20.1/configure.in	2007-10-16 14:41:24.569593000 +0000
+@@ -96,7 +96,7 @@
+ case $target_os in
+     solaris*)
+ 	solaris=yes
+-	GOOGLE_BREAKPAD_SUPPORTED_OS="yes"
++	GOOGLE_BREAKPAD_SUPPORTED_OS="no"
+ 	;;
+     linux*)
+ 	linux=yes
--- a/patches/bug-buddy-03-dlopen-java.diff	Mon Sep 01 15:54:37 2008 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,121 +0,0 @@
---- bug-buddy-2.20.1.old/gnome-breakpad/gnome-breakpad.cc	2007-10-08 13:08:48.629741000 +0100
-+++ bug-buddy-2.20.1/gnome-breakpad/gnome-breakpad.cc	2007-10-08 13:14:19.366685000 +0100
-@@ -13,6 +13,7 @@
- #include <sys/stat.h>
- #include <fcntl.h>
- #include <signal.h>
-+#include <dlfcn.h>
- #include <sys/wait.h>
- 
- #include <glib.h>
-@@ -339,34 +340,39 @@
- int
- gtk_module_init (int *argc, char** argv[])
- {
-+	void *handle;
- 	bugbuddy = g_find_program_in_path ("bug-buddy");
- 	
- 	if (bugbuddy && !g_getenv ("GNOME_DISABLE_CRASH_DIALOG")) {
- #ifdef ENABLE_GOOGLE_BREAKPAD
--        	static struct sigaction old_action;
-+       	static struct sigaction old_action;
- 
--		sigaction(SIGSEGV, NULL, &old_action);
--		if (old_action.sa_handler != SIG_DFL)
--			return 0;
--
--                sigaction(SIGABRT, NULL, &old_action);
--		if (old_action.sa_handler != SIG_DFL)
--			return 0;
--
--                sigaction(SIGTRAP, NULL, &old_action);
--		if (old_action.sa_handler != SIG_DFL)
--			return 0;
--
--                sigaction(SIGFPE, NULL, &old_action);
--		if (old_action.sa_handler != SIG_DFL)
--			return 0;
--
--                sigaction(SIGBUS, NULL, &old_action);
--		if (old_action.sa_handler != SIG_DFL)
--			return 0;
-+		if ((handle = dlopen ("libjsig.so", RTLD_LAZY)) == NULL) {
-+			sigaction(SIGSEGV, NULL, &old_action);
-+			if (old_action.sa_handler != SIG_DFL)
-+				return 0;
-+
-+			sigaction(SIGABRT, NULL, &old_action);
-+			if (old_action.sa_handler != SIG_DFL)
-+				return 0;
-+
-+            sigaction(SIGTRAP, NULL, &old_action);
-+			if (old_action.sa_handler != SIG_DFL)
-+				return 0;
-+
-+            sigaction(SIGFPE, NULL, &old_action);
-+			if (old_action.sa_handler != SIG_DFL)
-+				return 0;
-+
-+            sigaction(SIGBUS, NULL, &old_action);
-+			if (old_action.sa_handler != SIG_DFL)
-+						return 0;
- 
--  		static ExceptionHandler handler("/tmp", check_if_gdb,
-+  			static ExceptionHandler handler("/tmp", check_if_gdb,
- 						MinidumpCallback, NULL, true);
-+		} else {
-+			dlclose (handle);
-+		}
- #else
-         	static struct sigaction *setptr;
-         	static struct sigaction old_action;
-@@ -376,25 +382,30 @@
- 
-                 sa.sa_handler = bugbuddy_segv_handle;
- 
--                sigaction(SIGSEGV, NULL, &old_action);
--		if (old_action.sa_handler == SIG_DFL)
--                	sigaction(SIGSEGV, setptr, NULL);
--
--                sigaction(SIGABRT, NULL, &old_action);
--		if (old_action.sa_handler == SIG_DFL)
--                	sigaction(SIGABRT, setptr, NULL);
--
--                sigaction(SIGTRAP, NULL, &old_action);
--		if (old_action.sa_handler == SIG_DFL)
--                	sigaction(SIGTRAP, setptr, NULL);
--
--                sigaction(SIGFPE, NULL, &old_action);
--		if (old_action.sa_handler == SIG_DFL)
--                	sigaction(SIGFPE, setptr, NULL);
--
--                sigaction(SIGBUS, NULL, &old_action);
--		if (old_action.sa_handler == SIG_DFL)
--                	sigaction(SIGBUS, setptr, NULL);
-+				if ((handle = dlopen ("libjsig.so", RTLD_LAZY)) == NULL) {
-+
-+                	sigaction(SIGSEGV, NULL, &old_action);
-+					if (old_action.sa_handler == SIG_DFL)
-+                		sigaction(SIGSEGV, setptr, NULL);
-+
-+                	sigaction(SIGABRT, NULL, &old_action);
-+					if (old_action.sa_handler == SIG_DFL)
-+                		sigaction(SIGABRT, setptr, NULL);
-+
-+                	sigaction(SIGTRAP, NULL, &old_action);
-+					if (old_action.sa_handler == SIG_DFL)
-+                		sigaction(SIGTRAP, setptr, NULL);
-+
-+                	sigaction(SIGFPE, NULL, &old_action);
-+					if (old_action.sa_handler == SIG_DFL)
-+                		sigaction(SIGFPE, setptr, NULL);
-+
-+                	sigaction(SIGBUS, NULL, &old_action);
-+					if (old_action.sa_handler == SIG_DFL)
-+                		sigaction(SIGBUS, setptr, NULL);
-+				} else {
-+					dlclose (handle);
-+				}
- #endif
- 	}
- 	return 0;
--- a/patches/bug-buddy-04-disable-google-breakpad.diff	Mon Sep 01 15:54:37 2008 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,11 +0,0 @@
---- bug-buddy-2.20.1.old/configure.in	2007-10-16 14:41:00.154725000 +0000
-+++ bug-buddy-2.20.1/configure.in	2007-10-16 14:41:24.569593000 +0000
-@@ -96,7 +96,7 @@
- case $target_os in
-     solaris*)
- 	solaris=yes
--	GOOGLE_BREAKPAD_SUPPORTED_OS="yes"
-+	GOOGLE_BREAKPAD_SUPPORTED_OS="no"
- 	;;
-     linux*)
- 	linux=yes