[gnome-builder/wip/chergert/debugger: 119/134] debugger: add IdeDebugger::run() vfunc
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder/wip/chergert/debugger: 119/134] debugger: add IdeDebugger::run() vfunc
- Date: Fri, 31 Mar 2017 18:03:58 +0000 (UTC)
commit a567b29c60733b89f9f8d068459e221d72895002
Author: Christian Hergert <chergert redhat com>
Date: Sun Mar 26 02:51:15 2017 -0700
debugger: add IdeDebugger::run() vfunc
This can be used to advance the program based on the run type.
libide/debugger/ide-debug-manager.c | 6 ++++++
libide/debugger/ide-debugger.c | 10 ++++++++++
libide/debugger/ide-debugger.h | 29 ++++++++++++++++++++---------
3 files changed, 36 insertions(+), 9 deletions(-)
---
diff --git a/libide/debugger/ide-debug-manager.c b/libide/debugger/ide-debug-manager.c
index 006487f..3bc9f20 100644
--- a/libide/debugger/ide-debug-manager.c
+++ b/libide/debugger/ide-debug-manager.c
@@ -150,6 +150,8 @@ ide_debug_manager_action_step_in (GSimpleAction *action,
g_assert (IDE_IS_DEBUG_MANAGER (self));
g_assert (G_IS_SIMPLE_ACTION (action));
+ if (self->debugger != NULL)
+ ide_debugger_run (self->debugger, IDE_DEBUGGER_RUN_STEP_IN);
}
static void
@@ -162,6 +164,8 @@ ide_debug_manager_action_step_over (GSimpleAction *action,
g_assert (IDE_IS_DEBUG_MANAGER (self));
g_assert (G_IS_SIMPLE_ACTION (action));
+ if (self->debugger != NULL)
+ ide_debugger_run (self->debugger, IDE_DEBUGGER_RUN_STEP_OVER);
}
static void
@@ -174,6 +178,8 @@ ide_debug_manager_action_continue (GSimpleAction *action,
g_assert (IDE_IS_DEBUG_MANAGER (self));
g_assert (G_IS_SIMPLE_ACTION (action));
+ if (self->debugger != NULL)
+ ide_debugger_run (self->debugger, IDE_DEBUGGER_RUN_CONTINUE);
}
static void
diff --git a/libide/debugger/ide-debugger.c b/libide/debugger/ide-debugger.c
index 8c42932..81cc880 100644
--- a/libide/debugger/ide-debugger.c
+++ b/libide/debugger/ide-debugger.c
@@ -173,3 +173,13 @@ ide_debugger_prepare (IdeDebugger *self,
if (IDE_DEBUGGER_GET_IFACE (self)->prepare)
IDE_DEBUGGER_GET_IFACE (self)->prepare (self, runner);
}
+
+void
+ide_debugger_run (IdeDebugger *self,
+ IdeDebuggerRunType run_type)
+{
+ g_return_if_fail (IDE_IS_DEBUGGER (self));
+
+ if (IDE_DEBUGGER_GET_IFACE (self)->run)
+ IDE_DEBUGGER_GET_IFACE (self)->run (self, run_type);
+}
diff --git a/libide/debugger/ide-debugger.h b/libide/debugger/ide-debugger.h
index 9dd3125..ac103ba 100644
--- a/libide/debugger/ide-debugger.h
+++ b/libide/debugger/ide-debugger.h
@@ -37,19 +37,28 @@ typedef enum
IDE_DEBUGGER_STOP_SIGNALED,
} IdeDebuggerStopReason;
+typedef enum
+{
+ IDE_DEBUGGER_RUN_CONTINUE,
+ IDE_DEBUGGER_RUN_STEP_IN,
+ IDE_DEBUGGER_RUN_STEP_OVER,
+} IdeDebuggerRunType;
+
struct _IdeDebuggerInterface
{
GTypeInterface parent_iface;
- gchar *(*get_name) (IdeDebugger *self);
- gboolean (*supports_runner) (IdeDebugger *self,
- IdeRunner *runner,
- gint *priority);
- void (*stopped) (IdeDebugger *self,
- IdeDebuggerStopReason reason,
- IdeSourceLocation *location);
- void (*prepare) (IdeDebugger *debugger,
- IdeRunner *runner);
+ gchar *(*get_name) (IdeDebugger *self);
+ gboolean (*supports_runner) (IdeDebugger *self,
+ IdeRunner *runner,
+ gint *priority);
+ void (*stopped) (IdeDebugger *self,
+ IdeDebuggerStopReason reason,
+ IdeSourceLocation *location);
+ void (*prepare) (IdeDebugger *debugger,
+ IdeRunner *runner);
+ void (*run) (IdeDebugger *self,
+ IdeDebuggerRunType run_type);
};
gchar *ide_debugger_get_name (IdeDebugger *self);
@@ -58,6 +67,8 @@ gboolean ide_debugger_supports_runner (IdeDebugger *self,
gint *priority);
void ide_debugger_prepare (IdeDebugger *self,
IdeRunner *runner);
+void ide_debugger_run (IdeDebugger *self,
+ IdeDebuggerRunType run_type);
void ide_debugger_emit_stopped (IdeDebugger *self,
IdeDebuggerStopReason reason,
IdeSourceLocation *location);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]