10389
|
1 |
--- bug-buddy-2.19.91.old/configure.in 2007-08-28 16:11:12.154485000 +0000
|
|
2 |
+++ bug-buddy-2.19.91/configure.in 2007-08-28 16:12:30.544409000 +0000
|
|
3 |
@@ -134,6 +134,13 @@
|
10387
|
4 |
GNOME_COMPILE_WARNINGS([maximum])
|
|
5 |
GNOME_MAINTAINER_MODE_DEFINES
|
6182
|
6 |
|
|
7 |
+AC_CANONICAL_HOST
|
|
8 |
+case "$host" in
|
|
9 |
+*solaris*)
|
10389
|
10 |
+ AC_DEFINE(SOLARIS,1,Define to 1 if solaris)
|
|
11 |
+ ;;
|
6182
|
12 |
+esac
|
10387
|
13 |
+
|
6182
|
14 |
AC_OUTPUT([
|
|
15 |
bug-buddy.spec
|
10387
|
16 |
bug-buddy.schemas
|
10389
|
17 |
--- bug-buddy-2.19.91.old/src/gdb-buddy.c 2007-08-28 16:11:12.151254000 +0000
|
|
18 |
+++ bug-buddy-2.19.91/src/gdb-buddy.c 2007-08-28 16:22:50.119532000 +0000
|
10387
|
19 |
@@ -191,11 +191,9 @@
|
|
20 |
GIOChannel *ioc;
|
6182
|
21 |
GError *error = NULL;
|
10387
|
22 |
GdbData *gdb_data = NULL;
|
6182
|
23 |
- char *args[] = { "gdb",
|
|
24 |
- "--batch",
|
|
25 |
- "--quiet",
|
|
26 |
- "--command=" BUDDY_DATADIR "/gdb-cmd",
|
|
27 |
- NULL, NULL, NULL };
|
10387
|
28 |
+ char *args[7];
|
10389
|
29 |
+ char *gdb = g_find_program_in_path ("gdb");
|
6182
|
30 |
+ gboolean use_pstack = FALSE;
|
10387
|
31 |
|
|
32 |
g_return_val_if_fail (app != NULL, 0);
|
|
33 |
g_return_val_if_fail (*app != '\0', 0);
|
|
34 |
@@ -206,6 +204,22 @@
|
|
35 |
|
|
36 |
d (g_print ("app=%s\n", app));
|
|
37 |
|
|
38 |
+ if (gdb) {
|
|
39 |
+ args[0] = gdb;
|
|
40 |
+ args[1] = "--batch";
|
|
41 |
+ args[2] = "--quiet";
|
|
42 |
+ args[3] = "--command=" BUDDY_DATADIR "/gdb-cmd";
|
|
43 |
+ args[4] = NULL;
|
|
44 |
+ args[6] = NULL;
|
|
45 |
+ }
|
6182
|
46 |
+#ifdef SOLARIS
|
10387
|
47 |
+ else {
|
|
48 |
+ args[0] = g_find_program_in_path ("pstack");
|
|
49 |
+ args[2] = args[3] = args[4] = args[5] = args[6] = NULL;
|
6182
|
50 |
+ use_pstack = TRUE;
|
10387
|
51 |
+ }
|
|
52 |
+#endif /* SOLARIS */
|
|
53 |
+
|
|
54 |
/* apply a SIGCONT to the process */
|
|
55 |
kill (pid, SIGCONT);
|
6182
|
56 |
|
10389
|
57 |
@@ -226,33 +240,42 @@
|
10387
|
58 |
if (!long_app) {
|
|
59 |
g_set_error (err, GDB_BUDDY_ERROR, GDB_BUDDY_BINARY_NOT_FOUND,
|
|
60 |
_("The binary file could not be found. Try using an absolute path."));
|
|
61 |
+ g_free (args[0]);
|
|
62 |
return 0;
|
6182
|
63 |
}
|
|
64 |
|
|
65 |
- args[0] = g_find_program_in_path ("gdb");
|
|
66 |
- args[4] = long_app;
|
|
67 |
+ if (!use_pstack)
|
|
68 |
+ args[4] = long_app;
|
|
69 |
|
10387
|
70 |
if (args[0] == NULL) {
|
6182
|
71 |
d(g_message ("Path: %s", getenv ("PATH")));
|
10387
|
72 |
g_free (long_app);
|
|
73 |
g_set_error (err, GDB_BUDDY_ERROR, GDB_BUDDY_GDB_NOT_FOUND,
|
|
74 |
- _("GDB could not be found on your system. "
|
|
75 |
- "Debugging information will not be obtained."));
|
|
76 |
+ _("%s could not be found on your system. "
|
|
77 |
+ "Debugging information will not be obtained."),
|
10389
|
78 |
+ use_pstack ? "pstack" : "gdb");
|
10387
|
79 |
+ g_free (args[0]);
|
|
80 |
return 0;
|
|
81 |
}
|
|
82 |
|
|
83 |
d(g_message ("About to debug '%s'", long_app));
|
|
84 |
+
|
10389
|
85 |
|
|
86 |
- if (!g_file_test (BUDDY_DATADIR "/gdb-cmd", G_FILE_TEST_EXISTS)) {
|
|
87 |
- g_set_error (err, GDB_BUDDY_ERROR, GDB_BUDDY_GDB_CMD_NOT_FOUND,
|
|
88 |
- _("Could not find the gdb-cmd file.\n"
|
|
89 |
- "Please try reinstalling Bug Buddy."));
|
|
90 |
- g_free (args[0]);
|
|
91 |
- g_free (long_app);
|
|
92 |
- return 0;
|
|
93 |
+ if (gdb) {
|
|
94 |
+ if (!g_file_test (BUDDY_DATADIR "/gdb-cmd", G_FILE_TEST_EXISTS)) {
|
|
95 |
+ g_set_error (err, GDB_BUDDY_ERROR, GDB_BUDDY_GDB_CMD_NOT_FOUND,
|
|
96 |
+ _("Could not find the gdb-cmd file.\n"
|
|
97 |
+ "Please try reinstalling Bug Buddy."));
|
|
98 |
+ g_free (args[0]);
|
|
99 |
+ g_free (long_app);
|
|
100 |
+ return 0;
|
|
101 |
+ }
|
|
102 |
}
|
|
103 |
|
|
104 |
- args[5] = g_strdup_printf ("%d", pid);
|
10387
|
105 |
+ if (use_pstack)
|
|
106 |
+ args[1] = g_strdup_printf ("%d", pid);
|
|
107 |
+ else
|
|
108 |
+ args[5] = g_strdup_printf ("%d", pid);
|
|
109 |
|
|
110 |
if (!g_spawn_async_with_pipes (NULL, args, NULL, 0, NULL, NULL,
|
|
111 |
&gdb_pid,
|
10389
|
112 |
@@ -264,7 +287,10 @@
|
10387
|
113 |
error->message);
|
|
114 |
g_error_free (error);
|
|
115 |
g_free (args[0]);
|
|
116 |
- g_free (args[5]);
|
|
117 |
+ if (use_pstack)
|
|
118 |
+ g_free (args[1]);
|
|
119 |
+ else
|
|
120 |
+ g_free (args[5]);
|
|
121 |
g_free (long_app);
|
|
122 |
return 0;
|
|
123 |
}
|
10389
|
124 |
@@ -289,7 +315,10 @@
|
10387
|
125 |
g_io_channel_unref (ioc);
|
|
126 |
|
|
127 |
g_free (args[0]);
|
|
128 |
- g_free (args[5]);
|
|
129 |
+ if (use_pstack)
|
|
130 |
+ g_free (args[1]);
|
|
131 |
+ else
|
|
132 |
+ g_free (args[5]);
|
|
133 |
g_free (long_app);
|
|
134 |
|
|
135 |
return source_id;
|
10389
|
136 |
--- bug-buddy-2.19.91.old/src/bug-buddy.c 2007-08-28 16:11:12.150378000 +0000
|
|
137 |
+++ bug-buddy-2.19.91/src/bug-buddy.c 2007-08-28 16:24:57.284551000 +0000
|
|
138 |
@@ -967,20 +967,22 @@
|
10387
|
139 |
GtkTextView *text_view;
|
|
140 |
GtkTextIter end;
|
|
141 |
GtkTextBuffer *buffer;
|
|
142 |
+ char *gdb = g_find_program_in_path ("gdb");
|
|
143 |
|
10389
|
144 |
- /* FIXME: These strings are gdb specific, we should add here also dbx */
|
10387
|
145 |
- const char *bt_step1 = "#1";
|
|
146 |
- const char *bt_step2 = "#2";
|
|
147 |
- const char *bt_step3 = "#3";
|
|
148 |
-
|
|
149 |
- if (!g_strrstr (stacktrace, bt_step1) &&
|
|
150 |
- !g_strrstr (stacktrace, bt_step2) &&
|
|
151 |
- !g_strrstr (stacktrace, bt_step3)) {
|
|
152 |
- return FALSE;
|
|
153 |
+ if (gdb) {
|
10389
|
154 |
+ /* FIXME: These strings are gdb specific, we should add here also dbx */
|
10387
|
155 |
+ const char *bt_step1 = "#1";
|
|
156 |
+ const char *bt_step2 = "#2";
|
|
157 |
+ const char *bt_step3 = "#3";
|
|
158 |
+
|
10389
|
159 |
+ g_free (gdb);
|
10387
|
160 |
+ if (!g_strrstr (stacktrace, bt_step1) &&
|
|
161 |
+ !g_strrstr (stacktrace, bt_step2) &&
|
|
162 |
+ !g_strrstr (stacktrace, bt_step3)) {
|
|
163 |
+ return FALSE;
|
|
164 |
+ }
|
|
165 |
}
|
|
166 |
|
|
167 |
-
|
|
168 |
-
|
10389
|
169 |
text_view = GTK_TEXT_VIEW (gtk_builder_get_object (ui, "gdb-text"));
|
10387
|
170 |
buffer = gtk_text_view_get_buffer (text_view);
|
|
171 |
gtk_text_buffer_get_end_iter (buffer, &end);
|