summaryrefslogtreecommitdiff
path: root/src/app.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2007-12-03 15:55:46 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2007-12-03 15:55:46 +0000
commit93befb0153eeab2b9a2d39b8941659c6b7b8c01b (patch)
tree6261c3acd21e392e37c914ab269ea3fe517414ab /src/app.c
parentb42899d876951b7366de540b0d34a5101ed9ac0a (diff)
Include lwp/valgrind in title.
Diffstat (limited to 'src/app.c')
-rw-r--r--src/app.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/src/app.c b/src/app.c
index f82dbfd..c8f473f 100644
--- a/src/app.c
+++ b/src/app.c
@@ -18,6 +18,10 @@
#include "lwp-events.h"
struct _client {
+ enum {
+ LWP,
+ VALGRIND
+ } type;
gboolean active;
gchar *name;
@@ -472,10 +476,21 @@ read_block (Client *client, int fd, Block *blocks)
return blocks;
}
+static const char *
+client_type_to_string (Client *client)
+{
+ switch (client->type) {
+ case LWP: return "lwp"; break;
+ case VALGRIND: return "valgrind"; break;
+ }
+ return "b0rked";
+}
+
static void
_app_set_client_name (App *app, const gchar *client)
{
- char *str = g_strdup_printf ("%s - %s", client, "memfault");
+ const char *type = client_type_to_string (&app->client);
+ char *str = g_strconcat (client, " - memfault [", type, "]", NULL);
gtk_window_set_title (GTK_WINDOW (app->window), str);
g_free (str);
@@ -1827,6 +1842,7 @@ execute_cmdline_vg (App *app, char **argv, GError **error)
G_SPAWN_FILE_AND_ARGV_ZERO,
NULL, NULL, &child, error);
if (ret) {
+ app->client.type = VALGRIND;
app->client.pid = child;
app->client.terminated = FALSE;
_client_init (&app->client, app);
@@ -1884,6 +1900,7 @@ execute_cmdline_lwp (App *app, char **argv, GError **error)
G_SPAWN_DO_NOT_REAP_CHILD,
NULL, NULL, &child, error);
if (ret) {
+ app->client.type = LWP;
app->client.pid = child;
app->client.terminated = FALSE;
g_child_watch_add (child, reap_child, app);