summaryrefslogtreecommitdiff
path: root/src/analysis/line_comment.c
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2010-04-18 22:30:19 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2010-04-18 22:30:19 (GMT)
commitfb12cfc1727ba949b70a48ee042a2aec9ebbb407 (patch)
treee2c7300262312d77c9f57657e5238d269b7189c0 /src/analysis/line_comment.c
parentef29fbc801e23f547b9ee7666b713bcf32d7e787 (diff)
Defined attributes for printing binary content using GLib.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@153 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'src/analysis/line_comment.c')
-rw-r--r--src/analysis/line_comment.c47
1 files changed, 47 insertions, 0 deletions
diff --git a/src/analysis/line_comment.c b/src/analysis/line_comment.c
index 5bdf29a..7d2758d 100644
--- a/src/analysis/line_comment.c
+++ b/src/analysis/line_comment.c
@@ -60,6 +60,8 @@ static void g_comment_line_init(GCommentLine *);
/* Ajoute du texte simple à un fichier ouvert en écriture. */
static void g_comment_line_add_text(GCommentLine *, GRenderingOptions *, MainRendering, FILE *);
+/* Ajoute à un tampon GLib le contenu de l'instance spécifiée. */
+static void g_comment_line_to_buffer(GCommentLine *, GBufferLine *, GRenderingOptions *);
/* Indique le type définit par la GLib pour la ligne. */
@@ -105,6 +107,7 @@ static void g_comment_line_init(GCommentLine *line)
exporter_parent = G_CONTENT_EXPORTER(line);
exporter_parent->add_text = (add_text_fc)g_comment_line_add_text;
+ exporter_parent->export_buffer = (export_buffer_fc)g_comment_line_to_buffer;
line_parent = G_RENDERING_LINE(line);
@@ -173,6 +176,50 @@ static void g_comment_line_add_text(GCommentLine *line, GRenderingOptions *optio
/******************************************************************************
* *
+* Paramètres : line = ligne de représentation à représenter. *
+* buffer = espace où placer ledit contenu. *
+* options = options de rendu. *
+* *
+* Description : Ajoute à un tampon GLib le contenu de l'instance spécifiée. *
+* *
+* Retour : - *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+static void g_comment_line_to_buffer(GCommentLine *line, GBufferLine *buffer, GRenderingOptions *options)
+{
+ GContentExporter *exporter; /* Autre vision de la ligne */
+ 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é */
+
+ exporter = G_CONTENT_EXPORTER(line);
+
+ g_buffer_line_start_merge_at(buffer, BLC_ASSEMBLY_HEAD);
+
+ /* Eventuelle adresse virtuelle ou physique */
+
+ 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);
+
+ g_content_exporter_insert_into_buffer(exporter, buffer, BLC_ADDRESS, address, len, RTT_RAW);
+
+ /* Commentaire ? */
+
+ len = strlen(line->comment);
+
+ g_content_exporter_insert_into_buffer(exporter, buffer, BLC_COMMENTS, "; ", 2, RTT_COMMENT);
+ g_content_exporter_insert_into_buffer(exporter, buffer, BLC_COMMENTS,
+ line->comment, len, RTT_COMMENT);
+
+}
+
+
+/******************************************************************************
+* *
* Paramètres : offset = emplacement physique ou en mémoire. *
* comment = texte à afficher au final. *
* options = paramétrage du rendu. *