summaryrefslogtreecommitdiff
path: root/src/arch/raw.c
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2015-12-15 22:08:44 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2015-12-15 22:08:44 (GMT)
commit4d313d845a60e908b9e2723cc1fe2bdbbdded315 (patch)
tree96b3c599e250b987e284e4bfcf33a7ae201cf637 /src/arch/raw.c
parenta847082da67c5af831d1f4b66a628de2e9d61395 (diff)
Stored and provided the encoding used by an instruction.
Diffstat (limited to 'src/arch/raw.c')
-rw-r--r--src/arch/raw.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/arch/raw.c b/src/arch/raw.c
index a9fc3df..57860c0 100644
--- a/src/arch/raw.c
+++ b/src/arch/raw.c
@@ -29,6 +29,9 @@
#include <string.h>
+#include <i18n.h>
+
+
#include "immediate.h"
#include "instruction-int.h"
#include "target.h"
@@ -68,6 +71,9 @@ static void g_raw_instruction_dispose(GRawInstruction *);
/* Procède à la libération totale de la mémoire. */
static void g_raw_instruction_finalize(GRawInstruction *);
+/* Indique l'encodage d'une instruction de façon détaillée. */
+static const char *g_raw_instruction_get_encoding(const GRawInstruction *);
+
/* Ajoute à un tampon GLib le contenu de l'instance spécifiée. */
static GBufferLine *g_raw_instruction_print(const GRawInstruction *, GCodeBuffer *, MemoryDataSize, const GBinContent *, AsmSyntax);
@@ -109,6 +115,7 @@ static void g_raw_instruction_class_init(GRawInstructionClass *klass)
instr = G_ARCH_INSTRUCTION_CLASS(klass);
+ instr->get_encoding = (get_instruction_encoding_fc)g_raw_instruction_get_encoding;
instr->print = (print_instruction_fc)g_raw_instruction_print;
instr->build_key = (build_instruction_keyword_fc)g_raw_instruction_build_keyword;
@@ -299,6 +306,32 @@ GArchInstruction *g_raw_instruction_new_array(const GBinContent *content, Memory
/******************************************************************************
* *
+* Paramètres : instr = instruction quelconque à consulter. *
+* *
+* Description : Indique l'encodage d'une instruction de façon détaillée. *
+* *
+* Retour : Description humaine de l'encodage utilisé. *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+static const char *g_raw_instruction_get_encoding(const GRawInstruction *instr)
+{
+ const char *result; /* Description à retourner */
+
+ if (instr->is_string)
+ result = _("String");
+ else
+ result = _("Raw");
+
+ return result;
+
+}
+
+
+/******************************************************************************
+* *
* Paramètres : instr = instruction d'assemblage à représenter. *
* buffer = espace où placer ledit contenu. *
* msize = taille idéale des positions et adresses; *