summaryrefslogtreecommitdiff
path: root/src/arch/raw.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/arch/raw.c')
-rw-r--r--src/arch/raw.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/arch/raw.c b/src/arch/raw.c
index 164086a..9b13dac 100644
--- a/src/arch/raw.c
+++ b/src/arch/raw.c
@@ -24,6 +24,9 @@
#include "raw.h"
+#include <string.h>
+
+
#include "immediate.h"
#include "instruction-int.h"
@@ -64,8 +67,8 @@ static void g_raw_instruction_finalize(GRawInstruction *);
/* Ajoute à un tampon GLib le contenu de l'instance spécifiée. */
static GBufferLine *g_raw_instruction_print(const GRawInstruction *, GCodeBuffer *, MemoryDataSize, const bin_t *, AsmSyntax);
-/* Fournit le nom humain de l'instruction manipulée. */
-static const char *g_raw_instruction_get_keyword(const GRawInstruction *, AsmSyntax);
+/* Reconstruit le cache complet d'une désignation d'instruction. */
+static void g_raw_instruction_build_keyword(const GRawInstruction *, AsmSyntax);
@@ -103,7 +106,7 @@ static void g_raw_instruction_class_init(GRawInstructionClass *klass)
instr = G_ARCH_INSTRUCTION_CLASS(klass);
instr->print = (print_instruction_fc)g_raw_instruction_print;
- instr->get_key = (get_instruction_keyword_fc)g_raw_instruction_get_keyword;
+ instr->build_key = (build_instruction_keyword_fc)g_raw_instruction_build_keyword;
}
@@ -275,7 +278,7 @@ static GBufferLine *g_raw_instruction_print(const GRawInstruction *instr, GCodeB
* format = format du binaire manipulé. *
* syntax = type de représentation demandée. *
* *
-* Description : Fournit le nom humain de l'instruction manipulée. *
+* Description : Reconstruit le cache complet d'une désignation d'instruction.*
* *
* Retour : Mot clef de bas niveau. *
* *
@@ -283,7 +286,7 @@ static GBufferLine *g_raw_instruction_print(const GRawInstruction *instr, GCodeB
* *
******************************************************************************/
-static const char *g_raw_instruction_get_keyword(const GRawInstruction *instr, AsmSyntax syntax)
+static void g_raw_instruction_build_keyword(const GRawInstruction *instr, AsmSyntax syntax)
{
GArchOperand *operand; /* Octet décodé à afficher */
MemoryDataSize size; /* Taille de valeur associée */
@@ -293,7 +296,7 @@ static const char *g_raw_instruction_get_keyword(const GRawInstruction *instr, A
operand = g_arch_instruction_get_operand(G_ARCH_INSTRUCTION(instr), 0);
size = g_imm_operand_get_size(G_IMM_OPERAND(operand));
- return defines[MDS_RANGE(size)];
+ G_ARCH_INSTRUCTION(instr)->cached_keyword = strdup(defines[MDS_RANGE(size)]);
}