summaryrefslogtreecommitdiff
path: root/src/gtkext
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2023-09-10 22:36:39 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2023-09-11 00:04:06 (GMT)
commitdca1d8cefde54fa6f23c2963aef61d211fc1d7d0 (patch)
treee44894c936c4d55fed4cde1fc545a325f41154d8 /src/gtkext
parentb370370a9e35f9dd2357102b17338d3d93bb62aa (diff)
Fix the compilation when GTK support is enabled.
Diffstat (limited to 'src/gtkext')
-rw-r--r--src/gtkext/gtkblockdisplay.c1
-rw-r--r--src/gtkext/gtkstatusstack.c60
-rw-r--r--src/gtkext/gtkstatusstack.h4
-rw-r--r--src/gtkext/hexdisplay.c1
-rw-r--r--src/gtkext/rendering.c1
5 files changed, 14 insertions, 53 deletions
diff --git a/src/gtkext/gtkblockdisplay.c b/src/gtkext/gtkblockdisplay.c
index 1810fc9..00da4cc 100644
--- a/src/gtkext/gtkblockdisplay.c
+++ b/src/gtkext/gtkblockdisplay.c
@@ -28,6 +28,7 @@
#include "../arch/instruction.h"
#include "../arch/operand.h"
#include "../analysis/loaded.h"
+#include "../core/columns.h"
#include "../glibext/gbinarycursor.h"
diff --git a/src/gtkext/gtkstatusstack.c b/src/gtkext/gtkstatusstack.c
index 499ea88..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);
-
- 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));
+ ;
}
diff --git a/src/gtkext/gtkstatusstack.h b/src/gtkext/gtkstatusstack.h
index 91182a1..f419014 100644
--- a/src/gtkext/gtkstatusstack.h
+++ b/src/gtkext/gtkstatusstack.h
@@ -28,7 +28,7 @@
#include <gtk/gtk.h>
-#include "../analysis/binary.h"
+#include "../arch/vmpa.h"
@@ -62,7 +62,7 @@ GtkStatusStack *gtk_status_stack_new(void);
/* Actualise les informations liées une position d'assemblage. */
-void gtk_status_stack_update_current_location(GtkStatusStack *, const GLoadedBinary *, const mrange_t *, const char *);
+void gtk_status_stack_update_current_location(GtkStatusStack *, const mrange_t *, const char *, const char *, const char *);
/* Réinitialise les informations associées une position. */
void gtk_status_stack_reset_current_location(GtkStatusStack *);
diff --git a/src/gtkext/hexdisplay.c b/src/gtkext/hexdisplay.c
index f557513..32bd69b 100644
--- a/src/gtkext/hexdisplay.c
+++ b/src/gtkext/hexdisplay.c
@@ -25,6 +25,7 @@
#include "gtkbufferdisplay-int.h"
+#include "../core/columns.h"
#include "../core/params.h"
#include "../format/format.h"
#include "../glibext/generators/hex.h"
diff --git a/src/gtkext/rendering.c b/src/gtkext/rendering.c
index bb86791..8badf21 100644
--- a/src/gtkext/rendering.c
+++ b/src/gtkext/rendering.c
@@ -28,6 +28,7 @@
#include <malloc.h>
#include <stdio.h>
#include <string.h>
+#include <gtk/gtk.h>
#include "../common/extstr.h"