diff options
Diffstat (limited to 'src/analysis')
-rw-r--r-- | src/analysis/db/items/comment.c | 5 | ||||
-rw-r--r-- | src/analysis/db/items/move.c | 12 | ||||
-rw-r--r-- | src/analysis/db/items/switcher.c | 5 | ||||
-rw-r--r-- | src/analysis/disass/area.c | 19 |
4 files changed, 19 insertions, 22 deletions
diff --git a/src/analysis/db/items/comment.c b/src/analysis/db/items/comment.c index 50522d9..263f415 100644 --- a/src/analysis/db/items/comment.c +++ b/src/analysis/db/items/comment.c @@ -544,10 +544,7 @@ static void g_db_comment_build_label(GDbComment *comment) { VMPA_BUFFER(loc); /* Indication de position */ - if (has_virt_addr(&comment->addr)) - vmpa2_virt_to_string(&comment->addr, MDS_UNDEFINED, loc, NULL); - else - vmpa2_phys_to_string(&comment->addr, MDS_UNDEFINED, loc, NULL); + vmpa2_to_string(&comment->addr, MDS_UNDEFINED, loc, NULL); if (is_rle_string_empty(&comment->text)) asprintf(&G_DB_ITEM(comment)->label, _("Delete comment at %s"), loc); diff --git a/src/analysis/db/items/move.c b/src/analysis/db/items/move.c index f6e585d..4fd1667 100644 --- a/src/analysis/db/items/move.c +++ b/src/analysis/db/items/move.c @@ -388,15 +388,9 @@ static void g_db_move_build_label(GDbMove *move) VMPA_BUFFER(src_loc); /* Indication de position #1 */ VMPA_BUFFER(dest_loc); /* Indication de position #2 */ - if (has_virt_addr(&move->src)) - vmpa2_virt_to_string(&move->src, MDS_UNDEFINED, src_loc, NULL); - else - vmpa2_phys_to_string(&move->src, MDS_UNDEFINED, src_loc, NULL); - - if (has_virt_addr(&move->dest)) - vmpa2_virt_to_string(&move->dest, MDS_UNDEFINED, dest_loc, NULL); - else - vmpa2_phys_to_string(&move->dest, MDS_UNDEFINED, dest_loc, NULL); + vmpa2_to_string(&move->src, MDS_UNDEFINED, src_loc, NULL); + + vmpa2_to_string(&move->dest, MDS_UNDEFINED, dest_loc, NULL); asprintf(&G_DB_ITEM(move)->label, _("Move from %s to %s"), src_loc, dest_loc); diff --git a/src/analysis/db/items/switcher.c b/src/analysis/db/items/switcher.c index 9cd2a2e..b7957ff 100644 --- a/src/analysis/db/items/switcher.c +++ b/src/analysis/db/items/switcher.c @@ -449,10 +449,7 @@ static void g_db_switcher_build_label(GDbSwitcher *switcher) { VMPA_BUFFER(loc); /* Indication de position */ - if (has_virt_addr(&switcher->addr)) - vmpa2_virt_to_string(&switcher->addr, MDS_UNDEFINED, loc, NULL); - else - vmpa2_phys_to_string(&switcher->addr, MDS_UNDEFINED, loc, NULL); + vmpa2_to_string(&switcher->addr, MDS_UNDEFINED, loc, NULL); switch (switcher->display) { diff --git a/src/analysis/disass/area.c b/src/analysis/disass/area.c index bdfb1b2..5478fe3 100644 --- a/src/analysis/disass/area.c +++ b/src/analysis/disass/area.c @@ -947,6 +947,12 @@ void insert_extra_symbol_into_mem_areas(mem_area *areas, size_t count, const GBi } + /** + * Un symbole (au sens large) ne peut avoir une adresse virtuelle que s'il + * est compris dans une zone chargée en mémoire (en toute logique). + */ + assert(has_virt_addr(get_mrange_addr(&area->range)) == has_virt_addr(addr)); + /* L'instruction est-elle accueillie dans son intégralité ? */ start = compute_vmpa_diff(get_mrange_addr(&area->range), addr); @@ -1238,7 +1244,7 @@ static void g_area_collector_do_compute(GAreaCollector *collector, GtkStatusStac } - void fill_gap(vmpa2t *old, vmpa2t *new, bool exec) + void fill_gap(vmpa2t *old, vmpa2t *new, bool alloc, bool exec) { phys_t diff; /* Espace entre bordures */ mem_area *area; /* Zone avec valeurs à éditer */ @@ -1252,6 +1258,9 @@ static void g_area_collector_do_compute(GAreaCollector *collector, GtkStatusStac if (diff > 0) { + if (!alloc) + reset_virt_addr(old); + /* Zone tampon à constituer */ *list = (mem_area *)realloc(*list, ++(*count) * sizeof(mem_area)); @@ -1326,7 +1335,7 @@ static void g_area_collector_do_compute(GAreaCollector *collector, GtkStatusStac if (on_track) { rights = (parent != NULL ? g_binary_portion_get_rights(parent) : PAC_NONE); - fill_gap(&prev, &border, rights & PAC_EXEC); + fill_gap(&prev, &border, rights != PAC_NONE, rights & PAC_EXEC); } else copy_vmpa(&prev, &border); @@ -1342,12 +1351,12 @@ static void g_area_collector_do_compute(GAreaCollector *collector, GtkStatusStac if (on_track) { rights = (parent != NULL ? g_binary_portion_get_rights(parent) : PAC_NONE); - fill_gap(&prev, &border, rights & PAC_EXEC); + fill_gap(&prev, &border, rights != PAC_NONE, rights & PAC_EXEC); compute_mrange_end_addr(range, &border); rights = g_binary_portion_get_rights(portion); - fill_gap(&prev, &border, rights & PAC_EXEC); + fill_gap(&prev, &border, rights != PAC_NONE, rights & PAC_EXEC); } else @@ -1367,7 +1376,7 @@ static void g_area_collector_do_compute(GAreaCollector *collector, GtkStatusStac if (on_track) { rights = (parent != NULL ? g_binary_portion_get_rights(parent) : PAC_NONE); - fill_gap(&prev, &border, rights & PAC_EXEC); + fill_gap(&prev, &border, rights != PAC_NONE, rights & PAC_EXEC); } else copy_vmpa(&prev, &border); |