summaryrefslogtreecommitdiff
path: root/src/arch/instruction.c
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2009-07-19 22:28:13 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2009-07-19 22:28:13 (GMT)
commit59bda76b1a76d796a42ee46b9da7041dbef57253 (patch)
tree36f7d6eaa7847016b99431b1b489c6a1fdbaf33b /src/arch/instruction.c
parent3a9fe39c6a8923f45e7c96d80b0bfe52b8686ff9 (diff)
Encapsulated all recognized variables in the stack using a new plugin (need to be continued).
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@99 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'src/arch/instruction.c')
-rw-r--r--src/arch/instruction.c47
1 files changed, 47 insertions, 0 deletions
diff --git a/src/arch/instruction.c b/src/arch/instruction.c
index e0cea9f..37b2147 100644
--- a/src/arch/instruction.c
+++ b/src/arch/instruction.c
@@ -202,6 +202,25 @@ void g_arch_instruction_attach_extra_operand(GArchInstruction *instr, GArchOpera
/******************************************************************************
* *
+* Paramètres : instr = instance à consulter. *
+* *
+* Description : Indique la quantité d'opérandes présents dans l'instruction. *
+* *
+* Retour : Nombre d'opérandes attachés. *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+size_t g_arch_instruction_count_operands(const GArchInstruction *instr)
+{
+ return instr->operands_count;
+
+}
+
+
+/******************************************************************************
+* *
* Paramètres : instr = instance à mettre à jour. *
* index = indice de l'opérande concernée. *
* *
@@ -227,6 +246,34 @@ const GArchOperand *g_arch_instruction_get_operand(GArchInstruction *instr, size
/******************************************************************************
* *
+* Paramètres : instr = instance à mettre à jour. *
+* new = nouvelle opérande à attacher. *
+* old = ancienne opérande à détacher. *
+* *
+* Description : Replace un opérande d'une instruction par un autre. *
+* *
+* Retour : - *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+void g_arch_instruction_replace_operand(GArchInstruction *instr, GArchOperand *new, const GArchOperand *old)
+{
+ size_t i; /* Boucle de parcours */
+
+ for (i = 0; i < instr->operands_count; i++)
+ if (instr->operands[i] == old)
+ break;
+
+ if (i < instr->operands_count)
+ instr->operands[i] = new;
+
+}
+
+
+/******************************************************************************
+* *
* Paramètres : instr = instance à mettre à jour. *
* opererand = instruction à venir dissocier. *
* *