[gnome-builder] gdb: use more precise logging in gdb responses



commit 2829380ceaa2582a23eeb17830f8b9f7e3b64a1b
Author: Christian Hergert <chergert redhat com>
Date:   Fri Jan 11 18:36:09 2019 -0800

    gdb: use more precise logging in gdb responses
    
    This logs the type of reply we received from gdb, which can be useful
    when debugging.
    
    Patch provided by Simo in #748

 src/plugins/gdb/gbp-gdb-debugger.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
---
diff --git a/src/plugins/gdb/gbp-gdb-debugger.c b/src/plugins/gdb/gbp-gdb-debugger.c
index bf4ff83e9..e73699dcc 100644
--- a/src/plugins/gdb/gbp-gdb-debugger.c
+++ b/src/plugins/gdb/gbp-gdb-debugger.c
@@ -929,22 +929,26 @@ gbp_gdb_debugger_output_callback (void                     *context,
   switch (output->kind)
     {
     case GDBWIRE_MI_OUTPUT_PARSE_ERROR:
+      DEBUG_LOG ("from-gdb (ERR)", output->line);
       ide_object_warning (self, "Failed to parse gdb communication: %s", output->line);
       gdbwire_mi_output_free (output);
       gbp_gdb_debugger_panic (self);
       break;
 
     case GDBWIRE_MI_OUTPUT_OOB:
+      DEBUG_LOG ("from-gdb (OOB)", output->line);
       gbp_gdb_debugger_handle_oob (self, output);
       gdbwire_mi_output_free (output);
       break;
 
     case GDBWIRE_MI_OUTPUT_RESULT:
+      DEBUG_LOG ("from-gdb (RES)", output->line);
       /* handle result steals output pointer */
       gbp_gdb_debugger_handle_result (self, output);
       break;
 
     case GDBWIRE_MI_OUTPUT_PROMPT:
+      DEBUG_LOG ("from-gdb (INP)", output->line);
       /* Ignore prompt for now */
       gdbwire_mi_output_free (output);
       break;
@@ -2902,8 +2906,5 @@ gbp_gdb_debugger_exec_finish (GbpGdbDebugger  *self,
 
   ret = ide_task_propagate_pointer (IDE_TASK (result), error);
 
-  if (ret != NULL)
-    DEBUG_LOG ("from-gdb", ret->line);
-
   return g_steal_pointer (&ret);
 }


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