diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2017-03-24 18:47:25 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2017-03-24 18:47:33 (GMT) |
commit | a2f149e5d151dcd937351f6e54229e508123c3ad (patch) | |
tree | 49aa468e2e552735ea61ed7e78d29d821e03aafd /src/gtkext | |
parent | 1de9967e2a13baca3df50b02903900e36cee64ae (diff) |
Built tooltips from all kinds of operands.
Diffstat (limited to 'src/gtkext')
-rw-r--r-- | src/gtkext/gtkblockdisplay.c | 50 |
1 files changed, 8 insertions, 42 deletions
diff --git a/src/gtkext/gtkblockdisplay.c b/src/gtkext/gtkblockdisplay.c index 9698ee5..b39b561 100644 --- a/src/gtkext/gtkblockdisplay.c +++ b/src/gtkext/gtkblockdisplay.c @@ -25,7 +25,7 @@ #include "gtkbufferdisplay-int.h" -#include "../arch/target.h" +#include "../arch/operand.h" @@ -287,11 +287,6 @@ static gboolean gtk_block_display_query_tooltip(GtkWidget *widget, gint x, gint gint real_x; /* Abscisse absolue réelle */ gint real_y; /* Ordonnée absolue réelle */ GObject *creator; /* Origine du segment pointé */ - GBinSymbol *symbol; /* Eventuel symbole survolé */ - GTargetOperand *operand; /* Operande associé */ - phys_t diff; /* Différence avec la base */ - SymbolType stype; /* Type de symbole identifié */ - GBinRoutine *routine; /* Routine à manipuler */ char *info; /* Information à faire paraître*/ if (keyboard) return FALSE; @@ -309,49 +304,20 @@ static gboolean gtk_block_display_query_tooltip(GtkWidget *widget, gint x, gint if (creator != NULL) { - symbol = NULL; + if (G_IS_ARCH_OPERAND(creator)) + info = g_arch_operand_build_tooltip(G_ARCH_OPERAND(creator), panel->binary); - if (!G_IS_TARGET_OPERAND(creator)) - goto gbdqt_done; + else + info = NULL; - operand = G_TARGET_OPERAND(creator); - - symbol = g_target_operand_get_symbol(operand, &diff); - - if (symbol == NULL || diff != 0) - goto gbdqt_done; - - stype = g_binary_symbol_get_target_type(symbol); - - switch (stype) - { - case STP_ROUTINE: - case STP_ENTRY_POINT: - - routine = g_binary_symbol_get_routine(symbol); - - info = g_binary_routine_build_tooltip(routine, panel->binary); - - //g_object_unref(G_OBJECT(routine)); - - result = (info != NULL); - break; - - default: - break; - - } - - if (result) + if (info != NULL) { gtk_tooltip_set_markup(tooltip, info); free(info); - } - gbdqt_done: + result = TRUE; - if (symbol != NULL) - g_object_unref(G_OBJECT(symbol)); + } g_object_unref(creator); |