[gnome-builder/wip/chergert/multi-process: 57/58] worker: add tracing macros



commit 33f2473a6de22ef60c480fe6de4212d862ea3564
Author: Christian Hergert <chergert redhat com>
Date:   Tue Oct 20 20:00:09 2015 -0700

    worker: add tracing macros
    
    Debugging this stuff is sort of painful, let's give ourselves everything
    we can to track things down during development.

 libide/ide-worker-manager.c |    4 ++++
 libide/ide-worker-process.c |   12 ++++++++++--
 2 files changed, 14 insertions(+), 2 deletions(-)
---
diff --git a/libide/ide-worker-manager.c b/libide/ide-worker-manager.c
index b216f76..164eb62 100644
--- a/libide/ide-worker-manager.c
+++ b/libide/ide-worker-manager.c
@@ -277,6 +277,8 @@ ide_worker_manager_get_worker_cb (GObject      *object,
   GDBusProxy *proxy;
   GError *error = NULL;
 
+  IDE_ENTRY;
+
   g_assert (IDE_IS_WORKER_PROCESS (worker_process));
   g_assert (G_IS_TASK (task));
 
@@ -286,6 +288,8 @@ ide_worker_manager_get_worker_cb (GObject      *object,
     g_task_return_error (task, error);
   else
     g_task_return_pointer (task, proxy, g_object_unref);
+
+  IDE_EXIT;
 }
 
 void
diff --git a/libide/ide-worker-process.c b/libide/ide-worker-process.c
index 5cef164..38506af 100644
--- a/libide/ide-worker-process.c
+++ b/libide/ide-worker-process.c
@@ -353,6 +353,8 @@ ide_worker_process_create_proxy_for_task (IdeWorkerProcess *self,
   GDBusProxy *proxy;
   GError *error = NULL;
 
+  IDE_ENTRY;
+
   g_assert (IDE_IS_WORKER_PROCESS (self));
   g_assert (G_IS_TASK (task));
 
@@ -362,18 +364,24 @@ ide_worker_process_create_proxy_for_task (IdeWorkerProcess *self,
                                G_IO_ERROR,
                                G_IO_ERROR_PROXY_FAILED,
                                "Failed to create IdeWorker instance.");
-      return;
+      IDE_EXIT;
     }
 
   proxy = ide_worker_create_proxy (self->worker, self->connection, &error);
 
   if (proxy == NULL)
     {
+      if (error == NULL)
+        error = g_error_new_literal (G_IO_ERROR,
+                                     G_IO_ERROR_PROXY_FAILED,
+                                     "IdeWorker returned NULL and did not set an error.");
       g_task_return_error (task, error);
-      return;
+      IDE_EXIT;
     }
 
   g_task_return_pointer (task, proxy, g_object_unref);
+
+  IDE_EXIT;
 }
 
 void


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]