[gnome-builder: 30/139] libide-debugger: create new libide-debugger static library
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder: 30/139] libide-debugger: create new libide-debugger static library
- Date: Thu, 10 Jan 2019 04:19:50 +0000 (UTC)
commit d73fb62593b08400a6b322d96546c9ac6fb73a48
Author: Christian Hergert <chergert redhat com>
Date: Wed Jan 9 16:00:13 2019 -0800
libide-debugger: create new libide-debugger static library
This breaks out the debugger code into a static library and a plugin that
contains the UI components of the debugger which extend the editor.
This is similar to how it was separated before, except the UI components
are no longer in the libide space.
src/libide/debugger/debugger.plugin | 10 --
src/libide/debugger/ide-debug-manager.c | 154 ++++++++++++--------
src/libide/debugger/ide-debug-manager.h | 11 +-
src/libide/debugger/ide-debugger-actions.c | 2 +-
...ss-map.h => ide-debugger-address-map-private.h} | 4 +-
src/libide/debugger/ide-debugger-address-map.c | 2 +-
src/libide/debugger/ide-debugger-breakpoint.c | 6 +-
src/libide/debugger/ide-debugger-breakpoint.h | 8 +-
src/libide/debugger/ide-debugger-breakpoints.c | 4 +-
src/libide/debugger/ide-debugger-breakpoints.h | 8 +-
src/libide/debugger/ide-debugger-fallbacks.c | 4 +-
src/libide/debugger/ide-debugger-frame.c | 2 +-
src/libide/debugger/ide-debugger-frame.h | 4 +-
src/libide/debugger/ide-debugger-instruction.c | 2 +-
src/libide/debugger/ide-debugger-instruction.h | 4 +-
src/libide/debugger/ide-debugger-library.c | 2 +-
src/libide/debugger/ide-debugger-library.h | 6 +-
src/libide/debugger/ide-debugger-private.h | 6 +-
src/libide/debugger/ide-debugger-register.c | 2 +-
src/libide/debugger/ide-debugger-register.h | 13 +-
src/libide/debugger/ide-debugger-thread-group.c | 2 +-
src/libide/debugger/ide-debugger-thread-group.h | 9 +-
src/libide/debugger/ide-debugger-thread.c | 2 +-
src/libide/debugger/ide-debugger-thread.h | 4 +-
src/libide/debugger/ide-debugger-types.c | 2 +-
src/libide/debugger/ide-debugger-types.h | 16 ++-
src/libide/debugger/ide-debugger-variable.c | 2 +-
src/libide/debugger/ide-debugger-variable.h | 4 +-
src/libide/debugger/ide-debugger.c | 6 +-
src/libide/debugger/ide-debugger.h | 27 ++--
src/libide/debugger/libide-debugger.h | 44 ++++++
src/libide/debugger/meson.build | 99 ++++++++-----
.../debuggerui/debuggerui-plugin.c} | 20 +--
src/plugins/debuggerui/debuggerui.gresource.xml | 15 ++
src/plugins/debuggerui/debuggerui.plugin | 11 ++
.../debugger => plugins/debuggerui}/gtk/menus.ui | 10 ++
.../debuggerui}/ide-debugger-breakpoints-view.c | 4 +-
.../debuggerui}/ide-debugger-breakpoints-view.h | 2 +-
.../debuggerui}/ide-debugger-breakpoints-view.ui | 0
.../debuggerui}/ide-debugger-controls.c | 4 +-
.../debuggerui}/ide-debugger-controls.h | 4 +-
.../debuggerui}/ide-debugger-controls.ui | 0
.../debuggerui}/ide-debugger-disassembly-view.c | 12 +-
.../debuggerui}/ide-debugger-disassembly-view.h | 7 +-
.../debuggerui}/ide-debugger-disassembly-view.ui | 2 +-
.../debuggerui}/ide-debugger-editor-addin.c | 159 ++++++++++++---------
.../debuggerui}/ide-debugger-editor-addin.h | 3 +-
.../debuggerui}/ide-debugger-hover-controls.c | 12 +-
.../debuggerui}/ide-debugger-hover-controls.h | 2 +-
.../debuggerui}/ide-debugger-hover-controls.ui | 0
.../debuggerui}/ide-debugger-hover-provider.c | 28 ++--
.../debuggerui}/ide-debugger-hover-provider.h | 2 +-
.../debuggerui}/ide-debugger-libraries-view.c | 4 +-
.../debuggerui}/ide-debugger-libraries-view.h | 2 +-
.../debuggerui}/ide-debugger-libraries-view.ui | 0
.../debuggerui}/ide-debugger-locals-view.c | 8 +-
.../debuggerui}/ide-debugger-locals-view.h | 2 +-
.../debuggerui}/ide-debugger-locals-view.ui | 0
.../debuggerui}/ide-debugger-registers-view.c | 8 +-
.../debuggerui}/ide-debugger-registers-view.h | 2 +-
.../debuggerui}/ide-debugger-registers-view.ui | 0
.../debuggerui}/ide-debugger-threads-view.c | 7 +-
.../debuggerui}/ide-debugger-threads-view.h | 2 +-
.../debuggerui}/ide-debugger-threads-view.ui | 0
src/plugins/debuggerui/meson.build | 21 +++
65 files changed, 492 insertions(+), 332 deletions(-)
---
diff --git a/src/libide/debugger/ide-debug-manager.c b/src/libide/debugger/ide-debug-manager.c
index 8648dd4a4..41c2b86a0 100644
--- a/src/libide/debugger/ide-debug-manager.c
+++ b/src/libide/debugger/ide-debug-manager.c
@@ -24,43 +24,40 @@
#include <dazzle.h>
#include <glib/gi18n.h>
+#include <libide-code.h>
+#include <libide-plugins.h>
+#include <libide-threading.h>
#include <stdlib.h>
#include <string.h>
-#include "ide-debug.h"
+#include "ide-buffer-private.h"
-#include "buffers/ide-buffer.h"
-#include "buffers/ide-buffer-manager.h"
-#include "buildsystem/ide-build-target.h"
-#include "debugger/ide-debug-manager.h"
-#include "debugger/ide-debugger.h"
-#include "debugger/ide-debugger-private.h"
-#include "files/ide-file.h"
-#include "plugins/ide-extension-util.h"
-#include "runner/ide-runner.h"
-#include "threading/ide-task.h"
+#include "ide-debug-manager.h"
+#include "ide-debugger.h"
+#include "ide-debugger-private.h"
#define TAG_CURRENT_BKPT "debugger::current-breakpoint"
struct _IdeDebugManager
{
- IdeObject parent_instance;
+ IdeObject parent_instance;
- GHashTable *breakpoints;
- IdeDebugger *debugger;
- DzlSignalGroup *debugger_signals;
- IdeRunner *runner;
- GQueue pending_breakpoints;
- GPtrArray *supported_languages;
+ GHashTable *breakpoints;
+ IdeDebugger *debugger;
+ DzlSignalGroup *debugger_signals;
+ IdeRunner *runner;
+ GQueue pending_breakpoints;
+ GPtrArray *supported_languages;
- guint active : 1;
+ guint active : 1;
};
typedef struct
{
- IdeDebugger *debugger;
- IdeRunner *runner;
- gint priority;
+ IdeDebugManager *self;
+ IdeDebugger *debugger;
+ IdeRunner *runner;
+ gint priority;
} DebuggerLookup;
enum {
@@ -92,6 +89,28 @@ compare_language_id (gconstpointer a,
return strcmp (*astr, *bstr);
}
+static void
+ide_debug_manager_notify_buffer (IdeDebugManager *self,
+ IdeDebuggerBreakpoints *breakpoints)
+{
+ g_autoptr(IdeContext) context = NULL;
+ IdeBufferManager *bufmgr;
+ IdeBuffer *buffer;
+ GFile *file;
+
+ g_assert (IDE_IS_MAIN_THREAD ());
+ g_assert (IDE_IS_DEBUG_MANAGER (self));
+ g_assert (IDE_IS_DEBUGGER_BREAKPOINTS (breakpoints));
+
+ context = ide_object_ref_context (IDE_OBJECT (self));
+ bufmgr = ide_buffer_manager_from_context (context);
+ file = ide_debugger_breakpoints_get_file (breakpoints);
+ buffer = ide_buffer_manager_find_buffer (bufmgr, file);
+
+ if (buffer != NULL)
+ _ide_buffer_line_flags_changed (buffer);
+}
+
/**
* ide_debug_manager_supports_language:
* @self: a #IdeDebugManager
@@ -294,7 +313,7 @@ ide_debug_manager_breakpoint_added (IdeDebugManager *self,
IdeDebuggerBreakpoint *breakpoint,
IdeDebugger *debugger)
{
- IdeDebuggerBreakpoints *breakpoints;
+ g_autoptr(IdeDebuggerBreakpoints) breakpoints = NULL;
g_autoptr(GFile) file = NULL;
const gchar *path;
@@ -303,21 +322,13 @@ ide_debug_manager_breakpoint_added (IdeDebugManager *self,
g_assert (IDE_IS_DEBUGGER (debugger));
/* If there is no file, then there is nothing to cache */
- path = ide_debugger_breakpoint_get_file (breakpoint);
- if (path == NULL)
+ if (!(path = ide_debugger_breakpoint_get_file (breakpoint)))
return;
file = g_file_new_for_path (path);
- breakpoints = g_hash_table_lookup (self->breakpoints, file);
- if (breakpoints == NULL)
- {
- breakpoints = g_object_new (IDE_TYPE_DEBUGGER_BREAKPOINTS,
- "file", file,
- NULL);
- g_hash_table_insert (self->breakpoints, g_steal_pointer (&file), breakpoints);
- }
-
+ breakpoints = ide_debug_manager_get_breakpoints_for_file (self, file);
_ide_debugger_breakpoints_add (breakpoints, breakpoint);
+ ide_debug_manager_notify_buffer (self, breakpoints);
}
static void
@@ -384,7 +395,7 @@ ide_debug_manager_clear_stopped (IdeDebugManager *self)
g_assert (IDE_IS_DEBUG_MANAGER (self));
context = ide_object_get_context (IDE_OBJECT (self));
- bufmgr = ide_context_get_buffer_manager (context);
+ bufmgr = ide_buffer_manager_from_context (context);
n_items = g_list_model_get_n_items (G_LIST_MODEL (bufmgr));
@@ -504,17 +515,17 @@ ide_debug_manager_real_breakpoint_reached (IdeDebugManager *self,
if (path != NULL)
{
IdeContext *context = ide_object_get_context (IDE_OBJECT (self));
- IdeBufferManager *bufmgr = ide_context_get_buffer_manager (context);
- g_autoptr(IdeFile) file = ide_file_new_for_path (context, path);
+ IdeBufferManager *bufmgr = ide_buffer_manager_from_context (context);
+ g_autoptr(GFile) file = ide_context_build_file (context, path);
g_autoptr(IdeTask) task = NULL;
task = ide_task_new (self, NULL, NULL, NULL);
+ ide_task_set_source_tag (task, ide_debug_manager_real_breakpoint_reached);
ide_task_set_task_data (task, g_object_ref (breakpoint), g_object_unref);
ide_buffer_manager_load_file_async (bufmgr,
file,
- FALSE,
- IDE_WORKBENCH_OPEN_FLAGS_NONE,
+ IDE_BUFFER_OPEN_FLAGS_NONE,
NULL,
NULL,
ide_debug_manager_load_file_cb,
@@ -532,8 +543,8 @@ ide_debug_manager_dispose (GObject *object)
g_hash_table_remove_all (self->breakpoints);
dzl_signal_group_set_target (self->debugger_signals, NULL);
- g_clear_object (&self->debugger);
- g_clear_object (&self->runner);
+ ide_clear_and_destroy_object (&self->debugger);
+ ide_clear_and_destroy_object (&self->runner);
G_OBJECT_CLASS (ide_debug_manager_parent_class)->dispose (object);
}
@@ -746,6 +757,8 @@ debugger_lookup (PeasExtensionSet *set,
g_assert (IDE_IS_DEBUGGER (debugger));
g_assert (lookup != NULL);
+ ide_object_append (IDE_OBJECT (lookup->self), IDE_OBJECT (debugger));
+
if (ide_debugger_supports_runner (debugger, lookup->runner, &priority))
{
IdeBuildTarget *build_target = ide_runner_get_build_target (lookup->runner);
@@ -755,15 +768,20 @@ debugger_lookup (PeasExtensionSet *set,
g_autofree gchar *language = ide_build_target_get_language (build_target);
if (!debugger_supports_language (plugin_info, language))
- return;
+ goto failure;
}
if (lookup->debugger == NULL || priority < lookup->priority)
{
- g_set_object (&lookup->debugger, debugger);
+ ide_clear_and_destroy_object (&lookup->debugger);
+ lookup->debugger = g_object_ref (debugger);
lookup->priority = priority;
+ return;
}
}
+
+failure:
+ ide_object_destroy (IDE_OBJECT (debugger));
}
/**
@@ -783,22 +801,19 @@ ide_debug_manager_find_debugger (IdeDebugManager *self,
IdeRunner *runner)
{
g_autoptr(PeasExtensionSet) set = NULL;
- IdeContext *context;
DebuggerLookup lookup;
g_return_val_if_fail (IDE_IS_DEBUG_MANAGER (self), NULL);
g_return_val_if_fail (IDE_IS_RUNNER (runner), NULL);
- context = ide_object_get_context (IDE_OBJECT (runner));
-
+ lookup.self = self;
lookup.debugger = NULL;
lookup.runner = runner;
lookup.priority = G_MAXINT;
- set = ide_extension_set_new (peas_engine_get_default (),
- IDE_TYPE_DEBUGGER,
- "context", context,
- NULL);
+ set = peas_extension_set_new (peas_engine_get_default (),
+ IDE_TYPE_DEBUGGER,
+ NULL);
peas_extension_set_foreach (set, debugger_lookup, &lookup);
@@ -943,6 +958,9 @@ ide_debug_manager_runner_exited (IdeDebugManager *self,
ide_debug_manager_clear_stopped (self);
g_object_notify_by_pspec (G_OBJECT (self), properties [PROP_DEBUGGER]);
+
+ ide_clear_and_destroy_object (&debugger);
+ ide_clear_and_destroy_object (&hold_runner);
}
/**
@@ -969,6 +987,7 @@ ide_debug_manager_start (IdeDebugManager *self,
g_return_val_if_fail (IDE_IS_DEBUG_MANAGER (self), FALSE);
g_return_val_if_fail (IDE_IS_RUNNER (runner), FALSE);
+ g_return_val_if_fail (self->debugger == NULL, FALSE);
debugger = ide_debug_manager_find_debugger (self, runner);
@@ -978,7 +997,7 @@ ide_debug_manager_start (IdeDebugManager *self,
g_set_error (error,
G_IO_ERROR,
G_IO_ERROR_NOT_SUPPORTED,
- _("A suitable debugger could not be found."));
+ _("A suitable debugger was not found."));
IDE_GOTO (failure);
}
@@ -1021,10 +1040,10 @@ ide_debug_manager_stop (IdeDebugManager *self)
if (self->runner != NULL)
{
ide_runner_force_quit (self->runner);
- g_clear_object (&self->runner);
+ ide_clear_and_destroy_object (&self->runner);
}
- g_clear_object (&self->debugger);
+ ide_clear_and_destroy_object (&self->debugger);
ide_debug_manager_reset_breakpoints (self);
g_object_notify_by_pspec (G_OBJECT (self), properties [PROP_DEBUGGER]);
@@ -1126,9 +1145,7 @@ _ide_debug_manager_add_breakpoint (IdeDebugManager *self,
IDE_EXIT;
}
- path = ide_debugger_breakpoint_get_file (breakpoint);
-
- if (path == NULL)
+ if (!(path = ide_debugger_breakpoint_get_file (breakpoint)))
{
/* We don't know where this breakpoint is because it's either an
* address, function, expression, etc. So we just need to queue
@@ -1141,6 +1158,7 @@ _ide_debug_manager_add_breakpoint (IdeDebugManager *self,
file = g_file_new_for_path (path);
breakpoints = ide_debug_manager_get_breakpoints_for_file (self, file);
_ide_debugger_breakpoints_add (breakpoints, breakpoint);
+ ide_debug_manager_notify_buffer (self, breakpoints);
IDE_EXIT;
}
@@ -1189,3 +1207,27 @@ _ide_debug_manager_remove_breakpoint (IdeDebugManager *self,
IDE_EXIT;
}
+
+/**
+ * ide_debug_manager_from_context:
+ * @context: an #IdeContext
+ *
+ * Gets the #IdeDebugManager for a context.
+ *
+ * Returns: (transfer none): an #IdeDebugManager
+ *
+ * Since: 3.32
+ */
+IdeDebugManager *
+ide_debug_manager_from_context (IdeContext *context)
+{
+ IdeDebugManager *ret;
+
+ g_return_val_if_fail (IDE_IS_CONTEXT (context), NULL);
+
+ /* Returns a borrowed reference, instead of full */
+ ret = ide_object_ensure_child_typed (IDE_OBJECT (context), IDE_TYPE_DEBUG_MANAGER);
+ g_object_unref (ret);
+
+ return ret;
+}
diff --git a/src/libide/debugger/ide-debug-manager.h b/src/libide/debugger/ide-debug-manager.h
index 9470c1124..62f11bd7b 100644
--- a/src/libide/debugger/ide-debug-manager.h
+++ b/src/libide/debugger/ide-debug-manager.h
@@ -20,11 +20,12 @@
#pragma once
-#include "ide-version-macros.h"
+#include <libide-core.h>
+#include <libide-foundry.h>
-#include "ide-object.h"
-
-#include "debugger/ide-debugger-breakpoints.h"
+#include "ide-debugger.h"
+#include "ide-debugger-breakpoints.h"
+#include "ide-debugger-types.h"
G_BEGIN_DECLS
@@ -33,6 +34,8 @@ G_BEGIN_DECLS
IDE_AVAILABLE_IN_3_32
G_DECLARE_FINAL_TYPE (IdeDebugManager, ide_debug_manager, IDE, DEBUG_MANAGER, IdeObject)
+IDE_AVAILABLE_IN_3_32
+IdeDebugManager *ide_debug_manager_from_context (IdeContext *context);
IDE_AVAILABLE_IN_3_32
IdeDebugger *ide_debug_manager_get_debugger (IdeDebugManager *self);
IDE_AVAILABLE_IN_3_32
diff --git a/src/libide/debugger/ide-debugger-actions.c b/src/libide/debugger/ide-debugger-actions.c
index 9a50970cd..99e7194ea 100644
--- a/src/libide/debugger/ide-debugger-actions.c
+++ b/src/libide/debugger/ide-debugger-actions.c
@@ -22,7 +22,7 @@
#include "config.h"
-#include "debugger/ide-debugger-private.h"
+#include "ide-debugger-private.h"
typedef struct _IdeDebuggerActionEntry IdeDebuggerActionEntry;
diff --git a/src/libide/debugger/ide-debugger-address-map.h
b/src/libide/debugger/ide-debugger-address-map-private.h
similarity index 96%
rename from src/libide/debugger/ide-debugger-address-map.h
rename to src/libide/debugger/ide-debugger-address-map-private.h
index 68273d0ef..341729e70 100644
--- a/src/libide/debugger/ide-debugger-address-map.h
+++ b/src/libide/debugger/ide-debugger-address-map-private.h
@@ -1,4 +1,4 @@
-/* ide-debugger-address-map.h
+/* ide-debugger-address-map-private.h
*
* Copyright 2016-2019 Christian Hergert <chergert redhat com>
*
@@ -20,7 +20,7 @@
#pragma once
-#include "debugger/ide-debugger-types.h"
+#include "ide-debugger-types.h"
G_BEGIN_DECLS
diff --git a/src/libide/debugger/ide-debugger-address-map.c b/src/libide/debugger/ide-debugger-address-map.c
index 68dbe68fb..3f9e2604c 100644
--- a/src/libide/debugger/ide-debugger-address-map.c
+++ b/src/libide/debugger/ide-debugger-address-map.c
@@ -22,7 +22,7 @@
#include "config.h"
-#include "debugger/ide-debugger-address-map.h"
+#include "ide-debugger-address-map-private.h"
struct _IdeDebuggerAddressMap
{
diff --git a/src/libide/debugger/ide-debugger-breakpoint.c b/src/libide/debugger/ide-debugger-breakpoint.c
index 942305186..d7931f18a 100644
--- a/src/libide/debugger/ide-debugger-breakpoint.c
+++ b/src/libide/debugger/ide-debugger-breakpoint.c
@@ -22,9 +22,9 @@
#include "config.h"
-#include "debugger/ide-debugger-breakpoint.h"
-#include "debugger/ide-debugger-private.h"
-#include "debugger/ide-debugger-types.h"
+#include "ide-debugger-breakpoint.h"
+#include "ide-debugger-private.h"
+#include "ide-debugger-types.h"
typedef struct
{
diff --git a/src/libide/debugger/ide-debugger-breakpoint.h b/src/libide/debugger/ide-debugger-breakpoint.h
index fe35b2e29..6eea3164c 100644
--- a/src/libide/debugger/ide-debugger-breakpoint.h
+++ b/src/libide/debugger/ide-debugger-breakpoint.h
@@ -20,12 +20,10 @@
#pragma once
-#include <glib-object.h>
+#include <libide-core.h>
-#include "ide-version-macros.h"
-
-#include "debugger/ide-debugger-frame.h"
-#include "debugger/ide-debugger-types.h"
+#include "ide-debugger-frame.h"
+#include "ide-debugger-types.h"
G_BEGIN_DECLS
diff --git a/src/libide/debugger/ide-debugger-breakpoints.c b/src/libide/debugger/ide-debugger-breakpoints.c
index 9ac2e0a1e..966eb2f60 100644
--- a/src/libide/debugger/ide-debugger-breakpoints.c
+++ b/src/libide/debugger/ide-debugger-breakpoints.c
@@ -26,8 +26,8 @@
#include "ide-debug.h"
-#include "debugger/ide-debugger-breakpoints.h"
-#include "debugger/ide-debugger-private.h"
+#include "ide-debugger-breakpoints.h"
+#include "ide-debugger-private.h"
/**
* SECTION:ide-debugger-breakpoints
diff --git a/src/libide/debugger/ide-debugger-breakpoints.h b/src/libide/debugger/ide-debugger-breakpoints.h
index 00a0ac83c..90c38ef93 100644
--- a/src/libide/debugger/ide-debugger-breakpoints.h
+++ b/src/libide/debugger/ide-debugger-breakpoints.h
@@ -20,12 +20,10 @@
#pragma once
-#include <glib-object.h>
+#include <libide-core.h>
-#include "ide-version-macros.h"
-
-#include "debugger/ide-debugger-breakpoint.h"
-#include "debugger/ide-debugger-types.h"
+#include "ide-debugger-breakpoint.h"
+#include "ide-debugger-types.h"
G_BEGIN_DECLS
diff --git a/src/libide/debugger/ide-debugger-fallbacks.c b/src/libide/debugger/ide-debugger-fallbacks.c
index 7132e6cf7..a12cc1d6a 100644
--- a/src/libide/debugger/ide-debugger-fallbacks.c
+++ b/src/libide/debugger/ide-debugger-fallbacks.c
@@ -22,8 +22,8 @@
#include "config.h"
-#include "debugger/ide-debugger.h"
-#include "debugger/ide-debugger-private.h"
+#include "ide-debugger.h"
+#include "ide-debugger-private.h"
void
_ide_debugger_real_list_frames_async (IdeDebugger *self,
diff --git a/src/libide/debugger/ide-debugger-frame.c b/src/libide/debugger/ide-debugger-frame.c
index c5ef8acc0..82b6b90c9 100644
--- a/src/libide/debugger/ide-debugger-frame.c
+++ b/src/libide/debugger/ide-debugger-frame.c
@@ -22,7 +22,7 @@
#include "config.h"
-#include "debugger/ide-debugger-frame.h"
+#include "ide-debugger-frame.h"
typedef struct
{
diff --git a/src/libide/debugger/ide-debugger-frame.h b/src/libide/debugger/ide-debugger-frame.h
index 30e2589a1..67cca9f86 100644
--- a/src/libide/debugger/ide-debugger-frame.h
+++ b/src/libide/debugger/ide-debugger-frame.h
@@ -20,9 +20,9 @@
#pragma once
-#include "ide-version-macros.h"
+#include <libide-core.h>
-#include "debugger/ide-debugger-types.h"
+#include "ide-debugger-types.h"
G_BEGIN_DECLS
diff --git a/src/libide/debugger/ide-debugger-instruction.c b/src/libide/debugger/ide-debugger-instruction.c
index ea0ae27e1..bb8283351 100644
--- a/src/libide/debugger/ide-debugger-instruction.c
+++ b/src/libide/debugger/ide-debugger-instruction.c
@@ -22,7 +22,7 @@
#include "config.h"
-#include "debugger/ide-debugger-instruction.h"
+#include "ide-debugger-instruction.h"
typedef struct
{
diff --git a/src/libide/debugger/ide-debugger-instruction.h b/src/libide/debugger/ide-debugger-instruction.h
index 35cada4b6..50b2ecd17 100644
--- a/src/libide/debugger/ide-debugger-instruction.h
+++ b/src/libide/debugger/ide-debugger-instruction.h
@@ -20,9 +20,9 @@
#pragma once
-#include "ide-version-macros.h"
+#include <libide-core.h>
-#include "debugger/ide-debugger-types.h"
+#include "ide-debugger-types.h"
G_BEGIN_DECLS
diff --git a/src/libide/debugger/ide-debugger-library.c b/src/libide/debugger/ide-debugger-library.c
index 4ca2e02b2..63f6427cf 100644
--- a/src/libide/debugger/ide-debugger-library.c
+++ b/src/libide/debugger/ide-debugger-library.c
@@ -22,7 +22,7 @@
#include "config.h"
-#include "debugger/ide-debugger-library.h"
+#include "ide-debugger-library.h"
typedef struct
{
diff --git a/src/libide/debugger/ide-debugger-library.h b/src/libide/debugger/ide-debugger-library.h
index f76445c47..0f558faaf 100644
--- a/src/libide/debugger/ide-debugger-library.h
+++ b/src/libide/debugger/ide-debugger-library.h
@@ -20,11 +20,9 @@
#pragma once
-#include <gio/gio.h>
+#include <libide-core.h>
-#include "ide-version-macros.h"
-
-#include "debugger/ide-debugger-types.h"
+#include "ide-debugger-types.h"
G_BEGIN_DECLS
diff --git a/src/libide/debugger/ide-debugger-private.h b/src/libide/debugger/ide-debugger-private.h
index 7eda6850f..df1c1ee08 100644
--- a/src/libide/debugger/ide-debugger-private.h
+++ b/src/libide/debugger/ide-debugger-private.h
@@ -20,9 +20,9 @@
#pragma once
-#include "debugger/ide-debug-manager.h"
-#include "debugger/ide-debugger.h"
-#include "debugger/ide-debugger-breakpoints.h"
+#include "ide-debug-manager.h"
+#include "ide-debugger.h"
+#include "ide-debugger-breakpoints.h"
G_BEGIN_DECLS
diff --git a/src/libide/debugger/ide-debugger-register.c b/src/libide/debugger/ide-debugger-register.c
index 25f511825..1b03639ec 100644
--- a/src/libide/debugger/ide-debugger-register.c
+++ b/src/libide/debugger/ide-debugger-register.c
@@ -22,7 +22,7 @@
#include "config.h"
-#include "debugger/ide-debugger-register.h"
+#include "ide-debugger-register.h"
typedef struct
{
diff --git a/src/libide/debugger/ide-debugger-register.h b/src/libide/debugger/ide-debugger-register.h
index 411046ac3..1b74c0189 100644
--- a/src/libide/debugger/ide-debugger-register.h
+++ b/src/libide/debugger/ide-debugger-register.h
@@ -20,9 +20,7 @@
#pragma once
-#include <glib-object.h>
-
-#include "ide-version-macros.h"
+#include <libide-core.h>
G_BEGIN_DECLS
@@ -36,14 +34,7 @@ struct _IdeDebuggerRegisterClass
GObjectClass parent_class;
/*< private >*/
- gpointer _reserved1;
- gpointer _reserved2;
- gpointer _reserved3;
- gpointer _reserved4;
- gpointer _reserved5;
- gpointer _reserved6;
- gpointer _reserved7;
- gpointer _reserved8;
+ gpointer _reserved[8];
};
IDE_AVAILABLE_IN_3_32
diff --git a/src/libide/debugger/ide-debugger-thread-group.c b/src/libide/debugger/ide-debugger-thread-group.c
index b8b9155d1..d68acf09e 100644
--- a/src/libide/debugger/ide-debugger-thread-group.c
+++ b/src/libide/debugger/ide-debugger-thread-group.c
@@ -22,7 +22,7 @@
#include "config.h"
-#include "debugger/ide-debugger-thread-group.h"
+#include "ide-debugger-thread-group.h"
typedef struct
{
diff --git a/src/libide/debugger/ide-debugger-thread-group.h b/src/libide/debugger/ide-debugger-thread-group.h
index c5ed485b2..73bee38ce 100644
--- a/src/libide/debugger/ide-debugger-thread-group.h
+++ b/src/libide/debugger/ide-debugger-thread-group.h
@@ -20,9 +20,7 @@
#pragma once
-#include <gio/gio.h>
-
-#include "ide-version-macros.h"
+#include <libide-core.h>
G_BEGIN_DECLS
@@ -36,10 +34,7 @@ struct _IdeDebuggerThreadGroupClass
GObjectClass parent_class;
/*< private >*/
- gpointer _reserved1;
- gpointer _reserved2;
- gpointer _reserved3;
- gpointer _reserved4;
+ gpointer _reserved[4];
};
IDE_AVAILABLE_IN_3_32
diff --git a/src/libide/debugger/ide-debugger-thread.c b/src/libide/debugger/ide-debugger-thread.c
index e3d93a66b..1e3c1a725 100644
--- a/src/libide/debugger/ide-debugger-thread.c
+++ b/src/libide/debugger/ide-debugger-thread.c
@@ -22,7 +22,7 @@
#include "config.h"
-#include "debugger/ide-debugger-thread.h"
+#include "ide-debugger-thread.h"
typedef struct
{
diff --git a/src/libide/debugger/ide-debugger-thread.h b/src/libide/debugger/ide-debugger-thread.h
index f09d68d43..dca800c65 100644
--- a/src/libide/debugger/ide-debugger-thread.h
+++ b/src/libide/debugger/ide-debugger-thread.h
@@ -20,9 +20,7 @@
#pragma once
-#include <gio/gio.h>
-
-#include "ide-version-macros.h"
+#include <libide-core.h>
G_BEGIN_DECLS
diff --git a/src/libide/debugger/ide-debugger-types.c b/src/libide/debugger/ide-debugger-types.c
index 40e30f4f5..138b08582 100644
--- a/src/libide/debugger/ide-debugger-types.c
+++ b/src/libide/debugger/ide-debugger-types.c
@@ -22,7 +22,7 @@
#include "config.h"
-#include "debugger/ide-debugger-types.h"
+#include "ide-debugger-types.h"
GType
ide_debugger_stream_get_type (void)
diff --git a/src/libide/debugger/ide-debugger-types.h b/src/libide/debugger/ide-debugger-types.h
index 1cb257613..705968d96 100644
--- a/src/libide/debugger/ide-debugger-types.h
+++ b/src/libide/debugger/ide-debugger-types.h
@@ -20,9 +20,7 @@
#pragma once
-#include <gio/gio.h>
-
-#include "ide-version-macros.h"
+#include <libide-core.h>
G_BEGIN_DECLS
@@ -35,7 +33,7 @@ G_BEGIN_DECLS
*
* The type of stream for the log message.
*
- * Since: 3.26
+ * Since: 3.32
*/
typedef enum
{
@@ -59,7 +57,7 @@ typedef enum
*
* Describes the style of movement that should be performed by the debugger.
*
- * Since: 3.26
+ * Since: 3.32
*/
typedef enum
{
@@ -82,6 +80,8 @@ typedef enum
* received a death signal.
*
* Represents the reason a process has stopped executing in the debugger.
+ *
+ * Since: 3.32
*/
typedef enum
{
@@ -119,6 +119,8 @@ typedef enum
* specification matching.
*
* The type of breakpoint.
+ *
+ * Since: 3.32
*/
typedef enum
{
@@ -137,6 +139,8 @@ typedef enum
* @IDE_DEBUGGER_BREAKPOINT_CHANGE_ENABLED: change the enabled state
*
* Describes the type of modification to perform on a breakpoint.
+ *
+ * Since: 3.32
*/
typedef enum
{
@@ -160,6 +164,8 @@ typedef enum
*
* The disposition determines what should happen to the breakpoint at the next
* stop of the debugger.
+ *
+ * Since: 3.32
*/
typedef enum
{
diff --git a/src/libide/debugger/ide-debugger-variable.c b/src/libide/debugger/ide-debugger-variable.c
index afccb75e6..54c09d2ec 100644
--- a/src/libide/debugger/ide-debugger-variable.c
+++ b/src/libide/debugger/ide-debugger-variable.c
@@ -22,7 +22,7 @@
#include "config.h"
-#include "debugger/ide-debugger-variable.h"
+#include "ide-debugger-variable.h"
typedef struct
{
diff --git a/src/libide/debugger/ide-debugger-variable.h b/src/libide/debugger/ide-debugger-variable.h
index 560ed8931..8344dc4e3 100644
--- a/src/libide/debugger/ide-debugger-variable.h
+++ b/src/libide/debugger/ide-debugger-variable.h
@@ -20,9 +20,7 @@
#pragma once
-#include <gio/gio.h>
-
-#include "ide-version-macros.h"
+#include <libide-core.h>
G_BEGIN_DECLS
diff --git a/src/libide/debugger/ide-debugger.c b/src/libide/debugger/ide-debugger.c
index 75bf6b397..712e354b0 100644
--- a/src/libide/debugger/ide-debugger.c
+++ b/src/libide/debugger/ide-debugger.c
@@ -22,9 +22,9 @@
#include "config.h"
-#include "debugger/ide-debugger.h"
-#include "debugger/ide-debugger-address-map.h"
-#include "debugger/ide-debugger-private.h"
+#include "ide-debugger.h"
+#include "ide-debugger-address-map-private.h"
+#include "ide-debugger-private.h"
/**
* SECTION:ide-debugger
diff --git a/src/libide/debugger/ide-debugger.h b/src/libide/debugger/ide-debugger.h
index 2f3029938..ba301c1e6 100644
--- a/src/libide/debugger/ide-debugger.h
+++ b/src/libide/debugger/ide-debugger.h
@@ -20,22 +20,19 @@
#pragma once
-#include <gio/gio.h>
+#include <libide-core.h>
+#include <libide-code.h>
+#include <libide-foundry.h>
-#include "ide-version-macros.h"
-
-#include "ide-object.h"
-
-#include "debugger/ide-debugger-breakpoint.h"
-#include "debugger/ide-debugger-frame.h"
-#include "debugger/ide-debugger-instruction.h"
-#include "debugger/ide-debugger-library.h"
-#include "debugger/ide-debugger-register.h"
-#include "debugger/ide-debugger-thread-group.h"
-#include "debugger/ide-debugger-thread.h"
-#include "debugger/ide-debugger-types.h"
-#include "debugger/ide-debugger-variable.h"
-#include "runner/ide-runner.h"
+#include "ide-debugger-breakpoint.h"
+#include "ide-debugger-frame.h"
+#include "ide-debugger-instruction.h"
+#include "ide-debugger-library.h"
+#include "ide-debugger-register.h"
+#include "ide-debugger-thread-group.h"
+#include "ide-debugger-thread.h"
+#include "ide-debugger-types.h"
+#include "ide-debugger-variable.h"
G_BEGIN_DECLS
diff --git a/src/libide/debugger/libide-debugger.h b/src/libide/debugger/libide-debugger.h
new file mode 100644
index 000000000..df7f9ed86
--- /dev/null
+++ b/src/libide/debugger/libide-debugger.h
@@ -0,0 +1,44 @@
+/* libide-debugger.h
+ *
+ * Copyright 2018-2019 Christian Hergert <chergert redhat com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ */
+
+#pragma once
+
+#include <libide-core.h>
+
+G_BEGIN_DECLS
+
+#define IDE_DEBUGGER_INSIDE
+
+#include "ide-debugger-breakpoint.h"
+#include "ide-debugger-breakpoints.h"
+#include "ide-debugger-frame.h"
+#include "ide-debugger-instruction.h"
+#include "ide-debugger-library.h"
+#include "ide-debugger-register.h"
+#include "ide-debugger-thread-group.h"
+#include "ide-debugger-thread.h"
+#include "ide-debugger-types.h"
+#include "ide-debugger-variable.h"
+#include "ide-debugger.h"
+#include "ide-debug-manager.h"
+
+#undef IDE_DEBUGGER_INSIDE
+
+G_END_DECLS
diff --git a/src/libide/debugger/meson.build b/src/libide/debugger/meson.build
index 33b333109..dffca20ca 100644
--- a/src/libide/debugger/meson.build
+++ b/src/libide/debugger/meson.build
@@ -1,6 +1,14 @@
-debugger_headers = [
+libide_debugger_header_subdir = join_paths(libide_header_subdir, 'debugger')
+libide_include_directories += include_directories('.')
+
+libide_debugger_generated_headers = []
+
+#
+# Public API Headers
+#
+
+libide_debugger_public_headers = [
'ide-debug-manager.h',
- 'ide-debugger.h',
'ide-debugger-breakpoint.h',
'ide-debugger-breakpoints.h',
'ide-debugger-frame.h',
@@ -11,11 +19,24 @@ debugger_headers = [
'ide-debugger-thread.h',
'ide-debugger-types.h',
'ide-debugger-variable.h',
+ 'ide-debugger.h',
+ 'libide-debugger.h',
]
-debugger_sources = [
+libide_debugger_private_headers = [
+ 'ide-debugger-address-map-private.h',
+ 'ide-debugger-private.h',
+]
+
+install_headers(libide_debugger_public_headers, subdir: libide_debugger_header_subdir)
+
+#
+# Sources
+#
+
+libide_debugger_public_sources = [
'ide-debug-manager.c',
- 'ide-debugger.c',
+ 'ide-debugger-address-map.c',
'ide-debugger-breakpoint.c',
'ide-debugger-breakpoints.c',
'ide-debugger-frame.c',
@@ -26,39 +47,49 @@ debugger_sources = [
'ide-debugger-thread.c',
'ide-debugger-types.c',
'ide-debugger-variable.c',
+ 'ide-debugger.c',
]
-# .h files used for gtk-doc ignores
-debugger_private_sources = [
- 'ide-debugger-actions.c',
- 'ide-debugger-address-map.c',
- 'ide-debugger-address-map.h',
- 'ide-debugger-breakpoints-view.c',
- 'ide-debugger-breakpoints-view.h',
- 'ide-debugger-controls.c',
- 'ide-debugger-controls.h',
- 'ide-debugger-disassembly-view.c',
- 'ide-debugger-disassembly-view.h',
- 'ide-debugger-editor-addin.c',
- 'ide-debugger-editor-addin.h',
+libide_debugger_private_sources = [
'ide-debugger-fallbacks.c',
- 'ide-debugger-hover-controls.c',
- 'ide-debugger-hover-controls.h',
- 'ide-debugger-hover-provider.c',
- 'ide-debugger-hover-provider.h',
- 'ide-debugger-libraries-view.c',
- 'ide-debugger-libraries-view.h',
- 'ide-debugger-locals-view.c',
- 'ide-debugger-locals-view.h',
- 'ide-debugger-plugin.c',
- 'ide-debugger-registers-view.c',
- 'ide-debugger-registers-view.h',
- 'ide-debugger-threads-view.c',
- 'ide-debugger-threads-view.h',
+ 'ide-debugger-actions.c',
+]
+
+#
+# Dependencies
+#
+
+libide_debugger_deps = [
+ libgio_dep,
+ libgtk_dep,
+ libdazzle_dep,
+
+ libide_core_dep,
+ libide_io_dep,
+ libide_threading_dep,
+ libide_code_dep,
+ libide_foundry_dep,
]
-libide_public_headers += files(debugger_headers)
-libide_public_sources += files(debugger_sources)
-libide_private_sources += files(debugger_private_sources)
+#
+# Library Definitions
+#
+
+libide_debugger = static_library('ide-debugger-' + libide_api_version,
+ libide_debugger_public_sources + libide_debugger_private_sources,
+ dependencies: libide_debugger_deps,
+ c_args: libide_args + release_args + ['-DIDE_DEBUGGER_COMPILATION'],
+)
+
+libide_debugger_dep = declare_dependency(
+ sources: libide_debugger_private_headers + libide_debugger_generated_headers,
+ dependencies: libide_debugger_deps,
+ link_whole: libide_debugger,
+ include_directories: include_directories('.'),
+)
-install_headers(debugger_headers, subdir: join_paths(libide_header_subdir, 'debugger'))
+gnome_builder_public_sources += files(libide_debugger_public_sources)
+gnome_builder_public_headers += files(libide_debugger_public_headers)
+gnome_builder_generated_headers += libide_debugger_generated_headers
+gnome_builder_include_subdirs += libide_debugger_header_subdir
+gnome_builder_gir_extra_args += ['--c-include=libide-debugger.h', '-DIDE_DEBUGGER_COMPILATION']
diff --git a/src/libide/debugger/ide-debugger-plugin.c b/src/plugins/debuggerui/debuggerui-plugin.c
similarity index 72%
rename from src/libide/debugger/ide-debugger-plugin.c
rename to src/plugins/debuggerui/debuggerui-plugin.c
index 0c92609a2..e240b614c 100644
--- a/src/libide/debugger/ide-debugger-plugin.c
+++ b/src/plugins/debuggerui/debuggerui-plugin.c
@@ -1,6 +1,6 @@
-/* ide-debugger-plugin.c
+/* debuggerui-plugin.c
*
- * Copyright 2017-2019 Christian Hergert <chergert redhat com>
+ * Copyright 2015-2019 Christian Hergert <chergert redhat com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -18,20 +18,20 @@
* SPDX-License-Identifier: GPL-3.0-or-later
*/
-#define G_LOG_DOMAIN "ide-debugger-plugin"
+#define G_LOG_DOMAIN "debuggerui-plugin"
#include "config.h"
-#include "object-modules.h"
+#include <libide-debugger.h>
+#include <libide-editor.h>
+#include <libide-gui.h>
+#include <libpeas/peas.h>
-#include "debugger/ide-debugger-editor-addin.h"
-#include "debugger/ide-debugger-hover-provider.h"
-#include "editor/ide-editor-addin.h"
-#include "editor/ide-editor-view-addin.h"
-#include "hover/ide-hover-provider.h"
+#include "ide-debugger-editor-addin.h"
+#include "ide-debugger-hover-provider.h"
void
-ide_debugger_register_types (PeasObjectModule *module)
+_gbp_debuggerui_register_types (PeasObjectModule *module)
{
peas_object_module_register_extension_type (module,
IDE_TYPE_EDITOR_ADDIN,
diff --git a/src/plugins/debuggerui/debuggerui.gresource.xml b/src/plugins/debuggerui/debuggerui.gresource.xml
new file mode 100644
index 000000000..609951f2c
--- /dev/null
+++ b/src/plugins/debuggerui/debuggerui.gresource.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<gresources>
+ <gresource prefix="/plugins/debuggerui">
+ <file>debuggerui.plugin</file>
+ <file>gtk/menus.ui</file>
+ <file preprocess="xml-stripblanks">ide-debugger-breakpoints-view.ui</file>
+ <file preprocess="xml-stripblanks">ide-debugger-controls.ui</file>
+ <file preprocess="xml-stripblanks">ide-debugger-disassembly-view.ui</file>
+ <file preprocess="xml-stripblanks">ide-debugger-hover-controls.ui</file>
+ <file preprocess="xml-stripblanks">ide-debugger-libraries-view.ui</file>
+ <file preprocess="xml-stripblanks">ide-debugger-locals-view.ui</file>
+ <file preprocess="xml-stripblanks">ide-debugger-registers-view.ui</file>
+ <file preprocess="xml-stripblanks">ide-debugger-threads-view.ui</file>
+ </gresource>
+</gresources>
diff --git a/src/plugins/debuggerui/debuggerui.plugin b/src/plugins/debuggerui/debuggerui.plugin
new file mode 100644
index 000000000..1e51808ad
--- /dev/null
+++ b/src/plugins/debuggerui/debuggerui.plugin
@@ -0,0 +1,11 @@
+[Plugin]
+Authors=Christian Hergert <christian hergert me>
+Builtin=true
+Copyright=Copyright © 2014-2018 Christian Hergert
+Depends=editor;buildui;
+Description=Builder's visual debugger
+Embedded=_gbp_debuggerui_register_types
+Hidden=true
+Module=debuggerui
+Name=Debugger
+X-Workspace-Kind=primary;
diff --git a/src/libide/debugger/gtk/menus.ui b/src/plugins/debuggerui/gtk/menus.ui
similarity index 58%
rename from src/libide/debugger/gtk/menus.ui
rename to src/plugins/debuggerui/gtk/menus.ui
index 332fc237b..bde153012 100644
--- a/src/libide/debugger/gtk/menus.ui
+++ b/src/plugins/debuggerui/gtk/menus.ui
@@ -13,4 +13,14 @@
</item>
</section>
</menu>
+ <menu id="project-tree-run-with-submenu">
+ <section id="project-tree-menu-run-with-section">
+ <item>
+ <attribute name="id">project-tree-menu-debug</attribute>
+ <attribute name="label" translatable="yes">Run with Debugger</attribute>
+ <attribute name="action">buildui.run-with-handler</attribute>
+ <attribute name="target" type="s">'debugger'</attribute>
+ </item>
+ </section>
+ </menu>
</interface>
diff --git a/src/libide/debugger/ide-debugger-breakpoints-view.c
b/src/plugins/debuggerui/ide-debugger-breakpoints-view.c
similarity index 99%
rename from src/libide/debugger/ide-debugger-breakpoints-view.c
rename to src/plugins/debuggerui/ide-debugger-breakpoints-view.c
index 28b09fd6c..2a8da522e 100644
--- a/src/libide/debugger/ide-debugger-breakpoints-view.c
+++ b/src/plugins/debuggerui/ide-debugger-breakpoints-view.c
@@ -24,7 +24,7 @@
#include <dazzle.h>
-#include "debugger/ide-debugger-breakpoints-view.h"
+#include "ide-debugger-breakpoints-view.h"
struct _IdeDebuggerBreakpointsView
{
@@ -440,7 +440,7 @@ ide_debugger_breakpoints_view_class_init (IdeDebuggerBreakpointsViewClass *klass
g_object_class_install_properties (object_class, N_PROPS, properties);
- gtk_widget_class_set_template_from_resource (widget_class,
"/org/gnome/builder/ui/ide-debugger-breakpoints-view.ui");
+ gtk_widget_class_set_template_from_resource (widget_class,
"/plugins/debuggerui/ide-debugger-breakpoints-view.ui");
gtk_widget_class_bind_template_child (widget_class, IdeDebuggerBreakpointsView, address_cell);
gtk_widget_class_bind_template_child (widget_class, IdeDebuggerBreakpointsView, address_column);
gtk_widget_class_bind_template_child (widget_class, IdeDebuggerBreakpointsView, hits_cell);
diff --git a/src/libide/debugger/ide-debugger-breakpoints-view.h
b/src/plugins/debuggerui/ide-debugger-breakpoints-view.h
similarity index 97%
rename from src/libide/debugger/ide-debugger-breakpoints-view.h
rename to src/plugins/debuggerui/ide-debugger-breakpoints-view.h
index 86ca0348e..883475b79 100644
--- a/src/libide/debugger/ide-debugger-breakpoints-view.h
+++ b/src/plugins/debuggerui/ide-debugger-breakpoints-view.h
@@ -22,7 +22,7 @@
#include <gtk/gtk.h>
-#include "debugger/ide-debugger.h"
+#include "ide-debugger.h"
G_BEGIN_DECLS
diff --git a/src/libide/debugger/ide-debugger-breakpoints-view.ui
b/src/plugins/debuggerui/ide-debugger-breakpoints-view.ui
similarity index 100%
rename from src/libide/debugger/ide-debugger-breakpoints-view.ui
rename to src/plugins/debuggerui/ide-debugger-breakpoints-view.ui
diff --git a/src/libide/debugger/ide-debugger-controls.c b/src/plugins/debuggerui/ide-debugger-controls.c
similarity index 89%
rename from src/libide/debugger/ide-debugger-controls.c
rename to src/plugins/debuggerui/ide-debugger-controls.c
index 1d757304f..331f37536 100644
--- a/src/libide/debugger/ide-debugger-controls.c
+++ b/src/plugins/debuggerui/ide-debugger-controls.c
@@ -18,7 +18,7 @@
* SPDX-License-Identifier: GPL-3.0-or-later
*/
-#include "debugger/ide-debugger-controls.h"
+#include "ide-debugger-controls.h"
struct _IdeDebuggerControls
{
@@ -32,7 +32,7 @@ ide_debugger_controls_class_init (IdeDebuggerControlsClass *klass)
{
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
- gtk_widget_class_set_template_from_resource (widget_class,
"/org/gnome/builder/ui/ide-debugger-controls.ui");
+ gtk_widget_class_set_template_from_resource (widget_class, "/plugins/debuggerui/ide-debugger-controls.ui");
gtk_widget_class_set_css_name (widget_class, "idedebuggercontrols");
}
diff --git a/src/libide/debugger/ide-debugger-controls.h b/src/plugins/debuggerui/ide-debugger-controls.h
similarity index 95%
rename from src/libide/debugger/ide-debugger-controls.h
rename to src/plugins/debuggerui/ide-debugger-controls.h
index 76a3f833f..eaff84473 100644
--- a/src/libide/debugger/ide-debugger-controls.h
+++ b/src/plugins/debuggerui/ide-debugger-controls.h
@@ -22,9 +22,7 @@
#include <gtk/gtk.h>
-#include "ide-types.h"
-
-#include "debugger/ide-debugger.h"
+#include "ide-debugger.h"
G_BEGIN_DECLS
diff --git a/src/libide/debugger/ide-debugger-controls.ui b/src/plugins/debuggerui/ide-debugger-controls.ui
similarity index 100%
rename from src/libide/debugger/ide-debugger-controls.ui
rename to src/plugins/debuggerui/ide-debugger-controls.ui
diff --git a/src/libide/debugger/ide-debugger-disassembly-view.c
b/src/plugins/debuggerui/ide-debugger-disassembly-view.c
similarity index 93%
rename from src/libide/debugger/ide-debugger-disassembly-view.c
rename to src/plugins/debuggerui/ide-debugger-disassembly-view.c
index b4bdae5f0..433b2ba63 100644
--- a/src/libide/debugger/ide-debugger-disassembly-view.c
+++ b/src/plugins/debuggerui/ide-debugger-disassembly-view.c
@@ -22,14 +22,14 @@
#include "config.h"
-#include <gtksourceview/gtksource.h>
+#include <libide-sourceview.h>
-#include "debugger/ide-debugger-disassembly-view.h"
-#include "debugger/ide-debugger-instruction.h"
+#include "ide-debugger-disassembly-view.h"
+#include "ide-debugger-instruction.h"
struct _IdeDebuggerDisassemblyView
{
- IdeLayoutView parent_instance;
+ IdePage parent_instance;
/* Owned references */
GPtrArray *instructions;
@@ -41,7 +41,7 @@ struct _IdeDebuggerDisassemblyView
IdeDebuggerAddress current_address;
};
-G_DEFINE_TYPE (IdeDebuggerDisassemblyView, ide_debugger_disassembly_view, IDE_TYPE_LAYOUT_VIEW)
+G_DEFINE_TYPE (IdeDebuggerDisassemblyView, ide_debugger_disassembly_view, IDE_TYPE_PAGE)
static void
ide_debugger_disassembly_view_destroy (GtkWidget *widget)
@@ -60,7 +60,7 @@ ide_debugger_disassembly_view_class_init (IdeDebuggerDisassemblyViewClass *klass
widget_class->destroy = ide_debugger_disassembly_view_destroy;
- gtk_widget_class_set_template_from_resource (widget_class,
"/org/gnome/builder/ui/ide-debugger-disassembly-view.ui");
+ gtk_widget_class_set_template_from_resource (widget_class,
"/plugins/debuggerui/ide-debugger-disassembly-view.ui");
gtk_widget_class_bind_template_child (widget_class, IdeDebuggerDisassemblyView, source_buffer);
gtk_widget_class_bind_template_child (widget_class, IdeDebuggerDisassemblyView, source_view);
}
diff --git a/src/libide/debugger/ide-debugger-disassembly-view.h
b/src/plugins/debuggerui/ide-debugger-disassembly-view.h
similarity index 89%
rename from src/libide/debugger/ide-debugger-disassembly-view.h
rename to src/plugins/debuggerui/ide-debugger-disassembly-view.h
index 82d0dcf95..ed67230f3 100644
--- a/src/libide/debugger/ide-debugger-disassembly-view.h
+++ b/src/plugins/debuggerui/ide-debugger-disassembly-view.h
@@ -20,16 +20,15 @@
#pragma once
-#include <gtk/gtk.h>
+#include <libide-gui.h>
-#include "debugger/ide-debugger-types.h"
-#include "layout/ide-layout-view.h"
+#include "ide-debugger-types.h"
G_BEGIN_DECLS
#define IDE_TYPE_DEBUGGER_DISASSEMBLY_VIEW (ide_debugger_disassembly_view_get_type())
-G_DECLARE_FINAL_TYPE (IdeDebuggerDisassemblyView, ide_debugger_disassembly_view, IDE,
DEBUGGER_DISASSEMBLY_VIEW, IdeLayoutView)
+G_DECLARE_FINAL_TYPE (IdeDebuggerDisassemblyView, ide_debugger_disassembly_view, IDE,
DEBUGGER_DISASSEMBLY_VIEW, IdePage)
void ide_debugger_disassembly_view_set_current_address (IdeDebuggerDisassemblyView *self,
IdeDebuggerAddress address);
diff --git a/src/libide/debugger/ide-debugger-disassembly-view.ui
b/src/plugins/debuggerui/ide-debugger-disassembly-view.ui
similarity index 92%
rename from src/libide/debugger/ide-debugger-disassembly-view.ui
rename to src/plugins/debuggerui/ide-debugger-disassembly-view.ui
index f84cee025..2cd579636 100644
--- a/src/libide/debugger/ide-debugger-disassembly-view.ui
+++ b/src/plugins/debuggerui/ide-debugger-disassembly-view.ui
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
- <template class="IdeDebuggerDisassemblyView" parent="IdeLayoutView">
+ <template class="IdeDebuggerDisassemblyView" parent="IdePage">
<property name="icon-name">application-x-executable-symbolic</property>
<property name="title" translatable="yes">Disassembly</property>
<child>
diff --git a/src/libide/debugger/ide-debugger-editor-addin.c
b/src/plugins/debuggerui/ide-debugger-editor-addin.c
similarity index 84%
rename from src/libide/debugger/ide-debugger-editor-addin.c
rename to src/plugins/debuggerui/ide-debugger-editor-addin.c
index bc36275d5..ecedc93ae 100644
--- a/src/libide/debugger/ide-debugger-editor-addin.c
+++ b/src/plugins/debuggerui/ide-debugger-editor-addin.c
@@ -22,28 +22,24 @@
#include "config.h"
+#include <libide-code.h>
+#include <libide-core.h>
+#include <libide-debugger.h>
+#include <libide-editor.h>
+#include <libide-foundry.h>
+#include <libide-gui.h>
+#include <libide-io.h>
+#include <libide-terminal.h>
#include <glib/gi18n.h>
-#include "ide-context.h"
-#include "ide-debug.h"
-
-#include "debugger/ide-debug-manager.h"
-#include "debugger/ide-debugger-breakpoints-view.h"
-#include "debugger/ide-debugger-controls.h"
-#include "debugger/ide-debugger-disassembly-view.h"
-#include "debugger/ide-debugger-editor-addin.h"
-#include "debugger/ide-debugger-libraries-view.h"
-#include "debugger/ide-debugger-locals-view.h"
-#include "debugger/ide-debugger-registers-view.h"
-#include "debugger/ide-debugger-threads-view.h"
-#include "editor/ide-editor-addin.h"
-#include "files/ide-file.h"
-#include "runner/ide-run-manager.h"
-#include "terminal/ide-terminal.h"
-#include "workbench/ide-workbench.h"
-#include "workbench/ide-workbench-message.h"
-#include "util/ide-line-reader.h"
-#include "util/ide-gtk.h"
+#include "ide-debugger-breakpoints-view.h"
+#include "ide-debugger-controls.h"
+#include "ide-debugger-disassembly-view.h"
+#include "ide-debugger-editor-addin.h"
+#include "ide-debugger-libraries-view.h"
+#include "ide-debugger-locals-view.h"
+#include "ide-debugger-registers-view.h"
+#include "ide-debugger-threads-view.h"
/**
* SECTION:ide-debugger-editor-addin
@@ -64,7 +60,7 @@ struct _IdeDebuggerEditorAddin
DzlSignalGroup *debug_manager_signals;
DzlSignalGroup *debugger_signals;
- IdeEditorPerspective *editor;
+ IdeEditorSurface *editor;
IdeWorkbench *workbench;
IdeDebuggerDisassemblyView *disassembly_view;
@@ -72,7 +68,6 @@ struct _IdeDebuggerEditorAddin
IdeDebuggerBreakpointsView *breakpoints_view;
IdeDebuggerLibrariesView *libraries_view;
IdeDebuggerLocalsView *locals_view;
- IdeWorkbenchMessage *message;
DzlDockWidget *panel;
IdeDebuggerRegistersView *registers_view;
IdeDebuggerThreadsView *threads_view;
@@ -138,6 +133,35 @@ debugger_stopped (IdeDebuggerEditorAddin *self,
IDE_EXIT;
}
+static void
+send_notification (IdeDebuggerEditorAddin *self,
+ const gchar *title,
+ const gchar *body,
+ const gchar *icon_name,
+ gboolean urgent)
+{
+ g_autoptr(IdeNotification) notif = NULL;
+ g_autoptr(GIcon) icon = NULL;
+ IdeContext *context;
+
+ g_assert (IDE_IS_DEBUGGER_EDITOR_ADDIN (self));
+
+ context = ide_workbench_get_context (self->workbench);
+
+ if (icon_name)
+ icon = g_themed_icon_new (icon_name);
+
+ notif = g_object_new (IDE_TYPE_NOTIFICATION,
+ "has-progress", FALSE,
+ "icon", icon,
+ "title", title,
+ "body", body,
+ "urgent", TRUE,
+ NULL);
+ ide_notification_attach (notif, IDE_OBJECT (context));
+ ide_notification_withdraw_in_seconds (notif, 30);
+}
+
static void
debugger_run_handler (IdeRunManager *run_manager,
IdeRunner *runner,
@@ -159,13 +183,14 @@ debugger_run_handler (IdeRunManager *run_manager,
* It might need to prepend arguments like `gdb', `pdb', `mdb', etc.
*/
context = ide_object_get_context (IDE_OBJECT (run_manager));
- debug_manager = ide_context_get_debug_manager (context);
+ debug_manager = ide_debug_manager_from_context (context);
if (!ide_debug_manager_start (debug_manager, runner, &error))
- {
- ide_workbench_message_set_subtitle (self->message, error->message);
- gtk_widget_show (GTK_WIDGET (self->message));
- }
+ send_notification (self,
+ _("Failed to start the debugger"),
+ error->message,
+ "computer-fail-symbolic",
+ TRUE);
IDE_EXIT;
}
@@ -176,6 +201,7 @@ debug_manager_notify_debugger (IdeDebuggerEditorAddin *self,
IdeDebugManager *debug_manager)
{
IdeDebugger *debugger;
+ IdeWorkspace *workspace;
g_assert (IDE_IS_DEBUGGER_EDITOR_ADDIN (self));
g_assert (IDE_IS_DEBUG_MANAGER (debug_manager));
@@ -192,9 +218,10 @@ debug_manager_notify_debugger (IdeDebuggerEditorAddin *self,
debugger = ide_debug_manager_get_debugger (debug_manager);
- gtk_widget_insert_action_group (GTK_WIDGET (self->workbench),
- "debugger",
- G_ACTION_GROUP (debugger));
+ if ((workspace = ide_widget_get_workspace (GTK_WIDGET (self->editor))))
+ gtk_widget_insert_action_group (GTK_WIDGET (workspace),
+ "debugger",
+ G_ACTION_GROUP (debugger));
ide_debugger_breakpoints_view_set_debugger (self->breakpoints_view, debugger);
ide_debugger_locals_view_set_debugger (self->locals_view, debugger);
@@ -257,11 +284,13 @@ on_frame_activated (IdeDebuggerEditorAddin *self,
if (path != NULL)
{
- g_autoptr(IdeSourceLocation) location = NULL;
IdeContext *context = ide_widget_get_context (GTK_WIDGET (threads_view));
+ g_autoptr(IdeLocation) location = NULL;
+ g_autofree gchar *project_path = ide_context_build_filename (context, path, NULL);
+ g_autoptr(GFile) file = g_file_new_for_path (project_path);
- location = ide_source_location_new_for_path (context, path, line, 0);
- ide_editor_perspective_focus_location (self->editor, location);
+ location = ide_location_new (file, line, -1);
+ ide_editor_surface_focus_location (self->editor, location);
IDE_EXIT;
}
@@ -282,7 +311,6 @@ on_frame_activated (IdeDebuggerEditorAddin *self,
static void
ide_debugger_editor_addin_add_ui (IdeDebuggerEditorAddin *self)
{
- IdeWorkbench *workbench;
GtkWidget *scroll_box;
GtkWidget *box;
GtkWidget *hpaned;
@@ -290,13 +318,12 @@ ide_debugger_editor_addin_add_ui (IdeDebuggerEditorAddin *self)
GtkWidget *overlay;
g_assert (IDE_IS_DEBUGGER_EDITOR_ADDIN (self));
- g_assert (IDE_IS_EDITOR_PERSPECTIVE (self->editor));
+ g_assert (IDE_IS_EDITOR_SURFACE (self->editor));
#define OBSERVE_DESTROY(ptr) \
g_signal_connect ((ptr), "destroy", G_CALLBACK (gtk_widget_destroyed), &(ptr))
- workbench = ide_widget_get_workbench (GTK_WIDGET (self->editor));
- overlay = ide_editor_perspective_get_overlay (self->editor);
+ overlay = ide_editor_surface_get_overlay (self->editor);
self->controls = g_object_new (IDE_TYPE_DEBUGGER_CONTROLS,
"transition-duration", 500,
@@ -393,23 +420,15 @@ ide_debugger_editor_addin_add_ui (IdeDebuggerEditorAddin *self)
NULL);
gtk_container_add (GTK_CONTAINER (scroll_box), GTK_WIDGET (self->log_view_scroller));
- utilities = ide_editor_perspective_get_utilities (self->editor);
+ utilities = ide_editor_surface_get_utilities (self->editor);
gtk_container_add (GTK_CONTAINER (utilities), GTK_WIDGET (self->panel));
- self->message = g_object_new (IDE_TYPE_WORKBENCH_MESSAGE,
- "id", "org.gnome.builder.debugger.failure",
- "show-close-button", TRUE,
- "title", _("Failed to initialize the debugger"),
- NULL);
- OBSERVE_DESTROY (self->message);
- ide_workbench_push_message (workbench, self->message);
-
#undef OBSERVE_DESTROY
}
static void
-ide_debugger_editor_addin_load (IdeEditorAddin *addin,
- IdeEditorPerspective *editor)
+ide_debugger_editor_addin_load (IdeEditorAddin *addin,
+ IdeEditorSurface *editor)
{
IdeDebuggerEditorAddin *self = (IdeDebuggerEditorAddin *)addin;
IdeContext *context;
@@ -419,14 +438,17 @@ ide_debugger_editor_addin_load (IdeEditorAddin *addin,
IDE_ENTRY;
g_assert (IDE_IS_DEBUGGER_EDITOR_ADDIN (self));
- g_assert (IDE_IS_EDITOR_PERSPECTIVE (editor));
+ g_assert (IDE_IS_EDITOR_SURFACE (editor));
self->editor = editor;
self->workbench = ide_widget_get_workbench (GTK_WIDGET (editor));
+ if (!ide_workbench_has_project (self->workbench))
+ return;
+
context = ide_widget_get_context (GTK_WIDGET (editor));
- run_manager = ide_context_get_run_manager (context);
- debug_manager = ide_context_get_debug_manager (context);
+ run_manager = ide_run_manager_from_context (context);
+ debug_manager = ide_debug_manager_from_context (context);
ide_debugger_editor_addin_add_ui (self);
@@ -469,22 +491,27 @@ ide_debugger_editor_addin_load (IdeEditorAddin *addin,
}
static void
-ide_debugger_editor_addin_unload (IdeEditorAddin *addin,
- IdeEditorPerspective *editor)
+ide_debugger_editor_addin_unload (IdeEditorAddin *addin,
+ IdeEditorSurface *editor)
{
IdeDebuggerEditorAddin *self = (IdeDebuggerEditorAddin *)addin;
IdeRunManager *run_manager;
+ IdeWorkspace *workspace;
IdeContext *context;
IDE_ENTRY;
g_assert (IDE_IS_DEBUGGER_EDITOR_ADDIN (self));
- g_assert (IDE_IS_EDITOR_PERSPECTIVE (editor));
+ g_assert (IDE_IS_EDITOR_SURFACE (editor));
+
+ if (!ide_workbench_has_project (self->workbench))
+ return;
context = ide_workbench_get_context (self->workbench);
- run_manager = ide_context_get_run_manager (context);
+ run_manager = ide_run_manager_from_context (context);
- gtk_widget_insert_action_group (GTK_WIDGET (self->workbench), "debugger", NULL);
+ if ((workspace = ide_widget_get_workspace (GTK_WIDGET (editor))))
+ gtk_widget_insert_action_group (GTK_WIDGET (workspace), "debugger", NULL);
/* Remove the handler to initiate the debugger */
ide_run_manager_remove_handler (run_manager, "debugger");
@@ -496,8 +523,6 @@ ide_debugger_editor_addin_unload (IdeEditorAddin *addin,
gtk_widget_destroy (GTK_WIDGET (self->panel));
if (self->controls != NULL)
gtk_widget_destroy (GTK_WIDGET (self->controls));
- if (self->message != NULL)
- gtk_widget_destroy (GTK_WIDGET (self->message));
if (self->disassembly_view != NULL)
gtk_widget_destroy (GTK_WIDGET (self->disassembly_view));
@@ -532,18 +557,14 @@ ide_debugger_editor_addin_navigate_to_file (IdeDebuggerEditorAddin *self,
GFile *file,
guint line)
{
- g_autoptr(IdeSourceLocation) location = NULL;
- g_autoptr(IdeFile) ifile = NULL;
- IdeContext *context;
+ g_autoptr(IdeLocation) location = NULL;
g_return_if_fail (IDE_IS_DEBUGGER_EDITOR_ADDIN (self));
g_return_if_fail (G_IS_FILE (file));
- context = ide_widget_get_context (GTK_WIDGET (self->editor));
- ifile = ide_file_new (context, file);
- location = ide_source_location_new (ifile, line, 0, 0);
+ location = ide_location_new (file, line, -1);
- ide_editor_perspective_focus_location (self->editor, location);
+ ide_editor_surface_focus_location (self->editor, location);
}
static void
@@ -576,7 +597,7 @@ ide_debugger_editor_addin_disassemble_cb (GObject *object,
if (self->disassembly_view == NULL)
{
- IdeLayoutGrid *grid = ide_editor_perspective_get_grid (self->editor);
+ IdeGrid *grid = ide_editor_surface_get_grid (self->editor);
self->disassembly_view = g_object_new (IDE_TYPE_DEBUGGER_DISASSEMBLY_VIEW,
"visible", TRUE,
@@ -593,10 +614,10 @@ ide_debugger_editor_addin_disassemble_cb (GObject *object,
/* TODO: Set current instruction */
/* FIXME: It would be nice if we had a nicer API for this */
- stack = gtk_widget_get_ancestor (GTK_WIDGET (self->disassembly_view), IDE_TYPE_LAYOUT_STACK);
+ stack = gtk_widget_get_ancestor (GTK_WIDGET (self->disassembly_view), IDE_TYPE_FRAME);
if (stack != NULL)
- ide_layout_stack_set_visible_child (IDE_LAYOUT_STACK (stack),
- IDE_LAYOUT_VIEW (self->disassembly_view));
+ ide_frame_set_visible_child (IDE_FRAME (stack),
+ IDE_PAGE (self->disassembly_view));
IDE_EXIT;
}
diff --git a/src/libide/debugger/ide-debugger-editor-addin.h
b/src/plugins/debuggerui/ide-debugger-editor-addin.h
similarity index 95%
rename from src/libide/debugger/ide-debugger-editor-addin.h
rename to src/plugins/debuggerui/ide-debugger-editor-addin.h
index e62a0a40a..b9fe3455f 100644
--- a/src/libide/debugger/ide-debugger-editor-addin.h
+++ b/src/plugins/debuggerui/ide-debugger-editor-addin.h
@@ -20,8 +20,7 @@
#pragma once
-#include "debugger/ide-debugger-breakpoint.h"
-#include "editor/ide-editor-addin.h"
+#include <libide-debugger.h>
G_BEGIN_DECLS
diff --git a/src/libide/debugger/ide-debugger-hover-controls.c
b/src/plugins/debuggerui/ide-debugger-hover-controls.c
similarity index 95%
rename from src/libide/debugger/ide-debugger-hover-controls.c
rename to src/plugins/debuggerui/ide-debugger-hover-controls.c
index 4131b26a2..2a0c8bfe3 100644
--- a/src/libide/debugger/ide-debugger-hover-controls.c
+++ b/src/plugins/debuggerui/ide-debugger-hover-controls.c
@@ -23,12 +23,12 @@
#include "config.h"
#include <dazzle.h>
+#include <libide-debugger.h>
+#include <libide-sourceview.h>
-#include "debugger/ide-debugger-hover-controls.h"
-#include "debugger/ide-debugger-breakpoints.h"
-#include "debugger/ide-debugger-private.h"
-#include "debugger/ide-debug-manager.h"
-#include "sourceview/ide-source-view.h"
+#include "ide-debugger-hover-controls.h"
+#include "ide-debugger-breakpoints.h"
+#include "ide-debugger-private.h"
struct _IdeDebuggerHoverControls
{
@@ -63,7 +63,7 @@ ide_debugger_hover_controls_class_init (IdeDebuggerHoverControlsClass *klass)
widget_class->destroy = ide_debugger_hover_controls_destroy;
- gtk_widget_class_set_template_from_resource (widget_class,
"/org/gnome/builder/ui/ide-debugger-hover-controls.ui");
+ gtk_widget_class_set_template_from_resource (widget_class,
"/plugins/debuggerui/ide-debugger-hover-controls.ui");
gtk_widget_class_bind_template_child (widget_class, IdeDebuggerHoverControls, nobreak);
gtk_widget_class_bind_template_child (widget_class, IdeDebuggerHoverControls, breakpoint);
gtk_widget_class_bind_template_child (widget_class, IdeDebuggerHoverControls, countpoint);
diff --git a/src/libide/debugger/ide-debugger-hover-controls.h
b/src/plugins/debuggerui/ide-debugger-hover-controls.h
similarity index 96%
rename from src/libide/debugger/ide-debugger-hover-controls.h
rename to src/plugins/debuggerui/ide-debugger-hover-controls.h
index e3480fab6..c73df02e1 100644
--- a/src/libide/debugger/ide-debugger-hover-controls.h
+++ b/src/plugins/debuggerui/ide-debugger-hover-controls.h
@@ -22,7 +22,7 @@
#include <gtk/gtk.h>
-#include "debugger/ide-debug-manager.h"
+#include "ide-debug-manager.h"
G_BEGIN_DECLS
diff --git a/src/libide/debugger/ide-debugger-hover-controls.ui
b/src/plugins/debuggerui/ide-debugger-hover-controls.ui
similarity index 100%
rename from src/libide/debugger/ide-debugger-hover-controls.ui
rename to src/plugins/debuggerui/ide-debugger-hover-controls.ui
diff --git a/src/libide/debugger/ide-debugger-hover-provider.c
b/src/plugins/debuggerui/ide-debugger-hover-provider.c
similarity index 86%
rename from src/libide/debugger/ide-debugger-hover-provider.c
rename to src/plugins/debuggerui/ide-debugger-hover-provider.c
index 03b5f5a0e..45bbe19f2 100644
--- a/src/libide/debugger/ide-debugger-hover-provider.c
+++ b/src/plugins/debuggerui/ide-debugger-hover-provider.c
@@ -22,17 +22,15 @@
#include "config.h"
+#include <libide-code.h>
+#include <libide-core.h>
+#include <libide-debugger.h>
+#include <libide-sourceview.h>
+#include <libide-threading.h>
#include <glib/gi18n.h>
-#include "ide-context.h"
-
-#include "buffers/ide-buffer.h"
-#include "debugger/ide-debug-manager.h"
-#include "debugger/ide-debugger-hover-controls.h"
-#include "debugger/ide-debugger-hover-provider.h"
-#include "files/ide-file.h"
-#include "threading/ide-task.h"
-#include "util/ide-marked-content.h"
+#include "ide-debugger-hover-controls.h"
+#include "ide-debugger-hover-provider.h"
#define DEBUGGER_HOVER_PRIORITY 1000
@@ -51,12 +49,11 @@ ide_debugger_hover_provider_hover_async (IdeHoverProvider *provider,
{
IdeDebuggerHoverProvider *self = (IdeDebuggerHoverProvider *)provider;
g_autoptr(IdeTask) task = NULL;
+ g_autoptr(IdeContext) icontext = NULL;
IdeDebugManager *dbgmgr;
const gchar *lang_id;
- IdeContext *icontext;
IdeBuffer *buffer;
- IdeFile *file;
- GFile *gfile;
+ GFile *file;
guint line;
g_assert (IDE_IS_DEBUGGER_HOVER_PROVIDER (provider));
@@ -76,17 +73,16 @@ ide_debugger_hover_provider_hover_async (IdeHoverProvider *provider,
}
lang_id = ide_buffer_get_language_id (buffer);
- icontext = ide_buffer_get_context (buffer);
- dbgmgr = ide_context_get_debug_manager (icontext);
+ icontext = ide_buffer_ref_context (buffer);
+ dbgmgr = ide_debug_manager_from_context (icontext);
file = ide_buffer_get_file (buffer);
- gfile = ide_file_get_file (file);
line = gtk_text_iter_get_line (iter);
if (ide_debug_manager_supports_language (dbgmgr, lang_id))
{
GtkWidget *controls;
- controls = ide_debugger_hover_controls_new (dbgmgr, gfile, line + 1);
+ controls = ide_debugger_hover_controls_new (dbgmgr, file, line + 1);
ide_hover_context_add_widget (context, DEBUGGER_HOVER_PRIORITY, _("Debugger"), controls);
}
diff --git a/src/libide/debugger/ide-debugger-hover-provider.h
b/src/plugins/debuggerui/ide-debugger-hover-provider.h
similarity index 96%
rename from src/libide/debugger/ide-debugger-hover-provider.h
rename to src/plugins/debuggerui/ide-debugger-hover-provider.h
index a78f8304f..7e0ca3e55 100644
--- a/src/libide/debugger/ide-debugger-hover-provider.h
+++ b/src/plugins/debuggerui/ide-debugger-hover-provider.h
@@ -20,7 +20,7 @@
#pragma once
-#include "hover/ide-hover-provider.h"
+#include <libide-sourceview.h>
G_BEGIN_DECLS
diff --git a/src/libide/debugger/ide-debugger-libraries-view.c
b/src/plugins/debuggerui/ide-debugger-libraries-view.c
similarity index 98%
rename from src/libide/debugger/ide-debugger-libraries-view.c
rename to src/plugins/debuggerui/ide-debugger-libraries-view.c
index e840d134b..b0fb552f7 100644
--- a/src/libide/debugger/ide-debugger-libraries-view.c
+++ b/src/plugins/debuggerui/ide-debugger-libraries-view.c
@@ -24,7 +24,7 @@
#include <dazzle.h>
-#include "debugger/ide-debugger-libraries-view.h"
+#include "ide-debugger-libraries-view.h"
struct _IdeDebuggerLibrariesView
{
@@ -274,7 +274,7 @@ ide_debugger_libraries_view_class_init (IdeDebuggerLibrariesViewClass *klass)
g_object_class_install_properties (object_class, N_PROPS, properties);
- gtk_widget_class_set_template_from_resource (widget_class,
"/org/gnome/builder/ui/ide-debugger-libraries-view.ui");
+ gtk_widget_class_set_template_from_resource (widget_class,
"/plugins/debuggerui/ide-debugger-libraries-view.ui");
gtk_widget_class_bind_template_child (widget_class, IdeDebuggerLibrariesView, tree_view);
gtk_widget_class_bind_template_child (widget_class, IdeDebuggerLibrariesView, list_store);
gtk_widget_class_bind_template_child (widget_class, IdeDebuggerLibrariesView, target_cell);
diff --git a/src/libide/debugger/ide-debugger-libraries-view.h
b/src/plugins/debuggerui/ide-debugger-libraries-view.h
similarity index 97%
rename from src/libide/debugger/ide-debugger-libraries-view.h
rename to src/plugins/debuggerui/ide-debugger-libraries-view.h
index b71641343..797b3a521 100644
--- a/src/libide/debugger/ide-debugger-libraries-view.h
+++ b/src/plugins/debuggerui/ide-debugger-libraries-view.h
@@ -22,7 +22,7 @@
#include <gtk/gtk.h>
-#include "debugger/ide-debugger.h"
+#include "ide-debugger.h"
G_BEGIN_DECLS
diff --git a/src/libide/debugger/ide-debugger-libraries-view.ui
b/src/plugins/debuggerui/ide-debugger-libraries-view.ui
similarity index 100%
rename from src/libide/debugger/ide-debugger-libraries-view.ui
rename to src/plugins/debuggerui/ide-debugger-libraries-view.ui
diff --git a/src/libide/debugger/ide-debugger-locals-view.c
b/src/plugins/debuggerui/ide-debugger-locals-view.c
similarity index 98%
rename from src/libide/debugger/ide-debugger-locals-view.c
rename to src/plugins/debuggerui/ide-debugger-locals-view.c
index 18c02eba0..4981d1e4e 100644
--- a/src/libide/debugger/ide-debugger-locals-view.c
+++ b/src/plugins/debuggerui/ide-debugger-locals-view.c
@@ -23,11 +23,11 @@
#include "config.h"
#include <dazzle.h>
+#include <libide-core.h>
+#include <libide-threading.h>
#include <glib/gi18n.h>
-#include "debugger/ide-debugger-locals-view.h"
-#include "util/ide-glib.h"
-#include "threading/ide-task.h"
+#include "ide-debugger-locals-view.h"
struct _IdeDebuggerLocalsView
{
@@ -206,7 +206,7 @@ ide_debugger_locals_view_class_init (IdeDebuggerLocalsViewClass *klass)
g_object_class_install_properties (object_class, N_PROPS, properties);
- gtk_widget_class_set_template_from_resource (widget_class,
"/org/gnome/builder/ui/ide-debugger-locals-view.ui");
+ gtk_widget_class_set_template_from_resource (widget_class,
"/plugins/debuggerui/ide-debugger-locals-view.ui");
gtk_widget_class_bind_template_child (widget_class, IdeDebuggerLocalsView, tree_store);
gtk_widget_class_bind_template_child (widget_class, IdeDebuggerLocalsView, tree_view);
gtk_widget_class_bind_template_child (widget_class, IdeDebuggerLocalsView, type_cell);
diff --git a/src/libide/debugger/ide-debugger-locals-view.h
b/src/plugins/debuggerui/ide-debugger-locals-view.h
similarity index 98%
rename from src/libide/debugger/ide-debugger-locals-view.h
rename to src/plugins/debuggerui/ide-debugger-locals-view.h
index 084a93683..c29887f6e 100644
--- a/src/libide/debugger/ide-debugger-locals-view.h
+++ b/src/plugins/debuggerui/ide-debugger-locals-view.h
@@ -22,7 +22,7 @@
#include <gtk/gtk.h>
-#include "debugger/ide-debugger.h"
+#include "ide-debugger.h"
G_BEGIN_DECLS
diff --git a/src/libide/debugger/ide-debugger-locals-view.ui
b/src/plugins/debuggerui/ide-debugger-locals-view.ui
similarity index 100%
rename from src/libide/debugger/ide-debugger-locals-view.ui
rename to src/plugins/debuggerui/ide-debugger-locals-view.ui
diff --git a/src/libide/debugger/ide-debugger-registers-view.c
b/src/plugins/debuggerui/ide-debugger-registers-view.c
similarity index 98%
rename from src/libide/debugger/ide-debugger-registers-view.c
rename to src/plugins/debuggerui/ide-debugger-registers-view.c
index 99000602f..9e5fce660 100644
--- a/src/libide/debugger/ide-debugger-registers-view.c
+++ b/src/plugins/debuggerui/ide-debugger-registers-view.c
@@ -23,16 +23,16 @@
#include "config.h"
#include <dazzle.h>
+#include <libide-core.h>
-#include "debugger/ide-debugger-registers-view.h"
-#include "util/ide-glib.h"
+#include "ide-debugger-registers-view.h"
struct _IdeDebuggerRegistersView
{
GtkBin parent_instance;
/* Owned references */
- DzlSignalGroup *debugger_signals;
+ DzlSignalGroup *debugger_signals;
/* Template references */
GtkTreeView *tree_view;
@@ -239,7 +239,7 @@ ide_debugger_registers_view_class_init (IdeDebuggerRegistersViewClass *klass)
g_object_class_install_properties (object_class, N_PROPS, properties);
- gtk_widget_class_set_template_from_resource (widget_class,
"/org/gnome/builder/ui/ide-debugger-registers-view.ui");
+ gtk_widget_class_set_template_from_resource (widget_class,
"/plugins/debuggerui/ide-debugger-registers-view.ui");
gtk_widget_class_bind_template_child (widget_class, IdeDebuggerRegistersView, id_cell);
gtk_widget_class_bind_template_child (widget_class, IdeDebuggerRegistersView, id_column);
gtk_widget_class_bind_template_child (widget_class, IdeDebuggerRegistersView, list_store);
diff --git a/src/libide/debugger/ide-debugger-registers-view.h
b/src/plugins/debuggerui/ide-debugger-registers-view.h
similarity index 97%
rename from src/libide/debugger/ide-debugger-registers-view.h
rename to src/plugins/debuggerui/ide-debugger-registers-view.h
index 7c8862732..45b989503 100644
--- a/src/libide/debugger/ide-debugger-registers-view.h
+++ b/src/plugins/debuggerui/ide-debugger-registers-view.h
@@ -22,7 +22,7 @@
#include <gtk/gtk.h>
-#include "debugger/ide-debugger.h"
+#include "ide-debugger.h"
G_BEGIN_DECLS
diff --git a/src/libide/debugger/ide-debugger-registers-view.ui
b/src/plugins/debuggerui/ide-debugger-registers-view.ui
similarity index 100%
rename from src/libide/debugger/ide-debugger-registers-view.ui
rename to src/plugins/debuggerui/ide-debugger-registers-view.ui
diff --git a/src/libide/debugger/ide-debugger-threads-view.c
b/src/plugins/debuggerui/ide-debugger-threads-view.c
similarity index 99%
rename from src/libide/debugger/ide-debugger-threads-view.c
rename to src/plugins/debuggerui/ide-debugger-threads-view.c
index 03655136d..acdf24af9 100644
--- a/src/libide/debugger/ide-debugger-threads-view.c
+++ b/src/plugins/debuggerui/ide-debugger-threads-view.c
@@ -23,10 +23,11 @@
#include "config.h"
#include <dazzle.h>
+#include <libide-core.h>
+#include <libide-gui.h>
#include <glib/gi18n.h>
-#include "debugger/ide-debugger-threads-view.h"
-#include "util/ide-glib.h"
+#include "ide-debugger-threads-view.h"
struct _IdeDebuggerThreadsView
{
@@ -688,7 +689,7 @@ ide_debugger_threads_view_class_init (IdeDebuggerThreadsViewClass *klass)
0, NULL, NULL, NULL,
G_TYPE_NONE, 2, IDE_TYPE_DEBUGGER_THREAD, IDE_TYPE_DEBUGGER_FRAME);
- gtk_widget_class_set_template_from_resource (widget_class,
"/org/gnome/builder/ui/ide-debugger-threads-view.ui");
+ gtk_widget_class_set_template_from_resource (widget_class,
"/plugins/debuggerui/ide-debugger-threads-view.ui");
gtk_widget_class_bind_template_child (widget_class, IdeDebuggerThreadsView, args_cell);
gtk_widget_class_bind_template_child (widget_class, IdeDebuggerThreadsView, args_column);
gtk_widget_class_bind_template_child (widget_class, IdeDebuggerThreadsView, binary_cell);
diff --git a/src/libide/debugger/ide-debugger-threads-view.h
b/src/plugins/debuggerui/ide-debugger-threads-view.h
similarity index 97%
rename from src/libide/debugger/ide-debugger-threads-view.h
rename to src/plugins/debuggerui/ide-debugger-threads-view.h
index 767f9e0ee..1cdbaab88 100644
--- a/src/libide/debugger/ide-debugger-threads-view.h
+++ b/src/plugins/debuggerui/ide-debugger-threads-view.h
@@ -22,7 +22,7 @@
#include <gtk/gtk.h>
-#include "debugger/ide-debugger.h"
+#include "ide-debugger.h"
G_BEGIN_DECLS
diff --git a/src/libide/debugger/ide-debugger-threads-view.ui
b/src/plugins/debuggerui/ide-debugger-threads-view.ui
similarity index 100%
rename from src/libide/debugger/ide-debugger-threads-view.ui
rename to src/plugins/debuggerui/ide-debugger-threads-view.ui
diff --git a/src/plugins/debuggerui/meson.build b/src/plugins/debuggerui/meson.build
new file mode 100644
index 000000000..cd77cec81
--- /dev/null
+++ b/src/plugins/debuggerui/meson.build
@@ -0,0 +1,21 @@
+plugins_sources += files([
+ 'debuggerui-plugin.c',
+ 'ide-debugger-breakpoints-view.c',
+ 'ide-debugger-controls.c',
+ 'ide-debugger-disassembly-view.c',
+ 'ide-debugger-editor-addin.c',
+ 'ide-debugger-hover-controls.c',
+ 'ide-debugger-hover-provider.c',
+ 'ide-debugger-libraries-view.c',
+ 'ide-debugger-locals-view.c',
+ 'ide-debugger-registers-view.c',
+ 'ide-debugger-threads-view.c',
+])
+
+plugin_debuggerui_resources = gnome.compile_resources(
+ 'gbp-debuggerui-resources',
+ 'debuggerui.gresource.xml',
+ c_name: 'gbp_debuggerui',
+)
+
+plugins_sources += plugin_debuggerui_resources[0]
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]