diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2016-02-02 06:25:28 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2016-02-02 06:25:28 (GMT) |
commit | a61984e52bfd35e19408b7cbdb11e3419f635829 (patch) | |
tree | 55e12f1d6fff818cc905ba103ccdb2dc8992b0da /src/gui | |
parent | 7162a683b66b02c16b42a177600468a1ff56149d (diff) |
Given a chance to the caret to get defined before getting drawn.
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/menus/edition.c | 6 | ||||
-rw-r--r-- | src/gui/status.c | 19 |
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)); + } } |