diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2009-09-08 23:38:46 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2009-09-08 23:38:46 (GMT) |
commit | 1d3c3cb7b108c0bbe05b9853ed4640d35ddf9bcb (patch) | |
tree | 35995d9b9e28db7eb7721f6f09fa68348d6b2385 /src/analysis | |
parent | 3173b904d5d56a8b5e6bf549c97e3fc49da6c5ba (diff) |
Restored the previous/original rendering of disassemblies.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@111 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'src/analysis')
-rw-r--r-- | src/analysis/exporter-int.h | 2 | ||||
-rw-r--r-- | src/analysis/exporter.c | 5 | ||||
-rw-r--r-- | src/analysis/exporter.h | 2 | ||||
-rw-r--r-- | src/analysis/line_code.c | 9 | ||||
-rw-r--r-- | src/analysis/line_comment.c | 4 | ||||
-rw-r--r-- | src/analysis/line_prologue.c | 4 |
6 files changed, 16 insertions, 10 deletions
diff --git a/src/analysis/exporter-int.h b/src/analysis/exporter-int.h index 0c93980..097b48b 100644 --- a/src/analysis/exporter-int.h +++ b/src/analysis/exporter-int.h @@ -30,7 +30,7 @@ /* Ajoute à un texte GTK le contenu de la ligne de rendu. */ -typedef void (* add_to_gtk_buffer_fc) (GContentExporter *, MainRendering, GtkTextBuffer *, GtkTextIter *, gint [SAR_COUNT]); +typedef void (* add_to_gtk_buffer_fc) (GContentExporter *, MainRendering, GtkTextBuffer *, GtkTextIter *, size_t [SAR_COUNT]); /* Traduit une instruction en version humainement lisible. */ typedef void (* add_arch_to_gtk_buffer_fc) (const GContentExporter *, const GExeFormat *, AsmSyntax, GtkTextBuffer *, GtkTextIter *); diff --git a/src/analysis/exporter.c b/src/analysis/exporter.c index dd0f6c0..8a41abf 100644 --- a/src/analysis/exporter.c +++ b/src/analysis/exporter.c @@ -212,6 +212,7 @@ void g_content_exporter_insert_with_gtk_tag(GContentExporter *exporter, GtkTextB * 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 l'instance spécifiée. * * * @@ -221,10 +222,10 @@ void g_content_exporter_insert_with_gtk_tag(GContentExporter *exporter, GtkTextB * * ******************************************************************************/ -void g_content_exporter_add_to_gtk_buffer(GContentExporter *exporter, MainRendering rendering, GtkTextBuffer *buffer, GtkTextIter *iter) +void g_content_exporter_add_to_gtk_buffer(GContentExporter *exporter, MainRendering rendering, GtkTextBuffer *buffer, GtkTextIter *iter, size_t lengths[SAR_COUNT]) { if (exporter->add_to_gtk_buffer != NULL) - exporter->add_to_gtk_buffer(exporter, rendering, buffer, iter, NULL); + exporter->add_to_gtk_buffer(exporter, rendering, buffer, iter, lengths); } diff --git a/src/analysis/exporter.h b/src/analysis/exporter.h index 76725ad..9e8d54a 100644 --- a/src/analysis/exporter.h +++ b/src/analysis/exporter.h @@ -84,7 +84,7 @@ GtkTextTagTable *_get_gtk_tag_table(GtkTextTagTable *); #define get_gtk_tag_table() _get_gtk_tag_table(NULL) /* Ajoute à un texte GTK le contenu de l'instance spécifiée. */ -void g_content_exporter_add_to_gtk_buffer(GContentExporter *, MainRendering, GtkTextBuffer *, GtkTextIter *); +void g_content_exporter_add_to_gtk_buffer(GContentExporter *, MainRendering, GtkTextBuffer *, GtkTextIter *, size_t [SAR_COUNT]); /* Ajoute à un texte GTK le contenu d'une architecture. */ void g_content_exporter_add_arch_to_gtk_buffer(const GContentExporter *, const GExeFormat *, AsmSyntax, GtkTextBuffer *, GtkTextIter *); diff --git a/src/analysis/line_code.c b/src/analysis/line_code.c index 4ceabec..8f9f925 100644 --- a/src/analysis/line_code.c +++ b/src/analysis/line_code.c @@ -62,7 +62,7 @@ static void g_code_line_init(GCodeLine *); void g_code_line_get_binary_len(GCodeLine *, off_t *); /* Ajoute à un texte GTK le contenu de la ligne de code. */ -static void g_code_line_add_to_gtk_buffer(GCodeLine *, MainRendering, GtkTextBuffer *, GtkTextIter *, gint [SAR_COUNT]); +static void g_code_line_add_to_gtk_buffer(GCodeLine *, MainRendering, GtkTextBuffer *, GtkTextIter *, size_t [SAR_COUNT]); @@ -159,7 +159,7 @@ void g_code_line_get_binary_len(GCodeLine *line, off_t *blen) * * ******************************************************************************/ -static void g_code_line_add_to_gtk_buffer(GCodeLine *line, MainRendering rendering, GtkTextBuffer *buffer, GtkTextIter *iter, gint lengths[SAR_COUNT]) +static void g_code_line_add_to_gtk_buffer(GCodeLine *line, MainRendering rendering, GtkTextBuffer *buffer, GtkTextIter *iter, size_t lengths[SAR_COUNT]) { bool show_address; /* Affichage de l'adresse ? */ bool show_code; /* Affichage du code brut ? */ @@ -182,6 +182,7 @@ static void g_code_line_add_to_gtk_buffer(GCodeLine *line, MainRendering renderi 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(G_CONTENT_EXPORTER(line), buffer, iter, address, len, RTT_NONE); @@ -198,6 +199,8 @@ static void g_code_line_add_to_gtk_buffer(GCodeLine *line, MainRendering renderi 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++) @@ -224,6 +227,8 @@ static void g_code_line_add_to_gtk_buffer(GCodeLine *line, MainRendering renderi g_rendering_options_get_format(line->options), ASX_INTEL/*FIXME*/, buffer, iter); + lengths[SAR_INSTRUCTION] = MAX(lengths[SAR_INSTRUCTION], 4 /* FIXME */); + } diff --git a/src/analysis/line_comment.c b/src/analysis/line_comment.c index 2a3030c..aa6ae10 100644 --- a/src/analysis/line_comment.c +++ b/src/analysis/line_comment.c @@ -58,7 +58,7 @@ static void g_comment_line_class_init(GCommentLineClass *); static void g_comment_line_init(GCommentLine *); /* Ajoute à un texte GTK le contenu de la ligne de commentaires. */ -static void g_comment_line_add_to_gtk_buffer(GCommentLine *, MainRendering, GtkTextBuffer *, GtkTextIter *, gint [SAR_COUNT]); +static void g_comment_line_add_to_gtk_buffer(GCommentLine *, MainRendering, GtkTextBuffer *, GtkTextIter *, size_t [SAR_COUNT]); @@ -129,7 +129,7 @@ static void g_comment_line_init(GCommentLine *line) * * ******************************************************************************/ -static void g_comment_line_add_to_gtk_buffer(GCommentLine *line, MainRendering rendering, GtkTextBuffer *buffer, GtkTextIter *iter, gint lengths[SAR_COUNT]) +static void g_comment_line_add_to_gtk_buffer(GCommentLine *line, MainRendering rendering, GtkTextBuffer *buffer, GtkTextIter *iter, size_t lengths[SAR_COUNT]) { bool show_address; /* Affichage de l'adresse ? */ bool show_code; /* Affichage du code brut ? */ diff --git a/src/analysis/line_prologue.c b/src/analysis/line_prologue.c index 13f0c1e..f0f5db9 100644 --- a/src/analysis/line_prologue.c +++ b/src/analysis/line_prologue.c @@ -57,7 +57,7 @@ static void g_prologue_line_class_init(GPrologueLineClass *); static void g_prologue_line_init(GPrologueLine *); /* Ajoute à un texte GTK le contenu de la ligne d'ouverture. */ -static void g_prologue_line_add_to_gtk_buffer(GPrologueLine *, MainRendering, GtkTextBuffer *, GtkTextIter *, gint [SAR_COUNT]); +static void g_prologue_line_add_to_gtk_buffer(GPrologueLine *, MainRendering, GtkTextBuffer *, GtkTextIter *, size_t [SAR_COUNT]); @@ -128,7 +128,7 @@ static void g_prologue_line_init(GPrologueLine *line) * * ******************************************************************************/ -static void g_prologue_line_add_to_gtk_buffer(GPrologueLine *line, MainRendering rendering, GtkTextBuffer *buffer, GtkTextIter *iter, gint lengths[SAR_COUNT]) +static void g_prologue_line_add_to_gtk_buffer(GPrologueLine *line, MainRendering rendering, GtkTextBuffer *buffer, GtkTextIter *iter, size_t lengths[SAR_COUNT]) { size_t len; /* Taille de l'élément inséré */ |