summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2018-05-24 09:13:44 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2018-05-24 09:13:44 (GMT)
commitb9e8a23f725570e4ac40a4625f51e933deaff25a (patch)
tree02fd5466f58e73ebd5e392d2275bddd896631423 /src
parente441c2320666df295eaecc385740f40acbd2afbe (diff)
Kept the ownership of inserted instructions longer.
Diffstat (limited to 'src')
-rw-r--r--src/analysis/disass/area.c30
1 files changed, 22 insertions, 8 deletions
diff --git a/src/analysis/disass/area.c b/src/analysis/disass/area.c
index 5e89daa..655d5af 100644
--- a/src/analysis/disass/area.c
+++ b/src/analysis/disass/area.c
@@ -470,7 +470,10 @@ static void mark_range_in_mem_area_as_processed(mem_area *area, GArchInstruction
if (instr != NULL)
{
area->instructions[start] = instr;
+ g_object_ref(G_OBJECT(instr));
+
g_atomic_pointer_add(&area->count, 1);
+
}
}
@@ -760,8 +763,6 @@ void load_code_from_mem_area(mem_area *area, mem_area *list, size_t count, GProc
gtk_status_stack_update_activity_value(status, id, diff);
- assert(is_range_busy_in_mem_area(area, i, diff));
-
/* Enregistrement d'un éventuel début de routine */
if (g_arch_instruction_get_flags(instr) & AIF_ROUTINE_START)
@@ -778,11 +779,17 @@ void load_code_from_mem_area(mem_area *area, mem_area *list, size_t count, GProc
extra = g_preload_info_pop_instruction(G_PRELOAD_INFO(ctx)))
{
insert_instr_into_mem_areas_forced(list, count, extra);
+ g_object_unref(G_OBJECT(extra));
}
/* Rupture du flot d'exécution ? */
if (forced_once || g_arch_instruction_get_flags(instr) & AIF_RETURN_POINT)
+ {
+ g_object_unref(G_OBJECT(instr));
break;
+ }
+ else
+ g_object_unref(G_OBJECT(instr));
}
@@ -854,16 +861,13 @@ static void load_data_from_mem_area(mem_area *area, GProcContext *ctx, const vmp
done = insert_instr_into_mem_areas(area, 1, instr, (mem_area *[]) { area });
+ g_object_unref(G_OBJECT(instr));
+
if (!done)
- {
- g_object_unref(G_OBJECT(instr));
break;
- }
gtk_status_stack_update_activity_value(status, id, diff);
- assert(is_range_busy_in_mem_area(area, i, diff));
-
/* On laisse une chance au code pour se reprendre... */
if (area->is_exec) break;
@@ -2020,6 +2024,8 @@ static void g_area_collector_do_insert(GAreaCollector *collector, GtkStatusStack
size_t i; /* Boucle de parcours #1 */
GArchInstruction *instr; /* Instruction à analyser */
bool done; /* Insertion réalisée ? */
+ const mrange_t *range; /* Emplacement de l'instruction*/
+ VMPA_BUFFER(loc); /* Traduction en texte */
last = NULL;
@@ -2030,7 +2036,15 @@ static void g_area_collector_do_insert(GAreaCollector *collector, GtkStatusStack
done = insert_instr_into_mem_areas(collector->areas, collector->available, instr, &last);
if (!done)
- g_object_unref(G_OBJECT(instr));
+ {
+ range = g_arch_instruction_get_range(instr);
+ vmpa2_phys_to_string(get_mrange_addr(range), MDS_UNDEFINED, loc, NULL);
+
+ log_variadic_message(LMT_ERROR, "Failed to insert one collected instruction @ %s", loc);
+
+ }
+
+ g_object_unref(G_OBJECT(instr));
gtk_status_stack_update_activity_value(status, collector->id, 1);