summaryrefslogtreecommitdiff
path: root/src/analysis/disass/disassembler.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/analysis/disass/disassembler.c')
-rw-r--r--src/analysis/disass/disassembler.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/analysis/disass/disassembler.c b/src/analysis/disass/disassembler.c
index 283914e..046f936 100644
--- a/src/analysis/disass/disassembler.c
+++ b/src/analysis/disass/disassembler.c
@@ -38,6 +38,9 @@
#include "../../decomp/lang/asm.h"
#include "../../format/format.h"
#include "../../glibext/delayed-int.h"
+#ifdef DEBUG
+# include "../../panels/log.h"
+#endif
@@ -196,6 +199,13 @@ static GDelayedDisassembly *g_delayed_disassembly_new(const GOpenidaBinary *bina
static void g_delayed_disassembly_process(GDelayedDisassembly *disass, GtkExtStatusBar *statusbar)
{
+#ifdef DEBUG
+ unsigned int valid; /* Instructions traduites */
+ unsigned int db; /* Instructions non décodées */
+ unsigned int valid_sum; /* Instructions traduites */
+ unsigned int instr_sum; /* Instructions totales */
+ size_t i; /* Boucle de parcours */
+#endif
GBinRoutine **routines; /* Liste des routines trouvées */
size_t routines_count; /* Nombre de ces routines */
guint id; /* Identifiant de statut */
@@ -211,6 +221,24 @@ static void g_delayed_disassembly_process(GDelayedDisassembly *disass, GtkExtSta
gtk_extended_status_bar_remove(statusbar, id);
+#ifdef DEBUG
+
+ valid_sum = 0;
+ instr_sum = 0;
+
+ for (i = 0; i < disass->count; i++)
+ {
+ g_binary_part_get_checkup(disass->parts[i], &valid, &db);
+ valid_sum += valid;
+ instr_sum += (valid + db);
+ }
+
+ log_variadic_message(LMT_WARNING, _("Disassembled instructions : %u %% (%u / %d)"),
+ (valid_sum * 100) / instr_sum,
+ valid_sum, instr_sum);
+
+#endif
+
/* Seconde étape */
id = gtk_extended_status_bar_push(statusbar, _("Establishing links..."), true);