diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2015-05-13 23:45:33 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2015-05-13 23:45:33 (GMT) |
commit | 7baab38a0e9717110f7b4fb54efeb2d864040ecd (patch) | |
tree | 1f1f58e0fffaeb948ad145d107120a01173c8376 /src/gtkext | |
parent | f97bc58b93126e51deaf620d15c7771a9b233de5 (diff) |
Fixed a bug by searching lines in the whole code buffer instead of using the local one.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@536 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'src/gtkext')
-rw-r--r-- | src/gtkext/gtkbufferview.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/gtkext/gtkbufferview.c b/src/gtkext/gtkbufferview.c index 1b57341..7f62963 100644 --- a/src/gtkext/gtkbufferview.c +++ b/src/gtkext/gtkbufferview.c @@ -525,6 +525,7 @@ static gboolean gtk_buffer_view_query_tooltip(GtkWidget *widget, gint x, gint y, GBinFormat *format; /* Format du fichier binaire */ GBinSymbol *target_sym; /* Symbole présent à l'adresse */ GBinSymbol *next_sym; /* Symbole suivant l'adresse */ + GCodeBuffer *buffer; /* Tampon où lire les lignes */ const vmpa2t *stop_addr; /* Adresse associée, pour fin */ const mrange_t *lrange; /* Couverture d'une ligne */ size_t count; /* Nbre de lignes max à traiter*/ @@ -543,7 +544,6 @@ static gboolean gtk_buffer_view_query_tooltip(GtkWidget *widget, gint x, gint y, real_y = y; gtk_view_panel_compute_real_coord(GTK_VIEW_PANEL(view), &real_x, &real_y); - line = g_buffer_view_find_line_and_segment_at(view->buffer_view, &real_x, real_y, NULL, GTK_VIEW_PANEL(view)->display, &segment); @@ -584,6 +584,14 @@ static gboolean gtk_buffer_view_query_tooltip(GtkWidget *widget, gint x, gint y, /* Construction du contenu textuel */ + /** + * Dans le cas des vues de blocs basiques, il est impératif + * de chercher les lignes dans le tampon global, et non uniquement dans + * celui propre au bloc basique courant. + */ + + buffer = g_loaded_binary_get_disassembled_buffer(GTK_VIEW_PANEL(view)->binary); + if (g_binary_format_find_next_symbol_at(format, &addr, &next_sym)) stop_addr = get_mrange_addr(g_binary_symbol_get_range(next_sym)); @@ -591,11 +599,10 @@ static gboolean gtk_buffer_view_query_tooltip(GtkWidget *widget, gint x, gint y, markup = NULL; - for (i = 0, line = g_buffer_view_find_line_by_addr(view->buffer_view, &addr, BLF_NONE, &index); + for (i = 0, line = g_code_buffer_find_line_by_addr(buffer, &addr, BLF_NONE, &index); i < count && line != NULL; - i++, line = g_buffer_view_find_line_by_index(view->buffer_view, index + i)) + i++, line = g_code_buffer_find_line_by_index(buffer, index + i)) { - /* Si on commence à marcher sur les plates-bandes du symbole suivant... */ if (next_sym != NULL) { |