[gnome-builder/wip/chergert/bug1: 101/101] debugger: stash memory breakpoints until the debugger has started
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder/wip/chergert/bug1: 101/101] debugger: stash memory breakpoints until the debugger has started
- Date: Sat, 2 Sep 2017 01:38:52 +0000 (UTC)
commit 2684244f33ceac4c30eae0b9fec7f2073c21f582
Author: Christian Hergert <chergert redhat com>
Date: Fri Sep 1 14:33:42 2017 -0700
debugger: stash memory breakpoints until the debugger has started
This probably won't help for fixed addresses (unless you know where they
are going to be), but it can help for data watchpoints based on specs.
libide/debugger/ide-debug-manager.c | 33 +++++++++++++++++++++++++++++----
1 files changed, 29 insertions(+), 4 deletions(-)
---
diff --git a/libide/debugger/ide-debug-manager.c b/libide/debugger/ide-debug-manager.c
index 0d0e55a..1fca499 100644
--- a/libide/debugger/ide-debug-manager.c
+++ b/libide/debugger/ide-debug-manager.c
@@ -42,6 +42,7 @@ struct _IdeDebugManager
IdeDebugger *debugger;
DzlSignalGroup *debugger_signals;
IdeRunner *runner;
+ GQueue pending_breakpoints;
guint active : 1;
};
@@ -354,6 +355,9 @@ ide_debug_manager_dispose (GObject *object)
{
IdeDebugManager *self = (IdeDebugManager *)object;
+ g_queue_foreach (&self->pending_breakpoints, (GFunc)g_object_unref, NULL);
+ g_queue_clear (&self->pending_breakpoints);
+
g_hash_table_remove_all (self->breakpoints);
dzl_signal_group_set_target (self->debugger_signals, NULL);
g_clear_object (&self->debugger);
@@ -493,6 +497,8 @@ ide_debug_manager_class_init (IdeDebugManagerClass *klass)
static void
ide_debug_manager_init (IdeDebugManager *self)
{
+ g_queue_init (&self->pending_breakpoints);
+
self->breakpoints = g_hash_table_new_full ((GHashFunc)g_file_hash,
(GEqualFunc)g_file_equal,
g_object_unref,
@@ -644,17 +650,20 @@ ide_debug_manager_sync_breakpoints_cb (gpointer item,
static void
ide_debug_manager_sync_breakpoints (IdeDebugManager *self)
{
- GHashTableIter iter;
+ GHashTableIter hiter;
gpointer value;
+ GList *pending;
IDE_ENTRY;
g_assert (IDE_IS_DEBUG_MANAGER (self));
g_assert (self->debugger != NULL);
- g_hash_table_iter_init (&iter, self->breakpoints);
+ /* Register all our breakpoints known by file */
- while (g_hash_table_iter_next (&iter, NULL, &value))
+ g_hash_table_iter_init (&hiter, self->breakpoints);
+
+ while (g_hash_table_iter_next (&hiter, NULL, &value))
{
IdeDebuggerBreakpoints *breakpoints = value;
@@ -671,6 +680,22 @@ ide_debug_manager_sync_breakpoints (IdeDebugManager *self)
self);
}
+ /* Steal the pending breakpoints and register them */
+
+ pending = self->pending_breakpoints.head;
+ self->pending_breakpoints.head = NULL;
+ self->pending_breakpoints.tail = NULL;
+ self->pending_breakpoints.length = 0;
+
+ for (const GList *iter = pending; iter != NULL; iter = iter->next)
+ {
+ g_autoptr(IdeDebuggerBreakpoint) breakpoint = iter->data;
+
+ ide_debugger_insert_breakpoint_async (self->debugger, breakpoint, NULL, NULL, NULL);
+ }
+
+ g_list_free (pending);
+
IDE_EXIT;
}
@@ -892,7 +917,7 @@ _ide_debug_manager_add_breakpoint (IdeDebugManager *self,
* address, function, expression, etc. So we just need to queue
* it until the debugger starts.
*/
-TODO:
+ g_queue_push_tail (&self->pending_breakpoints, g_object_ref (breakpoint));
IDE_EXIT;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]