diff options
Diffstat (limited to 'src/editor.c')
-rw-r--r-- | src/editor.c | 65 |
1 files changed, 61 insertions, 4 deletions
diff --git a/src/editor.c b/src/editor.c index f038de6..c446234 100644 --- a/src/editor.c +++ b/src/editor.c @@ -48,7 +48,7 @@ #include "gtkext/gtkblockview.h" #include "gtkext/gtkdockpanel.h" -#include "debug/debuggers.h" +#include "debug/debugger.h" #include "dialogs/about.h" #include "dialogs/binparts.h" #include "dialogs/export.h" @@ -126,7 +126,7 @@ static void mcb_binary_select_plugins(GtkMenuItem *, GObject *); static void mcb_binary_export(GtkMenuItem *, GObject *); -/*Réagit avec le menu "Débogage -> Démarrer". */ +/* Réagit avec le menu "Débogage -> Démarrer". */ void mcb_debug_start(GtkCheckMenuItem *, gpointer); /* Réagit avec le menu "Débogage -> Mettre en pause". */ @@ -162,6 +162,12 @@ static void refresh_editor_menus(GObject *, GOpenidaBinary *, GtkBinView *); +/* ------------------------- PARTIE DEDIEE AU MODE DEBOGAGE ------------------------- */ + + +/* Prend note d'une pause dans le débogage. */ +static void on_debugger_halted(GBinaryDebugger *, int, vmpa_t, pid_t, GObject *); + @@ -1271,12 +1277,14 @@ void mcb_debug_start(GtkCheckMenuItem *menuitem, gpointer data) - debugger = g_new_binary_debugger(DGT_PTRACE, binary); + debugger = g_new_binary_debugger(DGT_REMOTE_GDB, binary); g_object_set_data(G_OBJECT(data), "current_debugger", debugger); g_signal_connect(debugger, "debugger-stopped", G_CALLBACK(debugger_stopped_cb), data); + g_signal_connect(debugger, "halted", G_CALLBACK(on_debugger_halted), data); + g_binary_debugger_run(debugger); @@ -1450,6 +1458,7 @@ static void mcb_help_about(GtkMenuItem *menuitem, GObject *ref) static void on_dock_item_switch(GtkDockPanel *panel, GDockItem *item, GObject *ref) { GtkWidget *widget; /* Support réel à traiter */ + GOpenidaBinary *old_binary; /* Ancien binaire édité */ GOpenidaBinary *binary; /* Binaire en cours d'édition */ widget = g_dock_item_get_panel(item); @@ -1462,9 +1471,17 @@ static void on_dock_item_switch(GtkDockPanel *panel, GDockItem *item, GObject *r if (GTK_IS_BIN_VIEW(widget)) { + /* Changement de binaire ? */ + + old_binary = G_OPENIDA_BINARY(g_object_get_data(ref, "current_binary")); binary = gtk_bin_view_get_binary(GTK_BIN_VIEW(widget)); - g_object_set_data(ref, "current_binary", binary); + if (old_binary != binary) + { + g_object_set_data(ref, "current_binary", binary); + notify_panels_of_binary_change(binary); + } + g_object_set_data(ref, "binview", widget); refresh_editor_menus(ref, binary, GTK_BIN_VIEW(widget)); @@ -1520,3 +1537,43 @@ static void refresh_editor_menus(GObject *ref, GOpenidaBinary *binary, GtkBinVie g_signal_connect(menuitem, "toggled", G_CALLBACK(mcb_view_change_support), ref); } + + + + + + + + + + +/* ---------------------------------------------------------------------------------- */ +/* PARTIE DEDIEE AU MODE DEBOGAGE */ +/* ---------------------------------------------------------------------------------- */ + + +/****************************************************************************** +* * +* Paramètres : debugger = débogueur intervenant dans l'action. * +* sig = identifiant du signal source (nul si indéterminé).* +* addr = adresse de l'instruction courante. * +* thread = identifiant du thread concerné. * +* ref = espace de référencement global. * +* * +* Description : Prend note d'une pause dans le débogage. * +* * +* Retour : - * +* * +* Remarques : - * +* * +******************************************************************************/ + +static void on_debugger_halted(GBinaryDebugger *debugger, int sig, vmpa_t addr, pid_t thread, GObject *ref) +{ + + printf("HALT (sig=%d) at 0x%016llx\n", sig, addr); + + + + +} |