diff options
Diffstat (limited to 'plugins/pychrysalide/arch')
| -rw-r--r-- | plugins/pychrysalide/arch/instructions/undefined.c | 2 | ||||
| -rw-r--r-- | plugins/pychrysalide/arch/operand.c | 11 | ||||
| -rw-r--r-- | plugins/pychrysalide/arch/operands/immediate.c | 166 | ||||
| -rw-r--r-- | plugins/pychrysalide/arch/operands/register.c | 41 | ||||
| -rw-r--r-- | plugins/pychrysalide/arch/operands/target.c | 8 | 
5 files changed, 13 insertions, 215 deletions
| diff --git a/plugins/pychrysalide/arch/instructions/undefined.c b/plugins/pychrysalide/arch/instructions/undefined.c index 5741609..99fd2ff 100644 --- a/plugins/pychrysalide/arch/instructions/undefined.c +++ b/plugins/pychrysalide/arch/instructions/undefined.c @@ -130,7 +130,7 @@ static int py_undef_instruction_init(PyObject *self, PyObject *args, PyObject *k      unsigned long behavior;                 /* Conséquence pour l'instruct°*/      int ret;                                /* Bilan de lecture des args.  */      GUndefInstruction *instr;               /* Instruction à manipuler     */ -    undef_obj_extra *extra;                 /* Données insérées à modifier */ +    undef_extra_data_t *extra;              /* Données insérées à modifier */      static char *kwlist[] = { "behavior", NULL }; diff --git a/plugins/pychrysalide/arch/operand.c b/plugins/pychrysalide/arch/operand.c index f3eaa27..71e7cdc 100644 --- a/plugins/pychrysalide/arch/operand.c +++ b/plugins/pychrysalide/arch/operand.c @@ -49,7 +49,7 @@ static PyObject *py_arch_operand_new(PyTypeObject *, PyObject *, PyObject *);  static void py_arch_operand_init_gclass(GArchOperandClass *, gpointer);  /* Compare un opérande avec un autre. */ -static int py_arch_operand___cmp___wrapper(const GArchOperand *, const GArchOperand *); +static int py_arch_operand___cmp___wrapper(const GArchOperand *, const GArchOperand *, bool);  /* Détermine le chemin conduisant à un opérande interne. */  static char *py_arch_operand_find_inner_operand_path_wrapper(const GArchOperand *, const GArchOperand *); @@ -193,8 +193,9 @@ static void py_arch_operand_init_gclass(GArchOperandClass *class, gpointer unuse  /******************************************************************************  *                                                                             * -*  Paramètres  : a = premier opérande à consulter.                            * -*                b = second opérande à consulter.                             * +*  Paramètres  : a    = premier opérande à consulter.                         * +*                b    = second opérande à consulter.                          * +*                lock = précise le besoin en verrouillage.                    *  *                                                                             *  *  Description : Compare un opérande avec un autre.                           *  *                                                                             * @@ -204,7 +205,7 @@ static void py_arch_operand_init_gclass(GArchOperandClass *class, gpointer unuse  *                                                                             *  ******************************************************************************/ -static int py_arch_operand___cmp___wrapper(const GArchOperand *a, const GArchOperand *b) +static int py_arch_operand___cmp___wrapper(const GArchOperand *a, const GArchOperand *b, bool lock)  {      int result;                             /* Empreinte à retourner       */      PyGILState_STATE gstate;                /* Sauvegarde d'environnement  */ @@ -559,7 +560,7 @@ static PyObject *py_arch_operand_richcompare(PyObject *a, PyObject *b, int op)      reg_a = G_ARCH_OPERAND(pygobject_get(a));      reg_b = G_ARCH_OPERAND(pygobject_get(b)); -    status = py_arch_operand___cmp___wrapper(reg_a, reg_b); +    status = py_arch_operand___cmp___wrapper(reg_a, reg_b, true);      result = status_to_rich_cmp_state(status, op); 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); | 
