summaryrefslogtreecommitdiff
path: root/src/arch/x86/operands
diff options
context:
space:
mode:
Diffstat (limited to 'src/arch/x86/operands')
-rw-r--r--src/arch/x86/operands/data.c16
-rw-r--r--src/arch/x86/operands/modrm.c15
-rw-r--r--src/arch/x86/operands/modrm.h2
-rw-r--r--src/arch/x86/operands/moffs.c14
-rw-r--r--src/arch/x86/operands/register.c42
-rw-r--r--src/arch/x86/operands/register.h2
-rw-r--r--src/arch/x86/operands/relative.c14
7 files changed, 31 insertions, 74 deletions
diff --git a/src/arch/x86/operands/data.c b/src/arch/x86/operands/data.c
index 22f16b7..32b9bcd 100644
--- a/src/arch/x86/operands/data.c
+++ b/src/arch/x86/operands/data.c
@@ -24,7 +24,7 @@
#include "data.h"
-#include "../registers.h"
+#include "../register.h"
#include "../../operand-int.h"
@@ -53,12 +53,6 @@ static void g_x86_data_operand_class_init(GX86DataOperandClass *);
/* Initialise une instance d'opérande x86 pointant des données. */
static void g_x86_data_operand_init(GX86DataOperand *);
-/* Ajoute du texte simple à un fichier ouvert en écriture. */
-static void g_x86_data_operand_add_text(const GX86DataOperand *, GRenderingOptions *, MainRendering, FILE *);
-
-/* Ajoute à un tampon GLib le contenu de l'instance spécifiée. */
-static void g_x86_data_operand_to_buffer(const GX86DataOperand *, GBufferLine *, GRenderingOptions *);
-
/* Indique le type défini par la GLib pour un opérande x86 de manipulation de données. */
@@ -97,12 +91,6 @@ static void g_x86_data_operand_class_init(GX86DataOperandClass *klass)
static void g_x86_data_operand_init(GX86DataOperand *operand)
{
- GContentExporter *parent; /* Instance parente */
-
- parent = G_CONTENT_EXPORTER(operand);
-
- parent->add_text = (add_text_fc)g_x86_data_operand_add_text;
- parent->export_buffer = (export_buffer_fc)g_x86_data_operand_to_buffer;
}
@@ -134,6 +122,7 @@ GArchOperand *g_x86_data_operand_new(MemoryDataSize size, bool dest)
}
+#if 0
/******************************************************************************
* *
* Paramètres : operand = opérande à transcrire. *
@@ -205,3 +194,4 @@ static void g_x86_data_operand_to_buffer(const GX86DataOperand *operand, GBuffer
"]", 1, RTT_HOOK);
}
+#endif
diff --git a/src/arch/x86/operands/modrm.c b/src/arch/x86/operands/modrm.c
index 892d5dc..e23f499 100644
--- a/src/arch/x86/operands/modrm.c
+++ b/src/arch/x86/operands/modrm.c
@@ -59,12 +59,6 @@ static void g_x86_mod_rm_operand_class_init(GX86ModRMOperandClass *);
/* Initialise une instance d'opérande x86 de type ModRM. */
static void g_x86_mod_rm_operand_init(GX86ModRMOperand *);
-/* Ajoute du texte simple à un fichier ouvert en écriture. */
-static void g_x86_mod_rm_operand_add_text(const GX86ModRMOperand *, GRenderingOptions *, MainRendering, FILE *);
-
-/* Ajoute à un tampon GLib le contenu de l'instance spécifiée. */
-static void g_x86_mod_rm_operand_to_buffer(const GX86ModRMOperand *, GBufferLine *, GRenderingOptions *);
-
/* Indique le type défini par la GLib pour un opérande x86 de type ModRM. */
@@ -103,12 +97,6 @@ static void g_x86_mod_rm_operand_class_init(GX86ModRMOperandClass *klass)
static void g_x86_mod_rm_operand_init(GX86ModRMOperand *operand)
{
- GContentExporter *parent; /* Instance parente */
-
- parent = G_CONTENT_EXPORTER(operand);
-
- parent->add_text = (add_text_fc)g_x86_mod_rm_operand_add_text;
- parent->export_buffer = (export_buffer_fc)g_x86_mod_rm_operand_to_buffer;
}
@@ -215,7 +203,7 @@ GArchOperand *g_x86_mod_rm_operand_new(const bin_t *data, off_t *pos, off_t len,
}
-
+#if 0
/******************************************************************************
* *
* Paramètres : operand = opérande à transcrire. *
@@ -374,6 +362,7 @@ static void g_x86_mod_rm_operand_to_buffer(const GX86ModRMOperand *operand, GBuf
}
}
+#endif
/******************************************************************************
diff --git a/src/arch/x86/operands/modrm.h b/src/arch/x86/operands/modrm.h
index 89a274f..428d481 100644
--- a/src/arch/x86/operands/modrm.h
+++ b/src/arch/x86/operands/modrm.h
@@ -28,7 +28,7 @@
#include <glib-object.h>
-#include "../registers.h"
+#include "../register.h"
#include "../../immediate.h"
#include "../../operand.h"
#include "../../../common/endianness.h"
diff --git a/src/arch/x86/operands/moffs.c b/src/arch/x86/operands/moffs.c
index 3754e79..4d3c57b 100644
--- a/src/arch/x86/operands/moffs.c
+++ b/src/arch/x86/operands/moffs.c
@@ -52,12 +52,6 @@ static void g_x86_moffs_operand_class_init(GX86MOffsOperandClass *);
/* Initialise une instance d'opérande d'emplacement mémoire x86. */
static void g_x86_moffs_operand_init(GX86MOffsOperand *);
-/* Ajoute du texte simple à un fichier ouvert en écriture. */
-static void g_x86_moffs_operand_add_text(const GX86MOffsOperand *, GRenderingOptions *, MainRendering, FILE *);
-
-/* Ajoute à un tampon GLib le contenu de l'instance spécifiée. */
-static void g_x86_moffs_operand_to_buffer(const GX86MOffsOperand *, GBufferLine *, GRenderingOptions *);
-
/* Indique le type défini par la GLib pour un opérande d'emplacement mémoire x86. */
@@ -96,12 +90,6 @@ static void g_x86_moffs_operand_class_init(GX86MOffsOperandClass *klass)
static void g_x86_moffs_operand_init(GX86MOffsOperand *operand)
{
- GContentExporter *parent; /* Instance parente */
-
- parent = G_CONTENT_EXPORTER(operand);
-
- parent->add_text = (add_text_fc)g_x86_moffs_operand_add_text;
- parent->export_buffer = (export_buffer_fc)g_x86_moffs_operand_to_buffer;
}
@@ -141,6 +129,7 @@ GArchOperand *g_x86_moffs_operand_new(const bin_t *data, off_t *pos, off_t len,
}
+#if 0
/******************************************************************************
* *
* Paramètres : operand = opérande à transcrire. *
@@ -187,3 +176,4 @@ static void g_x86_moffs_operand_to_buffer(const GX86MOffsOperand *operand, GBuff
g_content_exporter_to_buffer(G_CONTENT_EXPORTER(operand->offset), buffer, options);
}
+#endif
diff --git a/src/arch/x86/operands/register.c b/src/arch/x86/operands/register.c
index a70ea60..4ca695f 100644
--- a/src/arch/x86/operands/register.c
+++ b/src/arch/x86/operands/register.c
@@ -52,11 +52,11 @@ static void g_x86_register_operand_class_init(GX86RegisterOperandClass *);
/* Initialise une instance d'opérande de registre x86. */
static void g_x86_register_operand_init(GX86RegisterOperand *);
-/* Ajoute du texte simple à un fichier ouvert en écriture. */
-static void g_x86_register_operand_add_text(const GX86RegisterOperand *, GRenderingOptions *, MainRendering, FILE *);
+/* Compare un opérande avec un autre. */
+static bool g_x86_register_operand_compare(const GX86RegisterOperand *, const GX86RegisterOperand *);
-/* Ajoute à un tampon GLib le contenu de l'instance spécifiée. */
-static void g_x86_register_operand_to_buffer(const GX86RegisterOperand *, GBufferLine *, GRenderingOptions *);
+/* Traduit un opérande en version humainement lisible. */
+static void g_x86_register_operand_print(const GX86RegisterOperand *, GBufferLine *, AsmSyntax);
@@ -96,12 +96,12 @@ static void g_x86_register_operand_class_init(GX86RegisterOperandClass *klass)
static void g_x86_register_operand_init(GX86RegisterOperand *operand)
{
- GContentExporter *parent; /* Instance parente */
+ GArchOperand *parent; /* Instance parente */
- parent = G_CONTENT_EXPORTER(operand);
+ parent = G_ARCH_OPERAND(operand);
- parent->add_text = (add_text_fc)g_x86_register_operand_add_text;
- parent->export_buffer = (export_buffer_fc)g_x86_register_operand_to_buffer;
+ parent->compare = (operand_compare_fc)g_x86_register_operand_compare;
+ parent->print = (operand_print_fc)g_x86_register_operand_print;
}
@@ -224,33 +224,31 @@ GArchOperand *g_x86_register_operand_new_from_index(bin_t index, MemoryDataSize
/******************************************************************************
* *
-* Paramètres : operand = opérande à transcrire. *
-* options = options de rendu. *
-* rendering = support effectif final des lignes de code. *
-* stream = flux ouvert en écriture. *
+* Paramètres : a = premier opérande à consulter. *
+* b = second opérande à consulter. *
* *
-* Description : Ajoute du texte simple à un fichier ouvert en écriture. *
+* Description : Compare un opérande avec un autre. *
* *
-* Retour : - *
+* Retour : Bilan de la comparaison. *
* *
* Remarques : - *
* *
******************************************************************************/
-static void g_x86_register_operand_add_text(const GX86RegisterOperand *operand, GRenderingOptions *options, MainRendering rendering, FILE *stream)
+static bool g_x86_register_operand_compare(const GX86RegisterOperand *a, const GX86RegisterOperand *b)
{
- g_content_exporter_add_text(G_CONTENT_EXPORTER(operand->reg), options, rendering, stream);
+ return g_x86_register_compare(a->reg, b->reg);
}
/******************************************************************************
* *
-* Paramètres : operand = opérande à transcrire. *
-* buffer = espace où placer ledit contenu. *
-* options = options de rendu. *
+* Paramètres : operand = opérande à traiter. *
+* line = ligne tampon où imprimer l'opérande donné. *
+* syntax = type de représentation demandée. *
* *
-* Description : Ajoute à un tampon GLib le contenu de l'instance spécifiée. *
+* Description : Traduit un opérande en version humainement lisible. *
* *
* Retour : - *
* *
@@ -258,8 +256,8 @@ static void g_x86_register_operand_add_text(const GX86RegisterOperand *operand,
* *
******************************************************************************/
-static void g_x86_register_operand_to_buffer(const GX86RegisterOperand *operand, GBufferLine *buffer, GRenderingOptions *options)
+static void g_x86_register_operand_print(const GX86RegisterOperand *operand, GBufferLine *line, AsmSyntax syntax)
{
- g_content_exporter_to_buffer(G_CONTENT_EXPORTER(operand->reg), buffer, options);
+ g_x86_pool_operand_print(operand->reg, line, syntax);
}
diff --git a/src/arch/x86/operands/register.h b/src/arch/x86/operands/register.h
index 11bc87e..e679410 100644
--- a/src/arch/x86/operands/register.h
+++ b/src/arch/x86/operands/register.h
@@ -28,7 +28,7 @@
#include <glib-object.h>
-#include "../registers.h"
+#include "../register.h"
#include "../../operand.h"
#include "../../../common/endianness.h"
diff --git a/src/arch/x86/operands/relative.c b/src/arch/x86/operands/relative.c
index 3235a0d..cd69748 100644
--- a/src/arch/x86/operands/relative.c
+++ b/src/arch/x86/operands/relative.c
@@ -51,12 +51,6 @@ static void g_x86_relative_operand_class_init(GX86RelativeOperandClass *);
/* Initialise une instance d'opérande x86 d'adresse relative. */
static void g_x86_relative_operand_init(GX86RelativeOperand *);
-/* Ajoute du texte simple à un fichier ouvert en écriture. */
-static void g_x86_relative_operand_add_text(const GX86RelativeOperand *, GRenderingOptions *, MainRendering, FILE *);
-
-/* Ajoute à un tampon GLib le contenu de l'instance spécifiée. */
-static void g_x86_relative_operand_to_buffer(const GX86RelativeOperand *, GBufferLine *, GRenderingOptions *);
-
/* Indique le type défini par la GLib pour un opérande x86 d'adresse relative. */
@@ -95,12 +89,6 @@ static void g_x86_relative_operand_class_init(GX86RelativeOperandClass *klass)
static void g_x86_relative_operand_init(GX86RelativeOperand *operand)
{
- GContentExporter *parent; /* Instance parente */
-
- parent = G_CONTENT_EXPORTER(operand);
-
- parent->add_text = (add_text_fc)g_x86_relative_operand_add_text;
- parent->export_buffer = (export_buffer_fc)g_x86_relative_operand_to_buffer;
}
@@ -159,6 +147,7 @@ GArchOperand *g_x86_relative_operand_new(const bin_t *data, off_t *pos, off_t le
}
+#if 0
/******************************************************************************
* *
* Paramètres : operand = opérande à transcrire. *
@@ -200,6 +189,7 @@ static void g_x86_relative_operand_to_buffer(const GX86RelativeOperand *operand,
g_content_exporter_to_buffer(G_CONTENT_EXPORTER(operand->immediate), buffer, options);
}
+#endif
/******************************************************************************