[gnome-builder/wip/chergert/bug1: 22/32] gdb: track connected state



commit 44cc0d728eb38b88b14e5401225787bd7ddcc49e
Author: Christian Hergert <chergert redhat com>
Date:   Sat Aug 26 23:20:26 2017 -0700

    gdb: track connected state

 plugins/gdb/gbp-gdb-debugger.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/plugins/gdb/gbp-gdb-debugger.c b/plugins/gdb/gbp-gdb-debugger.c
index e593916..d018db1 100644
--- a/plugins/gdb/gbp-gdb-debugger.c
+++ b/plugins/gdb/gbp-gdb-debugger.c
@@ -48,6 +48,8 @@ struct _GbpGdbDebugger
   GQueue                    writequeue;
   GQueue                    cmdqueue;
   guint                     cmdseq;
+
+  guint                     has_connected : 1;
 };
 
 typedef struct
@@ -2442,8 +2444,12 @@ gbp_gdb_debugger_connect (GbpGdbDebugger *self,
   GInputStream *stream;
 
   g_return_if_fail (GBP_IS_GDB_DEBUGGER (self));
+  g_return_if_fail (self->has_connected == FALSE);
   g_return_if_fail (G_IS_IO_STREAM (io_stream));
   g_return_if_fail (!cancellable || G_IS_CANCELLABLE (cancellable));
+  g_return_if_fail (self->io_stream == NULL);
+
+  self->has_connected = TRUE;
 
   g_set_object (&self->io_stream, io_stream);
 


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