summaryrefslogtreecommitdiff
path: root/src/gtkext/gtkstatusstack.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gtkext/gtkstatusstack.c')
-rw-r--r--src/gtkext/gtkstatusstack.c60
1 files changed, 9 insertions, 51 deletions
diff --git a/src/gtkext/gtkstatusstack.c b/src/gtkext/gtkstatusstack.c
index 0b35e1b..fe4e4d5 100644
--- a/src/gtkext/gtkstatusstack.c
+++ b/src/gtkext/gtkstatusstack.c
@@ -34,7 +34,6 @@
#include "easygtk.h"
-#include "../common/extstr.h"
#include "../gui/agroup.h"
#include "../format/format.h"
@@ -503,8 +502,9 @@ static void on_zoom_icon_press(GtkEntry *entry, GtkEntryIconPosition icon_pos, G
/******************************************************************************
* *
* Paramètres : stack = barre de statut à actualiser. *
-* binary = binaire chargé rassemblant l'ensemble des infos. *
* range = emplacement à mettre en valeur. *
+* segment = zone de binaire d'appartenance. *
+* symbol = éventuelle position par rapport à un symbole. *
* encoding = encodage d'une éventuelle instruction ou NULL. *
* *
* Description : Actualise les informations liées une position d'assemblage. *
@@ -515,25 +515,14 @@ static void on_zoom_icon_press(GtkEntry *entry, GtkEntryIconPosition icon_pos, G
* *
******************************************************************************/
-void gtk_status_stack_update_current_location(GtkStatusStack *stack, const GLoadedBinary *binary, const mrange_t *range, const char *encoding)
+void gtk_status_stack_update_current_location(GtkStatusStack *stack, const mrange_t *range, const char *segment, const char *symbol, const char *encoding)
{
assembly_info *info; /* Informations à constituer */
- GExeFormat *format; /* Format de binaire à traiter */
const vmpa2t *addr; /* Localisation de départ */
phys_t size; /* Taille de l'emplacement */
- GBinPortion *portions; /* Couche première de portions */
- GBinPortion *portion; /* Zone mémoire d'appartenance */
- const char *text; /* Texte au contenu à copier */
- GBinSymbol *symbol; /* Symbole présent à l'adresse */
- phys_t diff; /* Décalage de l'adresse */
- char *label; /* Description d'un symbole */
- vmpa2t tmp; /* Zone de construction temp. */
- VMPA_BUFFER(offset); /* Décalage physique */
info = stack->asm_info;
- format = g_loaded_binary_get_format(binary);
-
/* Bascule vers une zone courante nouvelle ? */
addr = get_mrange_addr(range);
@@ -542,7 +531,7 @@ void gtk_status_stack_update_current_location(GtkStatusStack *stack, const GLoad
if (cmp_mrange(&info->current, range) == 0
&& info->size == size
&& info->encoding == encoding)
- goto gssuci_useless;
+ goto useless;
/* Réinitialisation */
@@ -552,20 +541,7 @@ void gtk_status_stack_update_current_location(GtkStatusStack *stack, const GLoad
/* Zone d'appartenance */
- portions = g_exe_format_get_portions(format);
-
- portion = g_binary_portion_find_at_addr(portions, addr, (GdkRectangle []) { { 0 } });
-
- text = g_binary_portion_get_desc(portion);
-
- if (text != NULL)
- info->segment = strdup(text);
- else
- info->segment = strdup(_("Binary"));
-
- g_object_unref(G_OBJECT(portion));
-
- g_object_unref(G_OBJECT(portions));
+ info->segment = strdup(segment);
/* Adresses de base */
@@ -578,26 +554,8 @@ void gtk_status_stack_update_current_location(GtkStatusStack *stack, const GLoad
/* Symbole concerné */
- if (g_binary_format_resolve_symbol(G_BIN_FORMAT(format), addr, false, &symbol, &diff))
- {
- label = g_binary_symbol_get_label(symbol);
-
- if (label != NULL)
- {
- info->symbol = label;
-
- info->symbol = stradd(info->symbol, "+");
-
- init_vmpa(&tmp, diff, VMPA_NO_VIRTUAL);
- vmpa2_phys_to_string(&tmp, MDS_UNDEFINED, offset, NULL);
-
- info->symbol = stradd(info->symbol, offset);
-
- }
-
- g_object_unref(G_OBJECT(symbol));
-
- }
+ if (symbol != NULL)
+ info->symbol = strdup(symbol);
/* Nettoyage et conclusion */
@@ -605,9 +563,9 @@ void gtk_status_stack_update_current_location(GtkStatusStack *stack, const GLoad
gtk_status_stack_show_current_location(stack);
- gssuci_useless:
+ useless:
- g_object_unref(G_OBJECT(format));
+ ;
}