[gnome-builder/wip/chergert/bug1: 62/69] gdb: get file and line number from stopped event



commit 4952f0d33c9251f44eb535e805f12d9475e3f861
Author: Christian Hergert <chergert redhat com>
Date:   Thu Aug 31 15:50:06 2017 -0700

    gdb: get file and line number from stopped event

 plugins/gdb/gbp-gdb-debugger.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/plugins/gdb/gbp-gdb-debugger.c b/plugins/gdb/gbp-gdb-debugger.c
index 71a5d8c..847b9fd 100644
--- a/plugins/gdb/gbp-gdb-debugger.c
+++ b/plugins/gdb/gbp-gdb-debugger.c
@@ -498,6 +498,7 @@ gbp_gdb_debugger_handle_stopped (GbpGdbDebugger                 *self,
 {
   IdeDebuggerStopReason stop_reason;
   g_autoptr(IdeDebuggerBreakpoint) breakpoint = NULL;
+  g_autofree gchar *file = NULL;
   G_GNUC_UNUSED const gchar *thread_id = NULL;
   const struct gdbwire_mi_result *iter;
   const gchar *id = NULL;
@@ -505,6 +506,7 @@ gbp_gdb_debugger_handle_stopped (GbpGdbDebugger                 *self,
   const gchar *disp = NULL;
   const gchar *func = NULL;
   const gchar *address = NULL;
+  guint line = 0;
 
   g_assert (GBP_IS_GDB_DEBUGGER (self));
   g_assert (output != NULL);
@@ -554,6 +556,10 @@ gbp_gdb_debugger_handle_stopped (GbpGdbDebugger                 *self,
                         func = subiter->variant.cstring;
                       else if (g_strcmp0 (subiter->variable, "address") == 0)
                         address = subiter->variant.cstring;
+                      else if (g_strcmp0 (subiter->variable, "file") == 0)
+                        file = gbp_gdb_debugger_translate_path (self, subiter->variant.cstring);
+                      else if (g_strcmp0 (subiter->variable, "line") == 0)
+                        line = g_ascii_strtoll (subiter->variant.cstring, NULL, 10);
                     }
                 }
             }
@@ -591,6 +597,8 @@ gbp_gdb_debugger_handle_stopped (GbpGdbDebugger                 *self,
   ide_debugger_breakpoint_set_thread (breakpoint, thread_id);
   ide_debugger_breakpoint_set_address (breakpoint, ide_debugger_address_parse (address));
   ide_debugger_breakpoint_set_function (breakpoint, func);
+  ide_debugger_breakpoint_set_file (breakpoint, file);
+  ide_debugger_breakpoint_set_line (breakpoint, line);
   ide_debugger_breakpoint_set_disposition (breakpoint, parse_disposition_from_string (disp));
 
   gbp_gdb_debugger_reload_breakpoints (self);


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