summaryrefslogtreecommitdiff
path: root/plugins/pychrysalide/arch
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2020-02-04 21:51:50 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2020-02-04 21:51:50 (GMT)
commita1d7bc97071a4d22bb633359c749e3de84682024 (patch)
tree841744c30ac6010a4fc827fa09970e45f991c9ef /plugins/pychrysalide/arch
parent6d290a69f0b76fce34e8a2fc2c5fbec15c95d1a5 (diff)
Reduced the size required for register operands.
Diffstat (limited to 'plugins/pychrysalide/arch')
-rw-r--r--plugins/pychrysalide/arch/operands/register.c41
1 files changed, 41 insertions, 0 deletions
diff --git a/plugins/pychrysalide/arch/operands/register.c b/plugins/pychrysalide/arch/operands/register.c
index 1873d9c..300fd99 100644
--- a/plugins/pychrysalide/arch/operands/register.c
+++ b/plugins/pychrysalide/arch/operands/register.c
@@ -60,6 +60,9 @@ static int py_register_operand_init(PyObject *, 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 *);
+
/* ---------------------------------------------------------------------------------- */
@@ -264,6 +267,43 @@ 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. *
@@ -282,6 +322,7 @@ PyTypeObject *get_python_register_operand_type(void)
static PyGetSetDef py_register_operand_getseters[] = {
REGISTER_OPERAND_REGISTER_ATTRIB,
+ REGISTER_OPERAND_IS_WRITTEN_ATTRIB,
{ NULL }
};