diff options
| author | Cyrille Bagard <nocbos@gmail.com> | 2014-12-04 22:59:30 (GMT) | 
|---|---|---|
| committer | Cyrille Bagard <nocbos@gmail.com> | 2014-12-04 22:59:30 (GMT) | 
| commit | 12154652c576144405011b5bd267c15c9667f223 (patch) | |
| tree | be552b2b7bc563a58892e8950afd920a45132a6e /src/arch/artificial.c | |
| parent | 6803c5d5b86416d1748d4d37a5cc5cb44fe007b1 (diff) | |
Provided a new way to build the full name of each instruction and cached it.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@435 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'src/arch/artificial.c')
| -rw-r--r-- | src/arch/artificial.c | 15 | 
1 files changed, 9 insertions, 6 deletions
| diff --git a/src/arch/artificial.c b/src/arch/artificial.c index 4131e5f..9b84226 100644 --- a/src/arch/artificial.c +++ b/src/arch/artificial.c @@ -24,6 +24,9 @@  #include "artificial.h" +#include <string.h> + +  #include "immediate.h"  #include "instruction-int.h" @@ -63,8 +66,8 @@ static void g_db_instruction_dispose(GDbInstruction *);  /* Procède à la libération totale de la mémoire. */  static void g_db_instruction_finalize(GDbInstruction *); -/* Fournit le nom humain de l'instruction manipulée. */ -static const char *g_db_instruction_get_keyword(const GDbInstruction *, AsmSyntax); +/* Reconstruit le cache complet d'une désignation d'instruction. */ +static void g_db_instruction_build_keyword(const GDbInstruction *, AsmSyntax);  /* Informe sur une éventuelle référence à une autre instruction. */  static InstructionLinkType g_db_instruction_get_link(const GDbInstruction *, vmpa_t *); @@ -107,7 +110,7 @@ static void g_db_instruction_class_init(GDbInstructionClass *klass)      instr = G_ARCH_INSTRUCTION_CLASS(klass); -    instr->get_key = (get_instruction_keyword_fc)g_db_instruction_get_keyword; +    instr->build_key = (build_instruction_keyword_fc)g_db_instruction_build_keyword;  } @@ -233,7 +236,7 @@ GArchInstruction *g_db_instruction_new_from_data(const bin_t *data, vmpa2t *addr  *                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.                                      *  *                                                                             * @@ -241,9 +244,9 @@ GArchInstruction *g_db_instruction_new_from_data(const bin_t *data, vmpa2t *addr  *                                                                             *  ******************************************************************************/ -static const char *g_db_instruction_get_keyword(const GDbInstruction *instr, AsmSyntax syntax) +static void g_db_instruction_build_keyword(const GDbInstruction *instr, AsmSyntax syntax)  { -    return "db"; +    G_ARCH_INSTRUCTION(instr)->cached_keyword = strdup("db");  } | 
