summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2017-01-15 14:47:04 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2017-01-15 14:47:04 (GMT)
commitaf2ac16182b6243f17e06ec75e441014159abe5e (patch)
treef0e82673bf5e63e3b06244c2139d8f10dca0203f /src/gui
parent56e060d11c238ac7c7b3ecf0eb0527bbaebd5b4b (diff)
Improved symbol resolving using fully defined locations.
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/menus/edition.c27
1 files changed, 13 insertions, 14 deletions
diff --git a/src/gui/menus/edition.c b/src/gui/menus/edition.c
index 9c01a6b..31fbc0d 100644
--- a/src/gui/menus/edition.c
+++ b/src/gui/menus/edition.c
@@ -434,8 +434,9 @@ static void mcb_edition_follow_ref(GtkMenuItem *menuitem, GMenuBar *bar)
GtkDisplayPanel *panel; /* Afficheur effectif de code */
GBufferLine *line; /* Ligne de position courante */
GObject *creator; /* Créateur à l'orgine du seg. */
- virt_t virt; /* Adresse virtuelle */
+ bool defined; /* Adresse définie ? */
vmpa2t addr; /* Adresse de destination */
+ virt_t virt; /* Adresse virtuelle */
panel = g_editor_item_get_current_view(G_EDITOR_ITEM(bar));
@@ -443,27 +444,25 @@ static void mcb_edition_follow_ref(GtkMenuItem *menuitem, GMenuBar *bar)
{
assert(creator != NULL);
- /**
- * On fait le pari de reposer uniquement sur des adresses virtuelles !
- * A changer dans un futur ?
- */
-
- virt = VMPA_NO_VIRTUAL;
+ defined = false;
if (G_IS_TARGET_OPERAND(creator))
- virt = g_target_operand_get_addr(G_TARGET_OPERAND(creator));
+ {
+ g_target_operand_get_addr(G_TARGET_OPERAND(creator), &addr);
+ defined = true;
+ }
else if (G_IS_IMM_OPERAND(creator))
{
- if (!g_imm_operand_to_virt_t(G_IMM_OPERAND(creator), &virt))
- virt = VMPA_NO_VIRTUAL;
+ if (g_imm_operand_to_virt_t(G_IMM_OPERAND(creator), &virt))
+ {
+ init_vmpa(&addr, VMPA_NO_PHYSICAL, virt);
+ defined = true;
+ }
}
- if (virt != VMPA_NO_VIRTUAL)
- {
- init_vmpa(&addr, VMPA_NO_PHYSICAL, virt);
+ if (defined)
gtk_display_panel_request_move(panel, &addr);
- }
g_object_unref(creator);
g_object_unref(G_OBJECT(line));