summaryrefslogtreecommitdiff
path: root/plugins/pychrysalide/arch/operands
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/pychrysalide/arch/operands')
-rw-r--r--plugins/pychrysalide/arch/operands/immediate.c166
-rw-r--r--plugins/pychrysalide/arch/operands/register.c41
-rw-r--r--plugins/pychrysalide/arch/operands/target.c8
3 files changed, 6 insertions, 209 deletions
diff --git a/plugins/pychrysalide/arch/operands/immediate.c b/plugins/pychrysalide/arch/operands/immediate.c
index 2634352..5f59c6b 100644
--- a/plugins/pychrysalide/arch/operands/immediate.c
+++ b/plugins/pychrysalide/arch/operands/immediate.c
@@ -64,18 +64,6 @@ static PyObject *py_imm_operand_get_size(PyObject *, void *);
/* Fournit la valeur portée par une opérande numérique. */
static PyObject *py_imm_operand_get_value(PyObject *, void *);
-/* Indique si l'affichage est complété avec des zéros. */
-static PyObject *py_imm_operand_get_default_padding(PyObject *self, void *);
-
-/* Précise si des zéro doivent compléter l'affichage ou non. */
-static int py_imm_operand_set_default_padding(PyObject *, PyObject *, void *);
-
-/* Indique si l'affichage est complété avec des zéros. */
-static PyObject *py_imm_operand_get_padding(PyObject *self, void *);
-
-/* Précise si des zéro doivent compléter l'affichage ou non. */
-static int py_imm_operand_set_padding(PyObject *, PyObject *, void *);
-
/* Indique le format textuel par défaut de la valeur. */
static PyObject *py_imm_operand_get_default_display(PyObject *, void *);
@@ -391,158 +379,6 @@ static PyObject *py_imm_operand_get_value(PyObject *self, void *closure)
* Paramètres : self = objet Python concerné par l'appel. *
* closure = non utilisé ici. *
* *
-* Description : Indique si l'affichage est complété avec des zéros. *
-* *
-* Retour : true si des zéro sont ajoutés à l'affichage, false sinon. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static PyObject *py_imm_operand_get_default_padding(PyObject *self, void *closure)
-{
- PyObject *result; /* Instance Python à retourner */
- GImmOperand *operand; /* Version GLib de l'opérande */
- bool padding; /* Bourrage en préfixe ? */
-
-#define IMM_OPERAND_DEFAULT_PADDING_ATTRIB PYTHON_GETSET_DEF_FULL \
-( \
- default_padding, py_imm_operand, \
- "Get or set the status of default padding with zeros in front of the" \
- " textual representation." \
- "\n" \
- "The status is a boolean value." \
-)
-
- operand = G_IMM_OPERAND(pygobject_get(self));
-
- padding = g_imm_operand_get_default_padding(operand);
-
- result = padding ? Py_True : Py_False;
- Py_INCREF(result);
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : self = objet Python concerné par l'appel. *
-* value = valeur fournie à intégrer ou prendre en compte. *
-* closure = non utilisé ici. *
-* *
-* Description : Précise si des zéro doivent compléter l'affichage ou non. *
-* *
-* Retour : Bilan de l'opération pour Python. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static int py_imm_operand_set_default_padding(PyObject *self, PyObject *value, void *closure)
-{
- bool padding; /* Bourrage en préfixe ? */
- GImmOperand *operand; /* Version GLib de l'opérande */
-
- if (!PyBool_Check(value))
- {
- PyErr_SetString(PyExc_TypeError, _("Invalid padding state"));
- return -1;
- }
-
- padding = (value == Py_True);
-
- operand = G_IMM_OPERAND(pygobject_get(self));
-
- g_imm_operand_set_default_padding(operand, padding);
-
- return 0;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : self = objet Python concerné par l'appel. *
-* closure = non utilisé ici. *
-* *
-* Description : Indique si l'affichage est complété avec des zéros. *
-* *
-* Retour : true si des zéro sont ajoutés à l'affichage, false sinon. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static PyObject *py_imm_operand_get_padding(PyObject *self, void *closure)
-{
- PyObject *result; /* Instance Python à retourner */
- GImmOperand *operand; /* Version GLib de l'opérande */
- bool padding; /* Bourrage en préfixe ? */
-
-#define IMM_OPERAND_PADDING_ATTRIB PYTHON_GETSET_DEF_FULL \
-( \
- padding, py_imm_operand, \
- "Get or set the status of padding with zeros in front of the" \
- " textual representation." \
- "\n" \
- "The status is a boolean value." \
-)
-
- operand = G_IMM_OPERAND(pygobject_get(self));
-
- padding = g_imm_operand_does_padding(operand);
-
- result = padding ? Py_True : Py_False;
- Py_INCREF(result);
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : self = objet Python concerné par l'appel. *
-* value = valeur fournie à intégrer ou prendre en compte. *
-* closure = non utilisé ici. *
-* *
-* Description : Précise si des zéro doivent compléter l'affichage ou non. *
-* *
-* Retour : Bilan de l'opération pour Python. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static int py_imm_operand_set_padding(PyObject *self, PyObject *value, void *closure)
-{
- bool padding; /* Bourrage en préfixe ? */
- GImmOperand *operand; /* Version GLib de l'opérande */
-
- if (!PyBool_Check(value))
- {
- PyErr_SetString(PyExc_TypeError, _("Invalid padding state"));
- return -1;
- }
-
- padding = (value == Py_True);
-
- operand = G_IMM_OPERAND(pygobject_get(self));
-
- g_imm_operand_pad(operand, padding);
-
- return 0;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : self = objet Python concerné par l'appel. *
-* closure = non utilisé ici. *
-* *
* Description : Indique le format textuel par défaut de la valeur. *
* *
* Retour : Format global d'un affichage de valeur. *
@@ -721,8 +557,6 @@ PyTypeObject *get_python_imm_operand_type(void)
static PyGetSetDef py_imm_operand_getseters[] = {
IMM_OPERAND_SIZE_ATTRIB,
IMM_OPERAND_VALUE_ATTRIB,
- IMM_OPERAND_DEFAULT_PADDING_ATTRIB,
- IMM_OPERAND_PADDING_ATTRIB,
IMM_OPERAND_DEFAULT_DISPLAY_ATTRIB,
IMM_OPERAND_DISPLAY_ATTRIB,
{ NULL }
diff --git a/plugins/pychrysalide/arch/operands/register.c b/plugins/pychrysalide/arch/operands/register.c
index fcf838c..d032e04 100644
--- a/plugins/pychrysalide/arch/operands/register.c
+++ b/plugins/pychrysalide/arch/operands/register.c
@@ -67,9 +67,6 @@ static PyObject *py_register_operand__print(PyObject *, PyObject *);
/* Fournit le registre associé à l'opérande. */
static PyObject *py_register_operand_get_register(PyObject *, void *);
-/* Indique le type d'accès réalisé sur l'opérande. */
-static PyObject *py_register_operand_is_written(PyObject *, void *);
-
/* ---------------------------------------------------------------------------------- */
@@ -357,43 +354,6 @@ static PyObject *py_register_operand_get_register(PyObject *self, void *closure)
/******************************************************************************
* *
-* Paramètres : self = objet Python concerné par l'appel. *
-* closure = non utilisé ici. *
-* *
-* Description : Indique le type d'accès réalisé sur l'opérande. *
-* *
-* Retour : Type d'accès : True en cas d'écriture, False sinon. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static PyObject *py_register_operand_is_written(PyObject *self, void *closure)
-{
- PyObject *result; /* Résultat à retourner */
- GRegisterOperand *operand; /* Version GLib du type */
- bool status; /* Statut de la ligne */
-
-#define REGISTER_OPERAND_IS_WRITTEN_ATTRIB PYTHON_IS_DEF_FULL \
-( \
- written, py_register_operand, \
- "Kind of access for the register when its instruction is executed." \
-)
-
- operand = G_REGISTER_OPERAND(pygobject_get(self));
-
- status = g_register_operand_is_written(operand);
-
- result = status ? Py_True : Py_False;
- Py_INCREF(result);
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
* Paramètres : - *
* *
* Description : Fournit un accès à une définition de type à diffuser. *
@@ -414,7 +374,6 @@ PyTypeObject *get_python_register_operand_type(void)
static PyGetSetDef py_register_operand_getseters[] = {
REGISTER_OPERAND_REGISTER_ATTRIB,
- REGISTER_OPERAND_IS_WRITTEN_ATTRIB,
{ NULL }
};
diff --git a/plugins/pychrysalide/arch/operands/target.c b/plugins/pychrysalide/arch/operands/target.c
index 5cd9f59..76c8269 100644
--- a/plugins/pychrysalide/arch/operands/target.c
+++ b/plugins/pychrysalide/arch/operands/target.c
@@ -176,7 +176,8 @@ static int py_target_operand_init(PyObject *self, PyObject *args, PyObject *kwds
MemoryDataSize size; /* Taille des adresses mémoire */
vmpa2t *addr; /* Emplacement de symbole */
int ret; /* Bilan de lecture des args. */
- GTargetOperand *operand; /* Opérande à manipuler */
+ GTargetOperand *operand; /* Opérande à manipuler */
+ tarop_extra_data_t *extra; /* Données insérées à modifier */
#define TARGET_OPERAND_DOC \
"The TargetOperand object translates immediate values as symbols.\n" \
@@ -203,7 +204,10 @@ static int py_target_operand_init(PyObject *self, PyObject *args, PyObject *kwds
operand = G_TARGET_OPERAND(pygobject_get(self));
- operand->size = size;
+ extra = GET_TARGET_OP_EXTRA(operand);
+
+ extra->size = size;
+
copy_vmpa(&operand->addr, addr);
clean_vmpa_arg(addr);