diff options
Diffstat (limited to 'src/analysis/line_code.c')
-rw-r--r-- | src/analysis/line_code.c | 108 |
1 files changed, 0 insertions, 108 deletions
diff --git a/src/analysis/line_code.c b/src/analysis/line_code.c index 4761522..7630366 100644 --- a/src/analysis/line_code.c +++ b/src/analysis/line_code.c @@ -64,9 +64,6 @@ static void g_code_line_add_text(GCodeLine *, GRenderingOptions *, MainRendering /* Ajoute à un tampon GLib le contenu de l'instance spécifiée. */ static void g_code_line_to_buffer(GCodeLine *, GBufferLine *, GRenderingOptions *); -/* Ajoute à un texte GTK le contenu de la ligne de code. */ -static void g_code_line_add_to_gtk_buffer(GCodeLine *, MainRendering, GtkTextBuffer *, GtkTextIter *, size_t [SAR_COUNT]); - /* Indique le type définit par la GLib pour la ligne. */ @@ -113,7 +110,6 @@ static void g_code_line_init(GCodeLine *line) exporter_parent->add_text = (add_text_fc)g_code_line_add_text; exporter_parent->export_buffer = (export_buffer_fc)g_code_line_to_buffer; - exporter_parent->add_to_gtk_buffer = (add_to_gtk_buffer_fc)g_code_line_add_to_gtk_buffer; line_parent = G_RENDERING_LINE(line); @@ -290,110 +286,6 @@ static void g_code_line_to_buffer(GCodeLine *line, GBufferLine *buffer, GRenderi /****************************************************************************** * * -* Paramètres : line = ligne de représentation à actualiser. * -* rendering = support effectif final des lignes de code. * -* buffer = zone de texte à venir compléter. * -* iter = point d'insertion du nouveau texte. * -* lengths = taille des différentes composantes de la ligne. * -* * -* Description : Ajoute à un texte GTK le contenu de la ligne de code. * -* * -* Retour : - * -* * -* Remarques : - * -* * -******************************************************************************/ - -static void g_code_line_add_to_gtk_buffer(GCodeLine *line, MainRendering rendering, GtkTextBuffer *buffer, GtkTextIter *iter, size_t lengths[SAR_COUNT]) -{ - GContentExporter *exporter; /* Autre vision de la ligne #1 */ - GRenderingLine *basic; /* Autre vision de la ligne #2 */ - bool show_address; /* Affichage de l'adresse ? */ - bool show_code; /* Affichage du code brut ? */ - MemoryDataSize msize; /* Taille du bus d'adresses */ - char address[VMPA_MAX_SIZE]; /* Adresse au format texte */ - size_t len; /* Taille de l'élément inséré */ - const bin_t *content; /* Contenu binaire global */ - off_t bin_offset; /* Début de l'instruction */ - off_t bin_len; /* Taille d'instruction */ - char *bin_code; /* Tampon du code binaire */ - off_t i; /* Boucle de parcours */ - - exporter = G_CONTENT_EXPORTER(line); - basic = G_RENDERING_LINE(line); - - show_address = g_rendering_options_has_to_show_address(line->options, rendering); - show_code = g_rendering_options_has_to_show_code(line->options, rendering); - - /* Eventuelle adresse virtuelle ou physique */ - - if (show_address) - { - msize = g_arch_processor_get_memory_size(g_rendering_options_get_processor(line->options)); - - len = vmpa_to_string(G_RENDERING_LINE(line)->offset, msize, address); - lengths[SAR_ADDRESS] = len; - - g_content_exporter_insert_with_gtk_tag(exporter, buffer, iter, - address, len, RTT_NONE); - - g_content_exporter_insert_with_gtk_tag(exporter, buffer, iter, - "\t", 1, RTT_NONE); - - } - - /* Eventuel code brut */ - - if (show_code) - { - content = g_binary_format_get_content(G_BIN_FORMAT(g_rendering_options_get_format(line->options)), NULL); - g_arch_instruction_get_location(line->instr, &bin_offset, &bin_len, NULL); - - lengths[SAR_CODE] = MAX(lengths[SAR_CODE], bin_len * 3 - 1); - - bin_code = (char *)calloc(bin_len * 3, sizeof(char)); - - for (i = 0; i < bin_len; i++) - { - if ((i + 1) < bin_len) - snprintf(&bin_code[i * (2 + 1)], 4, "%02hhx ", content[bin_offset + i]); - else - snprintf(&bin_code[i * (2 + 1)], 3, "%02hhx", content[bin_offset + i]); - } - - g_content_exporter_insert_with_gtk_tag(exporter, buffer, iter, - bin_code, bin_len * 3 - 1, RTT_RAW_CODE); - - free(bin_code); - - g_content_exporter_insert_with_gtk_tag(exporter, buffer, iter, - "\t", 1, RTT_NONE); - - } - - /* Instruction proprement dite */ - - g_content_exporter_add_arch_to_gtk_buffer(G_CONTENT_EXPORTER(line->instr), - g_rendering_options_get_format(line->options), - ASX_INTEL/*FIXME*/, buffer, iter); - - lengths[SAR_INSTRUCTION] = MAX(lengths[SAR_INSTRUCTION], 4 /* FIXME */); - - /* Commentaire ? */ - - if (basic->comment != NULL) - { - g_content_exporter_insert_with_gtk_tag(exporter, buffer, iter, "\t", 1, RTT_NONE); - g_content_exporter_insert_with_gtk_tag(exporter, buffer, iter, "; ", 2, RTT_COMMENT); - g_content_exporter_insert_with_gtk_tag(exporter, buffer, iter, basic->comment, - strlen(basic->comment), RTT_COMMENT); - } - -} - - -/****************************************************************************** -* * * Paramètres : offset = emplacement physique ou en mémoire. * * instr = instruction à représenter. * * options = paramétrage du rendu. * |