summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/menus/edition.c6
-rw-r--r--src/gui/status.c19
2 files changed, 18 insertions, 7 deletions
diff --git a/src/gui/menus/edition.c b/src/gui/menus/edition.c
index c742098..2cc22b2 100644
--- a/src/gui/menus/edition.c
+++ b/src/gui/menus/edition.c
@@ -252,8 +252,12 @@ void update_access_in_menu_edition(GObject *ref, GtkBufferView *view, const vmpa
/* Préliminaire */
- if (view == NULL)
+ if (view == NULL || addr == NULL)
+ {
state = false;
+ line = NULL;
+ segment = NULL;
+ }
else
state = gtk_view_panel_get_position(GTK_VIEW_PANEL(view), &line, &segment);
diff --git a/src/gui/status.c b/src/gui/status.c
index 8db4f3a..a3daded 100644
--- a/src/gui/status.c
+++ b/src/gui/status.c
@@ -254,14 +254,21 @@ static void focus_address_in_status_info(GStatusInfo *info, GLoadedBinary *binar
GArchInstruction *instr; /* Instruction présente */
GEditorItem *item; /* Autre version de l'élément */
- proc = g_loaded_binary_get_processor(binary);
+ if (addr == NULL)
+ gtk_status_stack_reset_current_instruction(GTK_STATUS_STACK(item->widget));
- instr = _g_arch_processor_find_instr_by_address(proc, addr, true);
- assert(instr != NULL);
+ else
+ {
+ proc = g_loaded_binary_get_processor(binary);
- item = G_EDITOR_ITEM(info);
- gtk_status_stack_update_current_instruction(GTK_STATUS_STACK(item->widget), binary, instr);
+ instr = _g_arch_processor_find_instr_by_address(proc, addr, true);
+ assert(instr != NULL);
+
+ item = G_EDITOR_ITEM(info);
+ gtk_status_stack_update_current_instruction(GTK_STATUS_STACK(item->widget), binary, instr);
+
+ g_object_unref(G_OBJECT(proc));
- g_object_unref(G_OBJECT(proc));
+ }
}