summaryrefslogtreecommitdiff
path: root/plugins/pychrysalide/arch
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2019-05-12 22:09:53 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2019-05-12 22:09:53 (GMT)
commit00e93226e72bdb18853580f553e32df111422936 (patch)
tree9c346903d4506cae2df19b9314cf307c783c0cb3 /plugins/pychrysalide/arch
parente44ffc323c8a9d4b446baba6e0b131107312fa84 (diff)
Simplified the way processors are registered.
Diffstat (limited to 'plugins/pychrysalide/arch')
-rw-r--r--plugins/pychrysalide/arch/processor.c33
1 files changed, 19 insertions, 14 deletions
diff --git a/plugins/pychrysalide/arch/processor.c b/plugins/pychrysalide/arch/processor.c
index 94ba7df..f356a91 100644
--- a/plugins/pychrysalide/arch/processor.c
+++ b/plugins/pychrysalide/arch/processor.c
@@ -208,6 +208,23 @@ static PyObject *py_arch_processor_new(PyTypeObject *type, PyObject *args, PyObj
static void py_arch_processor_init_gclass(GArchProcessorClass *class, gpointer unused)
{
+ GType type; /* Type d'instances concerné */
+ GArchProcessor *pattern; /* Patron de données à copier */
+
+ type = G_TYPE_FROM_CLASS(class);
+
+ pattern = get_dynamic_type_pattern(type);
+
+ if (pattern != NULL)
+ {
+ /*
+ class->endianness = pattern->endianness;
+ class->memsize = pattern->memsize;
+ class->inssize = pattern->inssize;
+ class->virt_space = pattern->virt_space;
+ */
+ }
+
class->get_ctx = py_arch_processor_get_context_wrapper;
class->disassemble = py_arch_processor_disassemble_wrapper;
@@ -230,20 +247,6 @@ static void py_arch_processor_init_gclass(GArchProcessorClass *class, gpointer u
static void py_arch_processor_init_ginstance(GArchProcessor *proc, GArchProcessor *class)
{
- GType type; /* Type d'instances concerné */
- GArchProcessor *pattern; /* Patron de données à copier */
-
- type = G_TYPE_FROM_INSTANCE(proc);
-
- pattern = get_dynamic_type_pattern(type);
-
- if (pattern != NULL)
- {
- proc->endianness = pattern->endianness;
- proc->memsize = pattern->memsize;
- proc->inssize = pattern->inssize;
- proc->virt_space = pattern->virt_space;
- }
}
@@ -294,10 +297,12 @@ static int py_arch_processor_init(PyObject *self, PyObject *args, PyObject *kwds
proc = G_ARCH_PROCESSOR(pygobject_get(self));
+ /*
proc->endianness = endianness;
proc->memsize = mem_size;
proc->inssize = ins_min_size;
proc->virt_space = vspace;
+ */
register_dynamic_type_pattern(G_OBJECT(proc));