summaryrefslogtreecommitdiff
path: root/src/arch
diff options
context:
space:
mode:
Diffstat (limited to 'src/arch')
-rw-r--r--src/arch/dalvik/context.c41
1 files changed, 41 insertions, 0 deletions
diff --git a/src/arch/dalvik/context.c b/src/arch/dalvik/context.c
index f1af7e9..e80ead3 100644
--- a/src/arch/dalvik/context.c
+++ b/src/arch/dalvik/context.c
@@ -120,6 +120,9 @@ static void g_dalvik_dcontext_dispose(GDalvikDContext *);
/* Procède à la libération totale de la mémoire. */
static void g_dalvik_dcontext_finalize(GDalvikDContext *);
+/* Duplique un contexte de compilation. */
+static GDalvikDContext *g_dalvik_dcontext_dup(GDalvikDContext *);
+
/* Convertit un registre machine en un pseudo-registre. */
static GDecInstruction *g_dalvik_dcontext_convert_register(GDalvikDContext *, GDalvikRegisterOperand *, bool);
@@ -331,6 +334,7 @@ static void g_dalvik_dcontext_init(GDalvikDContext *ctx)
parent = G_DEC_CONTEXT(ctx);
+ parent->dup = (dup_dec_context_fc)g_dalvik_dcontext_dup;
parent->convert_reg = (convert_register_fc)g_dalvik_dcontext_convert_register;
}
@@ -402,6 +406,43 @@ GDalvikDContext *g_dalvik_dcontext_new(void)
/******************************************************************************
* *
+* Paramètres : orig = contexte de compilation à copier. *
+* *
+* Description : Duplique un contexte de compilation. *
+* *
+* Retour : Contexte de décompilation prêt à emploi. *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+static GDalvikDContext *g_dalvik_dcontext_dup(GDalvikDContext *orig)
+{
+ GDalvikDContext *result; /* Structure à retourner */
+
+ result = g_object_new(G_TYPE_DALVIK_DCONTEXT, NULL);
+
+ //g_object_unref(G_OBJECT(result->args));
+ //g_object_unref(G_OBJECT(result->locals));
+
+ _g_dec_context_dup(G_DEC_CONTEXT(result), G_DEC_CONTEXT(orig));
+
+ if (orig->this != NULL) g_object_ref(G_OBJECT(orig->this));
+ //g_object_ref(G_OBJECT(orig->args));
+ //g_object_ref(G_OBJECT(orig->locals));
+
+ result->this = orig->this;
+ result->args = orig->args;
+ result->locals = orig->locals;
+ result->locals_count = orig->locals_count;
+
+ return result;
+
+}
+
+
+/******************************************************************************
+* *
* Paramètres : ctx = instance à consulter, voire mettre à jour. *
* operand = opérande représentant un registre quelconque. *
* assign = précise le sort prochain du registre. *