summaryrefslogtreecommitdiff
path: root/src/arch/dalvik
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2014-12-04 22:59:30 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2014-12-04 22:59:30 (GMT)
commit12154652c576144405011b5bd267c15c9667f223 (patch)
treebe552b2b7bc563a58892e8950afd920a45132a6e /src/arch/dalvik
parent6803c5d5b86416d1748d4d37a5cc5cb44fe007b1 (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/dalvik')
-rw-r--r--src/arch/dalvik/instruction.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/arch/dalvik/instruction.c b/src/arch/dalvik/instruction.c
index e02619c..98e29dd 100644
--- a/src/arch/dalvik/instruction.c
+++ b/src/arch/dalvik/instruction.c
@@ -24,6 +24,9 @@
#include "instruction.h"
+#include <string.h>
+
+
#include "instruction-int.h"
#include "decomp/translate.h"
#include "operands/register.h"
@@ -327,8 +330,8 @@ static dalvik_instruction _instructions[DOP_COUNT] = {
};
-/* Fournit le nom humain de l'instruction manipulée. */
-static const char *dalvik_get_instruction_keyword(const GDalvikInstruction *, AsmSyntax);
+/* Reconstruit le cache complet d'une désignation d'instruction. */
+static void dalvik_build_instruction_keyword(const GDalvikInstruction *, AsmSyntax);
/* Informe sur une éventuelle référence à une autre instruction. */
static InstructionLinkType dalvik_get_instruction_link(const GDalvikInstruction *, vmpa_t *);
@@ -370,7 +373,7 @@ static void g_dalvik_instruction_class_init(GDalvikInstructionClass *klass)
instr = G_ARCH_INSTRUCTION_CLASS(klass);
- instr->get_key = (get_instruction_keyword_fc)dalvik_get_instruction_keyword;
+ instr->build_key = (build_instruction_keyword_fc)dalvik_build_instruction_keyword;
}
@@ -573,7 +576,7 @@ DalvikOpcodes dalvik_guess_next_instruction(const bin_t *data, off_t pos, off_t
* Paramètres : instr = instruction à traiter. *
* 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. *
* *
@@ -581,9 +584,9 @@ DalvikOpcodes dalvik_guess_next_instruction(const bin_t *data, off_t pos, off_t
* *
******************************************************************************/
-static const char *dalvik_get_instruction_keyword(const GDalvikInstruction *instr, AsmSyntax syntax)
+static void dalvik_build_instruction_keyword(const GDalvikInstruction *instr, AsmSyntax syntax)
{
- return _instructions[instr->type].keyword;
+ G_ARCH_INSTRUCTION(instr)->cached_keyword = strdup(_instructions[instr->type].keyword);
}