summaryrefslogtreecommitdiff
path: root/src/gui/dialogs
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/dialogs')
-rw-r--r--src/gui/dialogs/gotox.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/src/gui/dialogs/gotox.c b/src/gui/dialogs/gotox.c
index c666ccb..e467f8e 100644
--- a/src/gui/dialogs/gotox.c
+++ b/src/gui/dialogs/gotox.c
@@ -342,8 +342,8 @@ GtkWidget *create_gotox_dialog_for_cross_references(GtkWindow *parent, GLoadedBi
static void add_new_location_to_list(GtkTreeStore *store, GLoadedBinary *binary, const vmpa2t *addr, GBinSymbol *hint)
{
-#if 0
- GCodeBuffer *buffer; /* Tampon de désassemblage */
+ GBufferCache *cache; /* Tampon de désassemblage */
+ size_t index; /* Indice de ligne à traiter */
GBufferLine *line; /* Ligne présente à l'adresse */
char *virtual; /* Transcription d'adresse */
const char *label; /* Etiquette de symbole trouvé */
@@ -356,10 +356,19 @@ static void add_new_location_to_list(GtkTreeStore *store, GLoadedBinary *binary,
char *content; /* Contenu de la ligne visée */
GtkTreeIter iter; /* Point d'insertion */
- /* Adresse en mémoire virtuelle */
+ /* Détermination de la ligne concernée */
+
+ cache = g_loaded_binary_get_disassembled_cache(binary);
+
+ index = g_buffer_cache_find_index_by_addr(cache, addr, true);
+
+ index = g_buffer_cache_look_for_flag(cache, index, BLF_HAS_CODE);
- buffer = g_loaded_binary_get_disassembled_buffer(binary);
- line = g_code_buffer_find_line_by_addr(buffer, addr, BLF_HAS_CODE, NULL);
+ line = g_buffer_cache_find_line_by_index(cache, index);
+
+ g_object_unref(G_OBJECT(cache));
+
+ /* Adresse en mémoire virtuelle */
if (line != NULL)
virtual = g_buffer_line_get_text(line, BLC_VIRTUAL, BLC_VIRTUAL + 1, true);
@@ -466,7 +475,7 @@ static void add_new_location_to_list(GtkTreeStore *store, GLoadedBinary *binary,
if (line != NULL)
g_object_unref(G_OBJECT(line));
-#endif
+
}