patches/bug-buddy-05-use-pstack.diff
author lsgunda
Mon, 08 Nov 2004 06:31:35 +0000
changeset 4469 95b1ef8c7146
permissions -rw-r--r--
2004-11-08 Leena Gunda <[email protected]> * bug-buddy.spec: Update * patches/bug-buddy-05-use-pstack.diff: added patch to make bug-buddy use pstack on Solaris as gdb is not available. Fixes bug #5102045. Patch approved by [email protected]
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
4469
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
     1
--- bug-buddy-2.6.1/configure.in	Fri Apr 16 17:11:54 2004
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
     2
+++ bug-buddy-2.6.1-new/configure.in	Tue Nov  2 15:56:53 2004
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
     3
@@ -70,7 +70,12 @@ AM_GLIB_GNU_GETTEXT
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
     4
 
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
     5
 AC_PATH_PROG(GLIB_GENMARSHAL, glib-genmarshal)
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
     6
 
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
     7
-                                                                                                                             
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
     8
+AC_CANONICAL_HOST
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
     9
+case "$host" in
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
    10
+*solaris*)
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
    11
+	AC_DEFINE(SOLARIS,1,Define to 1 if solaris)
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
    12
+	;;
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
    13
+esac	                                                                                                                             
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
    14
 AC_ARG_ENABLE(deprecations,AC_HELP_STRING([--enable-deprecations],[warn about deprecated usages]))
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
    15
                                                                                                                              
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
    16
 AM_CONDITIONAL(ENABLE_DEPRECATIONS, test "x$enable_deprecations" = xyes)
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
    17
--- bug-buddy-2.6.1/src/gdb-buddy.c	Wed Oct  8 20:10:04 2003
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
    18
+++ bug-buddy-2.6.1-new/src/gdb-buddy.c	Tue Nov  2 19:34:55 2004
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
    19
@@ -161,19 +161,33 @@ get_trace_from_core (const gchar *core_f
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
    20
 	int status;
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
    21
 	FILE *f;
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
    22
 
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
    23
-	gdb_cmd = g_strdup_printf ("gdb --batch --core=%s", core_file);
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
    24
+#ifdef SOLARIS
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
    25
+	char *gdb = g_find_program_in_path ("gdb");
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
    26
+	if (gdb)
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
    27
+#endif
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
    28
+		gdb_cmd = g_strdup_printf ("gdb --batch --core=%s", core_file);
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
    29
+#ifdef SOLARIS
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
    30
+	else
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
    31
+		gdb_cmd = g_strdup_printf ("pstack %s", core_file);
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
    32
+#endif
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
    33
 
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
    34
 	f = popen (gdb_cmd, "r");
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
    35
 	g_free (gdb_cmd);
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
    36
 
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
    37
 	if (!f) {
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
    38
 		GtkWidget *d;
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
    39
+		char *str = "gdb";
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
    40
+#ifdef SOLARIS
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
    41
+		if (!gdb)
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
    42
+			str = "pstack";
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
    43
+#endif
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
    44
+
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
    45
 		d = gtk_message_dialog_new (GTK_WINDOW (GET_WIDGET ("druid-window")),
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
    46
 					    0,
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
    47
 					    GTK_MESSAGE_ERROR,
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
    48
 					    GTK_BUTTONS_OK,
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
    49
-					    _("Unable to process core file with gdb:\n"
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
    50
-					      "'%s'"), core_file);
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
    51
+					    _("Unable to process core file with %s:\n"
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
    52
+					      "'%s'"), str, core_file);
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
    53
 		gtk_dialog_set_default_response (GTK_DIALOG (d), GTK_RESPONSE_OK);
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
    54
 		gtk_dialog_run (GTK_DIALOG (d));
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
    55
 		gtk_widget_destroy (d);
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
    56
@@ -193,18 +207,39 @@ get_trace_from_core (const gchar *core_f
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
    57
 				binary = g_strdup(s);
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
    58
 			}
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
    59
 		}
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
    60
+#ifdef SOLARIS
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
    61
+		else if (!binary && !strncmp(buf, "core ", 4)) {
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
    62
+			gchar *s;
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
    63
+			gchar *ptr = buf;
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
    64
+			while (*ptr != ':' && *ptr !='\0') ptr++;
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
    65
+			if (*ptr == ':') {
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
    66
+				ptr++;
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
    67
+				while (*ptr == ' ' || *ptr == '\t') ptr++;
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
    68
+				s = ptr;
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
    69
+				while (*ptr !='\0') ptr++;
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
    70
+				*ptr = '\0';
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
    71
+				binary = g_strdup(s);
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
    72
+			}
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
    73
+		}
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
    74
+#endif
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
    75
 	}
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
    76
 
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
    77
 	status = pclose(f);
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
    78
 
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
    79
 	if (!binary) {
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
    80
 		GtkWidget *d;
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
    81
+		char *str = "GDB";
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
    82
+#ifdef SOLARIS
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
    83
+		if (!gdb)
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
    84
+			str = "Pstack";
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
    85
+#endif
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
    86
+
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
    87
 		d = gtk_message_dialog_new (GTK_WINDOW (GET_WIDGET ("druid-window")),
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
    88
 					    0,
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
    89
 					    GTK_MESSAGE_ERROR,
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
    90
 					    GTK_BUTTONS_OK,
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
    91
-					    _("GDB was unable to determine which binary created\n"
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
    92
-					      "'%s'"), core_file);
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
    93
+					    _("%s was unable to determine which binary created\n"
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
    94
+					      "'%s'"), str, core_file);
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
    95
 		gtk_dialog_set_default_response (GTK_DIALOG (d), GTK_RESPONSE_OK);
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
    96
 		gtk_dialog_run (GTK_DIALOG (d));
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
    97
 		gtk_widget_destroy (d);
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
    98
@@ -276,21 +311,41 @@ get_trace_from_pair (const gchar *app, c
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
    99
 	const char *short_app;
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
   100
 	char *long_app;
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
   101
 	GError *error = NULL;
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
   102
-	char *args[] = { "gdb",
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
   103
-			 "--batch", 
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
   104
-			 "--quiet",
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
   105
-			 "--command=" BUDDY_DATADIR "/gdb-cmd",
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
   106
-			 NULL, NULL, NULL };
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
   107
-	args[0] = g_find_program_in_path ("gdb");
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
   108
-	args[5] = (char *)extra;
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
   109
+	char *args[7];
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
   110
+	char *gdb = g_find_program_in_path ("gdb");
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
   111
+
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
   112
+        if (!app || !extra || !*app || !*extra)
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
   113
+                return;
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
   114
+
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
   115
+	if (gdb) {
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
   116
+		args[0] =  gdb;
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
   117
+		args[1] = "--batch";
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
   118
+		args[2] = "--quiet";
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
   119
+		args[3] = "--command=" BUDDY_DATADIR "/gdb-cmd";
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
   120
+		args[4] = NULL;
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
   121
+		args[5] = (char *)extra;
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
   122
+		args[6] = NULL;
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
   123
+	}
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
   124
+#ifdef SOLARIS
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
   125
+	else {
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
   126
+		args[0] = g_find_program_in_path ("pstack");
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
   127
+		args[1] = (char *)extra;
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
   128
+		args[2] = args[3] = args[4] =  args[5] = args[6] = NULL;
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
   129
+	}
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
   130
+#endif
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
   131
 
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
   132
 	if (!args[0]) {
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
   133
+		char *str = "GDB";
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
   134
+#ifdef SOLARIS
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
   135
+		if (!gdb)		
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
   136
+			str = "Pstack";
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
   137
+#endif
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
   138
 		d = gtk_message_dialog_new (GTK_WINDOW (GET_WIDGET ("druid-window")),
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
   139
 					    0,
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
   140
 					    GTK_MESSAGE_ERROR,
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
   141
 					    GTK_BUTTONS_OK,
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
   142
-					    _("GDB could not be found on your system.\n"
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
   143
-					      "Debugging information will not be obtained."));
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
   144
+					    _("%s could not be found on your system.\n"
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
   145
+					      "Debugging information will not be obtained."), str);
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
   146
 		d(g_message ("Path: %s", getenv ("PATH")));
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
   147
 		gtk_dialog_set_default_response (GTK_DIALOG (d),
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
   148
 						 GTK_RESPONSE_OK);
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
   149
@@ -299,10 +354,6 @@ get_trace_from_pair (const gchar *app, c
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
   150
 		return;
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
   151
 	}
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
   152
 
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
   153
-	if (!app || !extra || !*app || !*extra)
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
   154
-		return;
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
   155
-	
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
   156
-
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
   157
 	if (*app == G_DIR_SEPARATOR) {
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
   158
 		long_app = g_strdup (app);
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
   159
 		short_app = strrchr (app, G_DIR_SEPARATOR) + 1;
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
   160
@@ -322,24 +373,24 @@ get_trace_from_pair (const gchar *app, c
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
   161
 		g_free (args[0]);
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
   162
 		return;
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
   163
 	}
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
   164
-
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
   165
-	args[4] = long_app;
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
   166
-
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
   167
 	d(g_message ("About to debug '%s'", long_app));
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
   168
-	
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
   169
-	if (!g_file_test (BUDDY_DATADIR "/gdb-cmd", G_FILE_TEST_EXISTS)) {
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
   170
-		d = gtk_message_dialog_new (GTK_WINDOW (GET_WIDGET ("druid-window")),
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
   171
-					    0,
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
   172
-					    GTK_MESSAGE_ERROR,
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
   173
-					    GTK_BUTTONS_OK,
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
   174
-					    _("Could not find the gdb-cmd file.\n"
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
   175
-					      "Please try reinstalling Bug Buddy."));
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
   176
-		gtk_dialog_run (GTK_DIALOG (d));
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
   177
-		gtk_dialog_set_default_response (GTK_DIALOG (d),
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
   178
-						 GTK_RESPONSE_OK);
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
   179
-		gtk_widget_destroy (d);
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
   180
-		g_free (long_app);
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
   181
-		return;
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
   182
+
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
   183
+	if (gdb) {
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
   184
+		args[4] = long_app;
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
   185
+		if (!g_file_test (BUDDY_DATADIR "/gdb-cmd", G_FILE_TEST_EXISTS)) {
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
   186
+			d = gtk_message_dialog_new (GTK_WINDOW (GET_WIDGET ("druid-window")),
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
   187
+						    0,
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
   188
+						    GTK_MESSAGE_ERROR,
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
   189
+						    GTK_BUTTONS_OK,
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
   190
+						    _("Could not find the gdb-cmd file.\n"
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
   191
+						      "Please try reinstalling Bug Buddy."));
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
   192
+			gtk_dialog_run (GTK_DIALOG (d));
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
   193
+			gtk_dialog_set_default_response (GTK_DIALOG (d),
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
   194
+							 GTK_RESPONSE_OK);
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
   195
+			gtk_widget_destroy (d);
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
   196
+			g_free (long_app);
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
   197
+			return;
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
   198
+		}
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
   199
 	}
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
   200
 
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
   201
 	if (!g_spawn_async_with_pipes (NULL, args, NULL, 0, NULL, NULL,
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
   202
@@ -347,11 +398,18 @@ get_trace_from_pair (const gchar *app, c
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
   203
 				       NULL, 
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
   204
 				       &druid_data.fd, 
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
   205
 				       NULL, &error)) {
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
   206
+		char *str = "gdb";
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
   207
+#ifdef SOLARIS
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
   208
+		if (!gdb)
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
   209
+			str = "pstack";
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
   210
+#endif
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
   211
+
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
   212
 		d = gtk_message_dialog_new (GTK_WINDOW (GTK_WIDGET ("druid-window")),
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
   213
 					    0,
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
   214
 					    GTK_MESSAGE_ERROR,
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
   215
 					    GTK_BUTTONS_OK,
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
   216
-					    _("There was an error running gdb:\n\n%s"),
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
   217
+					    _("There was an error running %s:\n\n%s"),
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
   218
+					    str, 
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
   219
 					    error->message);
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
   220
 		gtk_dialog_run (GTK_DIALOG (d));
95b1ef8c7146 2004-11-08 Leena Gunda <[email protected]>
lsgunda
parents:
diff changeset
   221
 		gtk_dialog_set_default_response (GTK_DIALOG (d),